1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-29 01:42:33 +01:00

Fix running scripts

Fix broken symlink
Update slackware init script
Add new build options to wpath.py
This commit is contained in:
Dan O'Reilly
2008-12-11 00:29:00 -05:00
parent faf60f6ed3
commit e3c70de4f5
7 changed files with 22 additions and 11 deletions

View File

@@ -21,6 +21,7 @@ import os
import locale
import gettext
import sys
import re
from threading import Thread
from subprocess import Popen, STDOUT, PIPE, call
from commands import getoutput
@@ -347,13 +348,13 @@ def detect_desktop_environment():
def get_sudo_cmd(msg):
""" Returns a graphical sudo command for generic use. """
sudo_prog = misc.choose_sudo_prog()
sudo_prog = choose_sudo_prog()
if not sudo_prog: return None
if sudo_prog.endswith("gksu") or sudo_prog.endswith("ktsuss"):
if re.search("(ktsuss|gksu|gksudo)$", sudo_prog):
msg_flag = "-m"
else:
msg_flag = "--caption"
misc.LaunchAndWait([sudo_prog, msg_flag, msg])
return [sudo_prog, msg_flag, msg]
def choose_sudo_prog():
""" Try to intelligently decide which graphical sudo program to use. """

View File

@@ -570,11 +570,12 @@ class WiredNetworkEntry(NetworkEntry):
profile = self.combo_profile_names.get_active_text()
cmdend = [os.path.join(wpath.lib, "configscript.py"), profile, "wired"]
if os.getuid() != 0:
cmdbase = misc.get_sudo_cmd()
cmdbase = misc.get_sudo_cmd(language['scripts_need_pass'])
if not cmdbase:
error(None, language["no_sudo_prog"])
return
cmdbase.extend(cmdend)
misc.LaunchAndWait(cmdbase)
else:
misc.LaunchAndWait(cmdend)
@@ -839,11 +840,12 @@ class WirelessNetworkEntry(NetworkEntry):
cmdend = [os.path.join(wpath.lib, "configscript.py"),
str(self.networkID), "wireless"]
if os.getuid() != 0:
cmdbase = misc.get_sudo_cmd()
cmdbase = misc.get_sudo_cmd(language['scripts_need_pass'])
if not cmdbase:
error(None, language["no_sudo_prog"])
return
cmdbase.extend(cmdend)
misc.LaunchAndWait(cmdbase)
else:
misc.LaunchAndWait(cmdend)

View File

@@ -241,7 +241,7 @@ class PreferencesDialog(object):
daemon.SetAlwaysShowWiredInterface(self.wiredcheckbox.get_active())
daemon.SetAutoReconnect(self.reconnectcheckbox.get_active())
daemon.SetDebugMode(self.debugmodecheckbox.get_active())
daemon.SetSignalDisplayType(self.displaytypecheckbox.get_active())
daemon.SetSignalDisplayType(int(self.displaytypecheckbox.get_active()))
if self.showlistradiobutton.get_active():
daemon.SetWiredAutoConnectMethod(2)
elif self.lastusedradiobutton.get_active():

3
wicd/wpath.py Normal file → Executable file
View File

@@ -58,8 +58,7 @@ no_install_init = False
no_install_man = False
no_install_kde = False
no_install_acpi = False
no_install_install = False
no_install_license = False
no_install_docs = False
def chdir(file):
"""Change directory to the location of the specified file.