From f609ff99fe760a7cb2e026c31251037da0f5ecd1 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 16 May 2009 20:50:20 +0800 Subject: [PATCH 1/6] Apply .desktop file patch from Debian (remove deprecated encoding line) --- other/wicd-tray.desktop | 1 - setup.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/other/wicd-tray.desktop b/other/wicd-tray.desktop index a5f1f6d..d2cc87b 100644 --- a/other/wicd-tray.desktop +++ b/other/wicd-tray.desktop @@ -1,6 +1,5 @@ [Desktop Entry] Categories=Application;Network; -Encoding=UTF-8 Exec=wicd-client GenericName=Network Manager Icon=wicd-client diff --git a/setup.py b/setup.py index 5f4992c..f1cf96b 100755 --- a/setup.py +++ b/setup.py @@ -236,6 +236,7 @@ class configure(Command): self.mandir = '/usr/man/' self.no_install_acpi = True elif self.distro in ['debian']: + self.wicdgroup = "netdev" self.init = '/etc/init.d/' self.initfile = 'init/debian/wicd' elif self.distro in ['arch']: From 51f46c40a18131c1fd24d55cae34909bb71b3b2b Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Tue, 19 May 2009 15:44:52 -0500 Subject: [PATCH 2/6] Make sure the /sys/class/net/whatever is actually a directory in GetWiredInterfaces() (similar to the check in GetWireless) --- wicd/wnettools.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wicd/wnettools.py b/wicd/wnettools.py index f5d720d..848a4a9 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -121,8 +121,9 @@ def GetWirelessInterfaces(): def GetWiredInterfaces(): """ Returns a list of wired interfaces on the system. """ basedir = '/sys/class/net/' - return [iface for iface in os.listdir(basedir) if not 'wireless' - in os.listdir(basedir + iface) and + return [iface for iface in os.listdir(basedir) + if os.path.isdir(basedir + iface) and not 'wireless' + in os.listdir(basedir + iface) and open(basedir + iface + "/type").readlines()[0].strip() == "1"] def NeedsExternalCalls(): From d693839013a09ff9402a7b9b0be8c45a37bb8f78 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Wed, 20 May 2009 07:01:31 +0800 Subject: [PATCH 3/6] Changed DHCP client order to dhcpcd -> pump -> dhclient --- setup.py | 4 ++++ wicd/wnettools.py | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index f1cf96b..041597b 100755 --- a/setup.py +++ b/setup.py @@ -86,6 +86,8 @@ class configure(Command): ('initfilename=', None, "set the name of the init file (don't use)"), ('wicdgroup=', None, "set the name of the group used for wicd"), ('distro=', None, 'set the distribution for which wicd will be installed'), + ('loggroup=', None, 'the group the log file belongs to'), + ('logperms=', None, 'the log file permissions'), # Configure switches ('no-install-init', None, "do not install the init file"), @@ -220,6 +222,8 @@ class configure(Command): self.pidfile = '/var/run/wicd/wicd.pid' self.initfilename = os.path.basename(self.initfile) self.wicdgroup = 'users' + self.loggroup = '' + self.logperms = '0600' def distro_check(self): print "Distro is: "+self.distro diff --git a/wicd/wnettools.py b/wicd/wnettools.py index f5d720d..6cd91d2 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -213,17 +213,17 @@ class BaseInterface(object): """ def get_client_name(cl): """ Converts the integer value for a dhcp client to a string. """ - if self.dhclient_cmd and cl in [misc.DHCLIENT, misc.AUTO]: - client = "dhclient" - cmd = self.dhclient_cmd - if self.dhclient_needs_verbose: - cmd += ' -v' - elif self.dhcpcd_cmd and cl in [misc.DHCPCD, misc.AUTO]: + if self.dhcpcd_cmd and cl in [misc.DHCPCD, misc.AUTO]: client = "dhcpcd" cmd = self.dhcpcd_cmd elif self.pump_cmd and cl in [misc.PUMP, misc.AUTO]: client = "pump" cmd = self.pump_cmd + elif self.dhclient_cmd and cl in [misc.DHCLIENT, misc.AUTO]: + client = "dhclient" + cmd = self.dhclient_cmd + if self.dhclient_needs_verbose: + cmd += ' -v' else: client = None cmd = "" From 5837a1228ea43dc2ea366195fef667b9f029f35b Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Wed, 20 May 2009 07:09:42 +0800 Subject: [PATCH 4/6] changed DHCP client order in preferences dialog --- data/wicd.glade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/wicd.glade b/data/wicd.glade index c42ddb1..258f6b8 100644 --- a/data/wicd.glade +++ b/data/wicd.glade @@ -1138,7 +1138,7 @@ is already active. False - 1 + 3 @@ -1153,7 +1153,7 @@ is already active. False - 2 + 1 @@ -1168,7 +1168,7 @@ is already active. False - 3 + 2 From a886d437b6178a40e8ec1455e14f03ab796180c0 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Tue, 19 May 2009 21:18:30 -0400 Subject: [PATCH 5/6] Flipped the order of the dhcp clients in the prefs dialog and fixed a syntax error in wicd-curses.py. --- curses/prefs_curses.py | 7 +++++-- curses/wicd-curses.py | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/curses/prefs_curses.py b/curses/prefs_curses.py index d51c61d..43da851 100644 --- a/curses/prefs_curses.py +++ b/curses/prefs_curses.py @@ -177,7 +177,10 @@ class PrefsDialog(urwid.WidgetWrap): self.dhcp_header = urwid.Text(dhcp_header_t) self.dhcp_l = [] - # Automatic + + # Order of these is flipped in the actual interface, + # (2,3,1 -> dhcpcd, pump, dhclient), because dhclient often doesn't like + # to work on several distros. self.dhcp0 = urwid.RadioButton(self.dhcp_l,automatic_t) self.dhcp1 = DynRadioButton(self.dhcp_l,dhcp1_t) self.dhcp2 = DynRadioButton(self.dhcp_l,dhcp2_t) @@ -199,7 +202,7 @@ class PrefsDialog(urwid.WidgetWrap): self.flush_l = [self.flush0,self.flush1,self.flush2] externalLB = urwid.ListBox([self.dhcp_header, - self.dhcp0,self.dhcp1,self.dhcp2,self.dhcp3, + self.dhcp0,self.dhcp2,self.dhcp3,self.dhcp1, _blank, self.wired_detect_header, self.wired0,self.wired1,self.wired2, diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 34559e4..93a83b1 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -69,8 +69,8 @@ from optparse import OptionParser #from grp import getgrgid #from os import getgroups,system -import logging -import logging.handler +#import logging +#import logging.handler CURSES_REVNO=wpath.curses_revision @@ -1099,7 +1099,7 @@ if __name__ == '__main__': parser.add_option("-r", "--raw-screen",action="store_const",const='raw' ,dest='screen',help="use urwid's raw screen controller (default)") parser.add_option("-c", "--curses-screen",action="store_const",const='curses',dest='screen',help="use urwid's curses screen controller") - parser.add_option("-d", "--debug",action="store_true", + parser.add_option("-d", "--debug",action="store_true" ,dest='debug',help="enable logging of wicd-curses (currently does nothing)") (options,args) = parser.parse_args() main() From c66383903d0883f86ddabcdda7ef9b7645a298eb Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Tue, 19 May 2009 21:20:29 -0400 Subject: [PATCH 6/6] Added wrap_exceptions to wicd-curses.py's run() function. --- curses/wicd-curses.py | 1 + 1 file changed, 1 insertion(+) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 93a83b1..4bc7b06 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -1041,6 +1041,7 @@ def main(): urwid.set_encoding('utf8') ui.run_wrapper(run) +@wrap_exceptions def run(): global loop loop = gobject.MainLoop()