1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-22 05:48:03 +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

@@ -58,8 +58,7 @@ no_install_init = %NO_INSTALL_INIT%
no_install_man = %NO_INSTALL_MAN% no_install_man = %NO_INSTALL_MAN%
no_install_kde = %NO_INSTALL_KDE% no_install_kde = %NO_INSTALL_KDE%
no_install_acpi = %NO_INSTALL_ACPI% no_install_acpi = %NO_INSTALL_ACPI%
no_install_install = %NO_INSTALL_INSTALL% no_install_docs = %NO_INSTALL_DOCS%
no_install_license = %NO_INSTALL_LICENSE%
def chdir(file): def chdir(file):
"""Change directory to the location of the specified file. """Change directory to the location of the specified file.

View File

@@ -1 +0,0 @@
link wicd=wpath.py.in

1
in/wpath.py.in Symbolic link
View File

@@ -0,0 +1 @@
wicd=wpath.py.in

View File

@@ -17,6 +17,10 @@ wicd_start() {
else else
echo "Starting wicd daemon..." echo "Starting wicd daemon..."
wicd 2>/dev/null 1>&2 wicd 2>/dev/null 1>&2
# Activate the pm-utils sleep hook
if [ ! -x /usr/lib/pm-utils/sleep.d/55wicd ]; then
chmod +x /usr/lib/pm-utils/sleep.d/55wicd
fi
fi fi
} }
@@ -28,6 +32,11 @@ wicd_stop() {
else else
pkill -f python.*wicd-daemon.py 2>/dev/null pkill -f python.*wicd-daemon.py 2>/dev/null
fi fi
# Deactivate the pm-utils sleep hook
if [ -x /usr/lib/pm-utils/sleep.d/55wicd ]; then
chmod -x /usr/lib/pm-utils/sleep.d/55wicd
fi
} }
# See how we were called and take appropriate action # See how we were called and take appropriate action
@@ -49,3 +58,4 @@ case $1 in
;; ;;
esac esac

View File

@@ -21,6 +21,7 @@ import os
import locale import locale
import gettext import gettext
import sys import sys
import re
from threading import Thread from threading import Thread
from subprocess import Popen, STDOUT, PIPE, call from subprocess import Popen, STDOUT, PIPE, call
from commands import getoutput from commands import getoutput
@@ -347,13 +348,13 @@ def detect_desktop_environment():
def get_sudo_cmd(msg): def get_sudo_cmd(msg):
""" Returns a graphical sudo command for generic use. """ """ 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 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" msg_flag = "-m"
else: else:
msg_flag = "--caption" msg_flag = "--caption"
misc.LaunchAndWait([sudo_prog, msg_flag, msg]) return [sudo_prog, msg_flag, msg]
def choose_sudo_prog(): def choose_sudo_prog():
""" Try to intelligently decide which graphical sudo program to use. """ """ 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() profile = self.combo_profile_names.get_active_text()
cmdend = [os.path.join(wpath.lib, "configscript.py"), profile, "wired"] cmdend = [os.path.join(wpath.lib, "configscript.py"), profile, "wired"]
if os.getuid() != 0: if os.getuid() != 0:
cmdbase = misc.get_sudo_cmd() cmdbase = misc.get_sudo_cmd(language['scripts_need_pass'])
if not cmdbase: if not cmdbase:
error(None, language["no_sudo_prog"]) error(None, language["no_sudo_prog"])
return return
cmdbase.extend(cmdend) cmdbase.extend(cmdend)
misc.LaunchAndWait(cmdbase)
else: else:
misc.LaunchAndWait(cmdend) misc.LaunchAndWait(cmdend)
@@ -839,11 +840,12 @@ class WirelessNetworkEntry(NetworkEntry):
cmdend = [os.path.join(wpath.lib, "configscript.py"), cmdend = [os.path.join(wpath.lib, "configscript.py"),
str(self.networkID), "wireless"] str(self.networkID), "wireless"]
if os.getuid() != 0: if os.getuid() != 0:
cmdbase = misc.get_sudo_cmd() cmdbase = misc.get_sudo_cmd(language['scripts_need_pass'])
if not cmdbase: if not cmdbase:
error(None, language["no_sudo_prog"]) error(None, language["no_sudo_prog"])
return return
cmdbase.extend(cmdend) cmdbase.extend(cmdend)
misc.LaunchAndWait(cmdbase)
else: else:
misc.LaunchAndWait(cmdend) misc.LaunchAndWait(cmdend)

View File

@@ -241,7 +241,7 @@ class PreferencesDialog(object):
daemon.SetAlwaysShowWiredInterface(self.wiredcheckbox.get_active()) daemon.SetAlwaysShowWiredInterface(self.wiredcheckbox.get_active())
daemon.SetAutoReconnect(self.reconnectcheckbox.get_active()) daemon.SetAutoReconnect(self.reconnectcheckbox.get_active())
daemon.SetDebugMode(self.debugmodecheckbox.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(): if self.showlistradiobutton.get_active():
daemon.SetWiredAutoConnectMethod(2) daemon.SetWiredAutoConnectMethod(2)
elif self.lastusedradiobutton.get_active(): 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_man = False
no_install_kde = False no_install_kde = False
no_install_acpi = False no_install_acpi = False
no_install_install = False no_install_docs = False
no_install_license = False
def chdir(file): def chdir(file):
"""Change directory to the location of the specified file. """Change directory to the location of the specified file.