From d2d2bae6d8e34bf00a7e5ed4c97774ded227c037 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 9 Jun 2009 13:25:02 +0800 Subject: [PATCH 01/49] display the ESSID/Wired Network in the title of the settings dialog --- wicd/netentry.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/wicd/netentry.py b/wicd/netentry.py index 296fd46..979832d 100644 --- a/wicd/netentry.py +++ b/wicd/netentry.py @@ -45,14 +45,20 @@ def setup_dbus(): wired = dbusmanager.get_interface('wired') class AdvancedSettingsDialog(gtk.Dialog): - def __init__(self): + def __init__(self, network_name=None): """ Build the base advanced settings dialog. This class isn't used by itself, instead it is used as a parent for the WiredSettingsDialog and WirelessSettingsDialog. """ - gtk.Dialog.__init__(self, title=language['properties'], + # if no network name was passed, just use Properties as the title + if network_name: + title = '%s - %s' % (network_name, language['properties']) + else: + title = language['properties'] + + gtk.Dialog.__init__(self, title=title, flags=gtk.DIALOG_MODAL, buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT, gtk.STOCK_OK, @@ -236,7 +242,7 @@ class AdvancedSettingsDialog(gtk.Dialog): class WiredSettingsDialog(AdvancedSettingsDialog): def __init__(self, name): """ Build the wired settings dialog. """ - AdvancedSettingsDialog.__init__(self) + AdvancedSettingsDialog.__init__(self, language['wired_network']) self.des = self.connect("destroy", self.destroy_called) self.script_button.connect("clicked", self.edit_scripts) self.prof_name = name @@ -294,7 +300,7 @@ class WiredSettingsDialog(AdvancedSettingsDialog): class WirelessSettingsDialog(AdvancedSettingsDialog): def __init__(self, networkID): """ Build the wireless settings dialog. """ - AdvancedSettingsDialog.__init__(self) + AdvancedSettingsDialog.__init__(self, wireless.GetWirelessProperty(networkID, 'essid')) # Set up encryption stuff self.networkID = networkID self.combo_encryption = gtk.combo_box_new_text() From 858c75fe12a00453ca912b0b31e13b7cdc7b24e2 Mon Sep 17 00:00:00 2001 From: David Paleino Date: Sat, 13 Jun 2009 22:05:10 +0200 Subject: [PATCH 02/49] Remove deprecated Encoding field --- other/wicd.desktop | 1 - 1 file changed, 1 deletion(-) diff --git a/other/wicd.desktop b/other/wicd.desktop index 7221c15..a0f334f 100644 --- a/other/wicd.desktop +++ b/other/wicd.desktop @@ -1,6 +1,5 @@ [Desktop Entry] Categories=Application;Network; -Encoding=UTF-8 Exec=wicd-client --no-tray GenericName=Network Manager Icon=wicd-client From 8fd7855b3cdf6084974df77b33c50e3e3e6609d2 Mon Sep 17 00:00:00 2001 From: David Paleino Date: Sat, 13 Jun 2009 22:06:08 +0200 Subject: [PATCH 03/49] Update manpage with an appropriate WHATIS entry --- man/wicd-client.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/wicd-client.1 b/man/wicd-client.1 index 6d86469..a2e71ad 100644 --- a/man/wicd-client.1 +++ b/man/wicd-client.1 @@ -1,6 +1,6 @@ -.TH WICD-CLIENT "1" "February 2009" "wicd-client " "User Commands" +.TH WICD-CLIENT "1" "June 2009" "wicd-client " "User Commands" .SH NAME -wicd-client \- manual page for wicd-client +wicd-client \- frontend to the WICD daemon .SH DESCRIPTION wireless (and wired) connection daemon front\-end. From c95ede898a64a90e96e67eb6425712c1e0403878 Mon Sep 17 00:00:00 2001 From: David Paleino Date: Sat, 13 Jun 2009 22:07:49 +0200 Subject: [PATCH 04/49] Support udhcpc, this is needed to smoothly run on the OpenMoko FreeRunner. Thanks to Luca Capello for porting the patch to 1.5.9, and to "madmo" from the linked forum for making the patch. Patch originally taken from http://wicd.net/punbb/viewtopic.php?id=132 Patch ported to 1.6.0 code by David Paleino . --- curses/prefs_curses.py | 10 +++++--- data/wicd.glade | 15 ++++++++++++ wicd/misc.py | 1 + wicd/prefs.py | 7 ++++-- wicd/wnettools.py | 53 +++++++++++++++++++++++++++++++++++------- 5 files changed, 72 insertions(+), 14 deletions(-) diff --git a/curses/prefs_curses.py b/curses/prefs_curses.py index 43da851..bf1eb74 100644 --- a/curses/prefs_curses.py +++ b/curses/prefs_curses.py @@ -93,6 +93,7 @@ class PrefsDialog(urwid.WidgetWrap): dhcp1_t = 'dhclient' dhcp2_t = 'dhcpcd' dhcp3_t = 'pump' + dhcp4_t = 'udhcpc' wired_detect_header_t = ('header',language["wired_detect"]) wired1_t = 'ethtool' @@ -185,7 +186,8 @@ class PrefsDialog(urwid.WidgetWrap): self.dhcp1 = DynRadioButton(self.dhcp_l,dhcp1_t) self.dhcp2 = DynRadioButton(self.dhcp_l,dhcp2_t) self.dhcp3 = DynRadioButton(self.dhcp_l,dhcp3_t) - self.dhcp_l = [self.dhcp0,self.dhcp1,self.dhcp2,self.dhcp3] + self.dhcp4 = DynRadioButton(self.dhcp_l,dhcp4_t) + self.dhcp_l = [self.dhcp0,self.dhcp1,self.dhcp2,self.dhcp3,self.dhcp4] self.wired_l = [] self.wired_detect_header = urwid.Text(wired_detect_header_t) @@ -202,7 +204,7 @@ class PrefsDialog(urwid.WidgetWrap): self.flush_l = [self.flush0,self.flush1,self.flush2] externalLB = urwid.ListBox([self.dhcp_header, - self.dhcp0,self.dhcp2,self.dhcp3,self.dhcp1, + self.dhcp0,self.dhcp2,self.dhcp3,self.dhcp1,self.dhcp4, _blank, self.wired_detect_header, self.wired0,self.wired1,self.wired2, @@ -351,8 +353,10 @@ class PrefsDialog(urwid.WidgetWrap): dhcp_client = misc.DHCLIENT elif self.dhcp2.get_state(): dhcp_client = misc.DHCPCD - else: + elif self.dhcp3.get_state(): dhcp_client = misc.PUMP + else: + dhcp_client = misc.UDHCPC daemon.SetDHCPClient(dhcp_client) if self.wired0.get_state(): diff --git a/data/wicd.glade b/data/wicd.glade index 258f6b8..f37be7e 100644 --- a/data/wicd.glade +++ b/data/wicd.glade @@ -1171,6 +1171,21 @@ is already active. 2 + + + udhcpc + True + True + False + True + True + dhclient_radio + + + False + 4 + + diff --git a/wicd/misc.py b/wicd/misc.py index 2dde1d4..1ed4e33 100644 --- a/wicd/misc.py +++ b/wicd/misc.py @@ -49,6 +49,7 @@ AUTO = 0 DHCLIENT = 1 DHCPCD = 2 PUMP = 3 +UDHCPC = 4 # Link detection tools ETHTOOL = 1 diff --git a/wicd/prefs.py b/wicd/prefs.py index a8da776..6072f8d 100644 --- a/wicd/prefs.py +++ b/wicd/prefs.py @@ -82,7 +82,7 @@ class PreferencesDialog(object): self.preferwiredcheckbox.set_active(daemon.GetPreferWiredNetwork()) dhcp_list = [self.dhcpautoradio, self.dhclientradio, self.dhcpcdradio, - self.pumpradio] + self.pumpradio, self.udhcpcradio] self._setup_external_app_radios(dhcp_list, daemon.GetDHCPClient, daemon.SetDHCPClient) @@ -210,8 +210,10 @@ class PreferencesDialog(object): dhcp_client = misc.DHCLIENT elif self.dhcpcdradio.get_active(): dhcp_client = misc.DHCPCD - else: + elif self.pumpradio.get_active(): dhcp_client = misc.PUMP + else: + dhcp_client = misc.UDHCPC daemon.SetDHCPClient(dhcp_client) if self.linkautoradio.get_active(): @@ -347,6 +349,7 @@ class PreferencesDialog(object): self.dhclientradio = self.wTree.get_widget("dhclient_radio") self.pumpradio = self.wTree.get_widget("pump_radio") self.dhcpcdradio = self.wTree.get_widget("dhcpcd_radio") + self.udhcpcradio = self.wTree.get_widget("udhcpc_radio") # Wired Link Detection Apps self.linkautoradio = setup_label("link_auto_radio", 'wicd_auto_config') diff --git a/wicd/wnettools.py b/wicd/wnettools.py index 113015f..f1b2eda 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -250,6 +250,9 @@ class BaseInterface(object): cmd = self.dhclient_cmd if self.dhclient_needs_verbose: cmd += ' -v' + elif self.udhcpc_cmd and cl in [misc.UDHCPC, misc.AUTO]: + client = "udhcpc" + cmd = self.udhcpc_cmd else: client = None cmd = "" @@ -257,20 +260,25 @@ class BaseInterface(object): client_dict = { "dhclient" : - {'connect' : r"%s %s", - 'release' : r"%s -r %s", + {'connect' : r"%(cmd)s %(iface)s", + 'release' : r"%(cmd)s -r %(iface)s", 'id' : misc.DHCLIENT, }, "pump" : - { 'connect' : r"%s -i %s", - 'release' : r"%s -r -i %s", + { 'connect' : r"%(cmd)s -i %(iface)s", + 'release' : r"%(cmd)s -r -i %(iface)s", 'id' : misc.PUMP, }, "dhcpcd" : - {'connect' : r"%s %s", - 'release' : r"%s -k %s", + {'connect' : r"%(cmd)s %(iface)s", + 'release' : r"%(cmd)s -k %(iface)s", 'id' : misc.DHCPCD, }, + "udhcpc": + {'connect' : r"%(cmd)s -n -i %(iface)s", + 'release' : r"killall -SIGUSR2 %(cmd)s", + 'id' : misc.UDHCPC, + }, } (client_name, cmd) = get_client_name(self.DHCP_CLIENT) if not client_name or not cmd: @@ -278,9 +286,9 @@ class BaseInterface(object): return "" if flavor == "connect": - return client_dict[client_name]['connect'] % (cmd, self.iface) + return client_dict[client_name]['connect'] % {"cmd":cmd, "iface":self.iface} elif flavor == "release": - return client_dict[client_name]['release'] % (cmd, self.iface) + return client_dict[client_name]['release'] % {"cmd":cmd, "iface":self.iface} else: return client_dict[client_name]['id'] @@ -327,6 +335,7 @@ class BaseInterface(object): self.dhclient_needs_verbose = False self.dhcpcd_cmd = self._find_program_path("dhcpcd") self.pump_cmd = self._find_program_path("pump") + self.udhcpc_cmd = self._find_program_path("udhcpc") def CheckWiredTools(self): """ Check for the existence of ethtool and mii-tool. """ @@ -485,7 +494,31 @@ class BaseInterface(object): print line return self._check_dhcp_result(dhcpcd_success) - + + def _parse_udhcpc(self, pipe): + """ Determines if obtaining an IP using udhcpc succeeded. + + Keyword arguments: + pipe -- stdout pipe to the dhcpcd process. + + Returns: + 'success' if successful, an error code string otherwise. + + """ + udhcpc_complete = False + udhcpc_success = True + + while not udhcpc_complete: + line = pipe.readline() + if line.endswith("failing"): + udhcpc_success = False + udhcpc_complete = True + elif line == '': + udhcpc_complete = True + print line + + return self._check_dhcp_result(udhcpc_success) + def _check_dhcp_result(self, success): """ Print and return the correct DHCP connection result. @@ -524,6 +557,8 @@ class BaseInterface(object): return self._parse_pump(pipe) elif DHCP_CLIENT == misc.DHCPCD: return self._parse_dhcpcd(pipe) + elif DHCP_CLIENT == misc.UDHCPC: + return self._parse_udhcpc(pipe) else: print 'ERROR no dhclient found!' From 355a8bca1c0cf282ea7e0f7a57030b3850d11944 Mon Sep 17 00:00:00 2001 From: David Paleino Date: Sat, 13 Jun 2009 22:59:03 +0200 Subject: [PATCH 05/49] Support --loggroup and --logperms arguments to setup.py --- .bzrignore | 1 + wicd/wicd-daemon.py => in/wicd=wicd-daemon.py.in | 8 ++++++-- in/wicd=wpath.py.in | 2 ++ setup.py | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) rename wicd/wicd-daemon.py => in/wicd=wicd-daemon.py.in (99%) diff --git a/.bzrignore b/.bzrignore index 29a8142..0cfc4e1 100644 --- a/.bzrignore +++ b/.bzrignore @@ -22,5 +22,6 @@ scripts/wicd scripts/wicd-client scripts/wicd-curses translations/* +wicd/wicd-daemon.py wicd/wpath.py *tags diff --git a/wicd/wicd-daemon.py b/in/wicd=wicd-daemon.py.in similarity index 99% rename from wicd/wicd-daemon.py rename to in/wicd=wicd-daemon.py.in index 24289ed..32abcbe 100644 --- a/wicd/wicd-daemon.py +++ b/in/wicd=wicd-daemon.py.in @@ -1671,9 +1671,13 @@ def main(argv): output = ManagedStdio(logpath) if os.path.exists(logpath): try: - os.chmod(logpath, 0600) + os.chmod(logpath, %LOGPERMS%) + if "%LOGGROUP%": + import grp + group = grp.getgrnam("%LOGGROUP%") + os.chown(logpath, 0, group[2]) except: - print 'unable to chmod log file to 0600' + print 'unable to chmod log file to %LOGPERMS%' if redirect_stdout: sys.stdout = output if redirect_stderr: sys.stderr = output diff --git a/in/wicd=wpath.py.in b/in/wicd=wpath.py.in index d1fbbc1..b441ba5 100755 --- a/in/wicd=wpath.py.in +++ b/in/wicd=wpath.py.in @@ -62,6 +62,8 @@ initfile = '%INITFILE%' # stores only the file name, i.e. wicd initfilename = '%INITFILENAME%' wicd_group = '%WICDGROUP%' +log_group = '%LOGGROUP%' +log_perms = '%LOGPERMS%' # BOOLEANS no_install_pmutils = %NO_INSTALL_PMUTILS% diff --git a/setup.py b/setup.py index c2f67cc..13508b8 100755 --- a/setup.py +++ b/setup.py @@ -242,6 +242,8 @@ class configure(Command): self.no_install_acpi = True elif self.distro in ['debian']: self.wicdgroup = "netdev" + self.loggroup = "adm" + self.logperms = "0640" self.init = '/etc/init.d/' self.initfile = 'init/debian/wicd' elif self.distro in ['arch']: From d07dea23903dd8e557630ff676ffdc197866b97d Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Sun, 14 Jun 2009 14:25:06 -0400 Subject: [PATCH 06/49] Convert strings being prints out by dhclients to utf-8 before trying to log them. When iwscan displays two entries for a hidden network, only display the one with the essid included. --- wicd/networking.py | 11 +++++++++-- wicd/wnettools.py | 16 +++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/wicd/networking.py b/wicd/networking.py index 8eaa454..937f323 100644 --- a/wicd/networking.py +++ b/wicd/networking.py @@ -315,6 +315,13 @@ class ConnectThread(threading.Thread): self.SetStatus('interface_down') + def run(self): + self.connect_result = "Failed" + try: + self._connect() + finally: + self.is_connecting = False + def set_should_die(self, val): self.lock.acquire() try: @@ -794,7 +801,7 @@ class WirelessConnectThread(ConnectThread): self.wpa_driver = wpa_driver - def run(self): + def _connect(self): """ The main function of the connection thread. This function performs the necessary calls to connect to the @@ -1006,7 +1013,7 @@ class WiredConnectThread(ConnectThread): after_script, disconnect_script, gdns1, gdns2, gdns3, gdns_dom, gsearch_dom, liface, debug) - def run(self): + def _connect(self): """ The main function of the connection thread. This function performs the necessary calls to connect to the diff --git a/wicd/wnettools.py b/wicd/wnettools.py index 113015f..5864941 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -431,7 +431,7 @@ class BaseInterface(object): if line == '': # Empty string means dhclient is done. dhclient_complete = True else: - print line.strip('\n') + print misc.to_unicode(line.strip('\n')) if line.startswith('bound'): dhclient_success = True dhclient_complete = True @@ -458,7 +458,7 @@ class BaseInterface(object): elif line.strip().lower().startswith('Operation failed.'): pump_success = False pump_complete = True - print line + print misc.to_unicode(line) return self._check_dhcp_result(pump_success) @@ -482,7 +482,7 @@ class BaseInterface(object): dhcpcd_complete = True elif line == '': dhcpcd_complete = True - print line + print misc.to_unicode(line) return self._check_dhcp_result(dhcpcd_success) @@ -1106,15 +1106,21 @@ class BaseWirelessInterface(BaseInterface): # An array for the access points access_points = [] + access_points = {} for cell in networks: # Only use sections where there is an ESSID. if 'ESSID:' in cell: # Add this network to the list of networks entry = self._ParseAccessPoint(cell, ralink_info) if entry is not None: - access_points.append(entry) + # Normally we only get duplicate bssids with hidden + # networks. If we hit this, we only want the entry + # with the real essid to be in the network list. + if (entry['bssid'] not in access_points + or not entry['hidden']): + access_points[entry['bssid']] = entry - return access_points + return access_points.values() def _ParseAccessPoint(self, cell, ralink_info): """ Parse a single cell from the output of iwlist. From 73a08c5c55adcb98f2eafd2d55b9c06c6f3607dc Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 16 Jun 2009 07:44:27 +0800 Subject: [PATCH 07/49] disable automatically disconnecting when Automatically reconnect is False --- wicd/monitor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/monitor.py b/wicd/monitor.py index 2937360..6dcb0a0 100755 --- a/wicd/monitor.py +++ b/wicd/monitor.py @@ -185,7 +185,7 @@ class ConnectionStatus(object): # try to reconnect. self.connection_lost_counter += 1 print self.connection_lost_counter - if self.connection_lost_counter >= 4: + if self.connection_lost_counter >= 4 and daemon.GetAutoReconnect(): wireless.DisconnectWireless() self.connection_lost_counter = 0 return False From 0c1c6c107ceb859cc0e49ec96d1cdfaf6269cb9f Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 16 Jun 2009 23:08:52 +0800 Subject: [PATCH 08/49] moved wicd-daemon.py back to wicd/ and changed wpath replacement values to use the wpath module --- in/wicd=wicd-daemon.py.in => wicd/wicd-daemon.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename in/wicd=wicd-daemon.py.in => wicd/wicd-daemon.py (99%) diff --git a/in/wicd=wicd-daemon.py.in b/wicd/wicd-daemon.py similarity index 99% rename from in/wicd=wicd-daemon.py.in rename to wicd/wicd-daemon.py index 32abcbe..8d7805b 100644 --- a/in/wicd=wicd-daemon.py.in +++ b/wicd/wicd-daemon.py @@ -1671,13 +1671,13 @@ def main(argv): output = ManagedStdio(logpath) if os.path.exists(logpath): try: - os.chmod(logpath, %LOGPERMS%) - if "%LOGGROUP%": + os.chmod(logpath, wpath.logperms) + if wpath.loggroup: import grp - group = grp.getgrnam("%LOGGROUP%") + group = grp.getgrnam(wpath.loggroup) os.chown(logpath, 0, group[2]) except: - print 'unable to chmod log file to %LOGPERMS%' + print 'unable to chmod log file to %s' % wpath.logperms if redirect_stdout: sys.stdout = output if redirect_stderr: sys.stderr = output From 46bce8ea5e11b324afb463b696a25fe5af0d5898 Mon Sep 17 00:00:00 2001 From: David Paleino Date: Tue, 16 Jun 2009 17:13:41 +0200 Subject: [PATCH 09/49] Provide a pre-/post-down script mechanism WICD currently only provides pre-/post-connection scripts, and only one disconnection script, that is run before actually disconnecting. This provides pre-/post-disconnection scripts, thus increasing configuration flexibility. --- curses/configscript_curses.py | 20 ++++++--- curses/wicd-curses.py | 2 +- data/wicd.glade | 39 ++++++++++++++-- in/man=wicd-wired-settings.conf.5.in | 8 +++- in/man=wicd-wireless-settings.conf.5.in | 7 ++- in/wicd=wpath.py.in | 3 +- setup.py | 3 +- wicd/configscript.py | 30 ++++++++----- wicd/networking.py | 60 ++++++++++++++++--------- wicd/translations.py | 3 +- wicd/wicd-daemon.py | 21 ++++++--- 11 files changed, 139 insertions(+), 57 deletions(-) diff --git a/curses/configscript_curses.py b/curses/configscript_curses.py index 46f1e60..a93ad99 100755 --- a/curses/configscript_curses.py +++ b/curses/configscript_curses.py @@ -38,7 +38,8 @@ language = {} language['configure_scripts'] = _("Configure Scripts") language['before_script'] = _("Pre-connection Script") language['after_script'] = _("Post-connection Script") -language['disconnect_script'] = _("Disconnection Script") +language['pre_disconnect_script'] = _("Pre-disconnection Script") +language['post_disconnect_script'] = _("Post-disconnection Script") def main(argv): global ui,frame @@ -62,16 +63,19 @@ def main(argv): blank = urwid.Text('') pre_entry_t = ('body',language['before_script']+': ') post_entry_t = ('body',language['after_script']+': ') - disconnect_entry_t = ('body',language['disconnect_script']+': ') + pre_disconnect_entry_t = ('body',language['pre_disconnect_script']+': ') + post_disconnect_entry_t = ('body',language['post_disconnect_script']+': ') - global pre_entry,post_entry,disconnect_entry + global pre_entry,post_entry,pre_disconnect_entry,post_disconnect_entry pre_entry = urwid.AttrWrap(urwid.Edit(pre_entry_t, none_to_blank(script_info.get('pre_entry'))),'editbx','editfc' ) post_entry = urwid.AttrWrap(urwid.Edit(post_entry_t, none_to_blank(script_info.get('post_entry'))),'editbx','editfc' ) - disconnect_entry = urwid.AttrWrap(urwid.Edit(disconnect_entry_t, - none_to_blank(script_info.get('disconnect_entry'))),'editbx','editfc' ) + pre_disconnect_entry = urwid.AttrWrap(urwid.Edit(pre_disconnect_entry_t, + none_to_blank(script_info.get('pre_disconnect_entry'))),'editbx','editfc' ) + post_disconnect_entry = urwid.AttrWrap(urwid.Edit(post_disconnect_entry_t, + none_to_blank(script_info.get('post_disconnect_entry'))),'editbx','editfc' ) # The buttons ok_button = urwid.AttrWrap(urwid.Button('OK',ok_callback),'body','focus') @@ -82,7 +86,8 @@ def main(argv): lbox = urwid.Pile([('fixed',2,urwid.Filler(pre_entry)), #('fixed',urwid.Filler(blank),1), ('fixed',2,urwid.Filler(post_entry)), - ('fixed',2,urwid.Filler(disconnect_entry)), + ('fixed',2,urwid.Filler(pre_disconnect_entry)), + ('fixed',2,urwid.Filler(post_disconnect_entry)), #blank,blank,blank,blank,blank, urwid.Filler(button_cols,'bottom') ]) @@ -92,7 +97,8 @@ def main(argv): if result == True: script_info["pre_entry"] = blank_to_none(pre_entry.get_edit_text()) script_info["post_entry"] = blank_to_none(post_entry.get_edit_text()) - script_info["disconnect_entry"] = blank_to_none(disconnect_entry.get_edit_text()) + script_info["pre_disconnect_entry"] = blank_to_none(pre_disconnect_entry.get_edit_text()) + script_info["post_disconnect_entry"] = blank_to_none(post_disconnect_entry.get_edit_text()) write_scripts(network, network_type, script_info) OK_PRESSED = False diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 042a224..744cd15 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -263,7 +263,7 @@ def run_configscript(parent,netname,nettype): # Translation needs to be changed to accomidate this text below. """You can also configure the wireless networks by looking for the "[]" field in the config file. -Once there, you can adjust (or add) the "beforescript", "afterscript", and "disconnectscript" variables as needed, to change the preconnect, postconnect, and disconnect scripts respectively. Note that you will be specifying the full path to the scripts - not the actual script contents. You will need to add/edit the script contents separately. Refer to the wicd manual page for more information."""] +Once there, you can adjust (or add) the "beforescript", "afterscript", "predisconnectscript" and "postdisconnectscript" variables as needed, to change the preconnect, postconnect, predisconnect and postdisconnect scripts respectively. Note that you will be specifying the full path to the scripts - not the actual script contents. You will need to add/edit the script contents separately. Refer to the wicd manual page for more information."""] dialog = TextDialog(theText,20,80) dialog.run(ui,parent) # This code works with many distributions, but not all of them. So, to diff --git a/data/wicd.glade b/data/wicd.glade index f37be7e..5dbbc0b 100644 --- a/data/wicd.glade +++ b/data/wicd.glade @@ -342,18 +342,18 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 150 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Disconnection Script: + Pre-disconnection Script: 0 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK @@ -370,6 +370,39 @@ 3 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + 150 + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Post-disconnection Script: + + + 0 + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + 1 + + + + + False + False + 5 + 4 + + 1 diff --git a/in/man=wicd-wired-settings.conf.5.in b/in/man=wicd-wired-settings.conf.5.in index 6d0b06c..31b33c3 100644 --- a/in/man=wicd-wired-settings.conf.5.in +++ b/in/man=wicd-wired-settings.conf.5.in @@ -33,8 +33,12 @@ The script should be a Bourne-compatible script and should be executable. IMPORTANT - scripts should ONLY be writable by root and located in a directory that is only writable by root. .TP -.BI "disconnectscript = " -This defines a script to run when Wicd disconnects the interface. +.BI "predisconnectscript = " +This defines a script to run before Wicd disconnects the interface. +The script should be a Bourne-compatible script and should be executable. +.TP +.BI "postdisconnectscript = " +This defines a script to run after Wicd disconnects the interface. The script should be a Bourne-compatible script and should be executable. .br IMPORTANT - scripts should ONLY be writable by root and located in a diff --git a/in/man=wicd-wireless-settings.conf.5.in b/in/man=wicd-wireless-settings.conf.5.in index 79ac751..dd567df 100644 --- a/in/man=wicd-wireless-settings.conf.5.in +++ b/in/man=wicd-wireless-settings.conf.5.in @@ -99,8 +99,11 @@ This defines a script to run after Wicd brings up the connection. IMPORTANT - scripts should ONLY be writable by root and located in a directory that is writable by only root. .TP -.BI "disconnectscript = " -This defines a script to run when Wicd disconnects the interface. +.BI "predisconnectscript = " +This defines a script to run before Wicd disconnects the interface. +.TP +.BI "postdisconnectscript = " +This defines a script to run after Wicd disconnects the interface. .br IMPORTANT - scripts should ONLY be writable by root and located in a directory that is writable by only root. diff --git a/in/wicd=wpath.py.in b/in/wicd=wpath.py.in index d1fbbc1..99937d0 100755 --- a/in/wicd=wpath.py.in +++ b/in/wicd=wpath.py.in @@ -27,7 +27,8 @@ lib = '%LIB%' share = '%SHARE%' etc = '%ETC%' scripts = '%SCRIPTS%' -disconnectscripts = '%SCRIPTS%disconnect' +predisconnectscripts = '%SCRIPTS%predisconnect' +postdisconnectscripts = '%SCRIPTS%postdisconnect' preconnectscripts = '%SCRIPTS%preconnect' postconnectscripts = '%SCRIPTS%postconnect' images = '%IMAGES%' diff --git a/setup.py b/setup.py index c2f67cc..1fff4ab 100755 --- a/setup.py +++ b/setup.py @@ -488,7 +488,8 @@ try: (wpath.backends, ['wicd/backends/be-external.py', 'wicd/backends/be-ioctl.py']), (wpath.autostart, ['other/wicd-tray.desktop', ]), (wpath.scripts, []), - (wpath.disconnectscripts, []), + (wpath.predisconnectscripts, []), + (wpath.postdisconnectscripts, []), (wpath.preconnectscripts, []), (wpath.postconnectscripts, []), ] diff --git a/wicd/configscript.py b/wicd/configscript.py index b574d04..cf10596 100755 --- a/wicd/configscript.py +++ b/wicd/configscript.py @@ -42,7 +42,8 @@ language = {} language['configure_scripts'] = _("Configure Scripts") language['before_script'] = _("Pre-connection Script") language['after_script'] = _("Post-connection Script") -language['disconnect_script'] = _("Disconnection Script") +language['pre_disconnect_script'] = _("Pre-disconnection Script") +language['post_disconnect_script'] = _("Post-disconnection Script") dbus = dbusmanager.DBusManager() dbus.connect_to_dbus() @@ -100,14 +101,16 @@ def get_script_info(network, network_type): if con.has_section(network): info["pre_entry"] = get_val(con, network, "beforescript") info["post_entry"] = get_val(con, network, "afterscript") - info["disconnect_entry"] = get_val(con, network, "disconnectscript") + info["pre_disconnect_entry"] = get_val(con, network, "predisconnectscript") + info["post_disconnect_entry"] = get_val(con, network, "postdisconnectscript") else: bssid = wireless.GetWirelessProperty(int(network), "bssid") con.read(wireless_conf) if con.has_section(bssid): info["pre_entry"] = get_val(con, bssid, "beforescript") info["post_entry"] = get_val(con, bssid, "afterscript") - info["disconnect_entry"] = get_val(con, bssid, "disconnectscript") + info["pre_disconnect_entry"] = get_val(con, bssid, "predisconnectscript") + info["post_disconnect_entry"] = get_val(con, bssid, "postdisconnectscript") return info def write_scripts(network, network_type, script_info): @@ -120,7 +123,8 @@ def write_scripts(network, network_type, script_info): con.add_section(network) con.set(network, "beforescript", script_info["pre_entry"]) con.set(network, "afterscript", script_info["post_entry"]) - con.set(network, "disconnectscript", script_info["disconnect_entry"]) + con.set(network, "predisconnectscript", script_info["pre_disconnect_entry"]) + con.set(network, "postdisconnectscript", script_info["post_disconnect_entry"]) con.write(open(wired_conf, "w")) wired.ReloadConfig() wired.ReadWiredNetworkProfile(network) @@ -132,7 +136,8 @@ def write_scripts(network, network_type, script_info): con.add_section(bssid) con.set(bssid, "beforescript", script_info["pre_entry"]) con.set(bssid, "afterscript", script_info["post_entry"]) - con.set(bssid, "disconnectscript", script_info["disconnect_entry"]) + con.set(bssid, "predisconnectscript", script_info["pre_disconnect_entry"]) + con.set(bssid, "postdisconnectscript", script_info["post_disconnect_entry"]) con.write(open(wireless_conf, "w")) wireless.ReloadConfig() wireless.ReadWirelessNetworkProfile(int(network)) @@ -155,25 +160,30 @@ def main (argv): dialog = wTree.get_widget("configure_script_dialog") wTree.get_widget("pre_label").set_label(language['before_script'] + ":") wTree.get_widget("post_label").set_label(language['after_script'] + ":") - wTree.get_widget("disconnect_label").set_label(language['disconnect_script'] + wTree.get_widget("pre_disconnect_label").set_label(language['pre_disconnect_script'] + + ":") + wTree.get_widget("post_disconnect_label").set_label(language['post_disconnect_script'] + ":") wTree.get_widget("window1").hide() pre_entry = wTree.get_widget("pre_entry") post_entry = wTree.get_widget("post_entry") - disconnect_entry = wTree.get_widget("disconnect_entry") + pre_disconnect_entry = wTree.get_widget("pre_disconnect_entry") + post_disconnect_entry = wTree.get_widget("post_disconnect_entry") pre_entry.set_text(none_to_blank(script_info.get("pre_entry"))) post_entry.set_text(none_to_blank(script_info.get("post_entry"))) - disconnect_entry.set_text(none_to_blank(script_info.get("disconnect_entry"))) - + pre_disconnect_entry.set_text(none_to_blank(script_info.get("pre_disconnect_entry"))) + post_disconnect_entry.set_text(none_to_blank(script_info.get("post_disconnect_entry"))) + dialog.show_all() result = dialog.run() if result == 1: script_info["pre_entry"] = blank_to_none(pre_entry.get_text()) script_info["post_entry"] = blank_to_none(post_entry.get_text()) - script_info["disconnect_entry"] = blank_to_none(disconnect_entry.get_text()) + script_info["pre_disconnect_entry"] = blank_to_none(pre_disconnect_entry.get_text()) + script_info["post_disconnect_entry"] = blank_to_none(post_disconnect_entry.get_text()) write_scripts(network, network_type, script_info) dialog.destroy() diff --git a/wicd/networking.py b/wicd/networking.py index 937f323..c9eb8ca 100644 --- a/wicd/networking.py +++ b/wicd/networking.py @@ -151,7 +151,8 @@ class Controller(object): self.connecting_thread = None self.before_script = None self.after_script = None - self.disconnect_script = None + self.pre_disconnect_script = None + self.post_disconnect_script = None self.driver = None self.iface = None @@ -203,17 +204,23 @@ class Controller(object): def Disconnect(self, *args, **kargs): """ Disconnect from the network. """ iface = self.iface - misc.ExecuteScripts(wpath.disconnectscripts, self.debug) - if self.disconnect_script: - print 'Running disconnect script' - misc.ExecuteScript(expand_script_macros(self.disconnect_script, - 'disconnection', *args), + misc.ExecuteScripts(wpath.predisconnectscripts, self.debug) + if self.pre_disconnect_script: + print 'Running pre-disconnect script' + misc.ExecuteScript(expand_script_macros(self.pre_disconnect_script, + 'pre-disconnection', *args), self.debug) iface.ReleaseDHCP() iface.SetAddress('0.0.0.0') iface.FlushRoutes() iface.Down() iface.Up() + misc.ExecuteScripts(wpath.postdisconnectscripts, self.debug) + if self.post_disconnect_script: + print 'Running post-disconnect script' + misc.ExecuteScript(expand_script_macros(self.post_disconnect_script, + 'post-disconnection', *args), + self.debug) def ReleaseDHCP(self): """ Release the DHCP lease for this interface. """ @@ -273,8 +280,8 @@ class ConnectThread(threading.Thread): lock = threading.Lock() def __init__(self, network, interface_name, before_script, after_script, - disconnect_script, gdns1, gdns2, gdns3, gdns_dom, gsearch_dom, - iface, debug): + pre_disconnect_script, post_disconnect_script, gdns1, + gdns2, gdns3, gdns_dom, gsearch_dom, iface, debug): """ Initialise the required object variables and the thread. Keyword arguments: @@ -283,7 +290,8 @@ class ConnectThread(threading.Thread): wired -- name of the wired interface before_script -- script to run before bringing up the interface after_script -- script to run after bringing up the interface - disconnect_script -- script to run after disconnection + pre_disconnect_script -- script to run before disconnection + post_disconnect_script -- script to run after disconnection gdns1 -- global DNS server 1 gdns2 -- global DNS server 2 gdns3 -- global DNS server 3 @@ -297,7 +305,8 @@ class ConnectThread(threading.Thread): self.connect_result = None self.before_script = before_script self.after_script = after_script - self.disconnect_script = disconnect_script + self.pre_disconnect_script = pre_disconnect_script + self.post_disconnect_script = post_disconnect_script self._should_die = False self.abort_reason = "" self.connect_result = "" @@ -607,7 +616,8 @@ class Wireless(Controller): self.connecting_thread = WirelessConnectThread(network, self.wireless_interface, self.wpa_driver, self.before_script, - self.after_script, self.disconnect_script, self.global_dns_1, + self.after_script, self.pre_disconnect_script, + self.post_disconnect_script, self.global_dns_1, self.global_dns_2, self.global_dns_3, self.global_dns_dom, self.global_search_dom, self.wiface, debug) self.connecting_thread.setDaemon(True) @@ -779,8 +789,9 @@ class WirelessConnectThread(ConnectThread): """ def __init__(self, network, wireless, wpa_driver, before_script, - after_script, disconnect_script, gdns1, gdns2, gdns3, - gdns_dom, gsearch_dom, wiface, debug=False): + after_script, pre_disconnect_script, post_disconnect_script, + gdns1, gdns2, gdns3, gdns_dom, gsearch_dom, wiface, + debug=False): """ Initialise the thread with network information. Keyword arguments: @@ -789,14 +800,16 @@ class WirelessConnectThread(ConnectThread): wpa_driver -- type of wireless interface before_script -- script to run before bringing up the interface after_script -- script to run after bringing up the interface - disconnect_script -- script to run after disconnection + pre_disconnect_script -- script to run before disconnection + post_disconnect_script -- script to run after disconnection gdns1 -- global DNS server 1 gdns2 -- global DNS server 2 gdns3 -- global DNS server 3 """ ConnectThread.__init__(self, network, wireless, before_script, - after_script, disconnect_script, gdns1, gdns2, + after_script, pre_disconnect_script, + post_disconnect_script, gdns1, gdns2, gdns3, gdns_dom, gsearch_dom, wiface, debug) self.wpa_driver = wpa_driver @@ -967,9 +980,10 @@ class Wired(Controller): if not self.liface: return False self.connecting_thread = WiredConnectThread(network, self.wired_interface, self.before_script, self.after_script, - self.disconnect_script, self.global_dns_1, self.global_dns_2, - self.global_dns_3, self.global_dns_dom, self.global_search_dom, - self.liface, debug) + self.pre_disconnect_script, self.post_disconnect_script, + self.global_dns_1, self.global_dns_2, self.global_dns_3, + self.global_dns_dom, self.global_search_dom, self.liface, + debug) self.connecting_thread.setDaemon(True) self.connecting_thread.start() return self.connecting_thread @@ -993,8 +1007,8 @@ class WiredConnectThread(ConnectThread): """ def __init__(self, network, wired, before_script, after_script, - disconnect_script, gdns1, gdns2, gdns3, gdns_dom, gsearch_dom, - liface, debug=False): + pre_disconnect_script, post_disconnect_script, gdns1, + gdns2, gdns3, gdns_dom, gsearch_dom, liface, debug=False): """ Initialise the thread with network information. Keyword arguments: @@ -1003,14 +1017,16 @@ class WiredConnectThread(ConnectThread): wired -- name of the wired interface before_script -- script to run before bringing up the interface after_script -- script to run after bringing up the interface - disconnect_script -- script to run after disconnection + pre_disconnect_script -- script to run before disconnection + post_disconnect_script -- script to run after disconnection gdns1 -- global DNS server 1 gdns2 -- global DNS server 2 gdns3 -- global DNS server 3 """ ConnectThread.__init__(self, network, wired, before_script, - after_script, disconnect_script, gdns1, gdns2, + after_script, pre_disconnect_script, + post_disconnect_script, gdns1, gdns2, gdns3, gdns_dom, gsearch_dom, liface, debug) def _connect(self): diff --git a/wicd/translations.py b/wicd/translations.py index 77d232d..f101385 100644 --- a/wicd/translations.py +++ b/wicd/translations.py @@ -74,7 +74,8 @@ language['wired_networks'] = _('''Wired Networks''') language['backend_alert'] = _('''Changes to your backend won't occur until the daemon is restarted.''') language['about_help'] = _('''Stop a network connection in progress''') language['connecting'] = _('''Connecting''') -language['disconnect_script'] = _('''Run disconnect script''') +language['pre_disconnect_script'] = _('''Run pre-disconnect script''') +language['post_disconnect_script'] = _('''Run post-disconnect script''') language['cannot_edit_scripts_1'] = _('''To avoid various complications, wicd-curses does not support directly editing the scripts directly. However, you can edit them manually. First, (as root)", open the "$A" config file, and look for the section labeled by the $B in question. In this case, this is:''') language['cannot_edit_scripts_3'] = _('''You can also configure the wireless networks by looking for the "[]" field in the config file.''') language['cannot_edit_scripts_2'] = _('''Once there, you can adjust (or add) the "beforescript", "afterscript", and "disconnectscript" variables as needed, to change the preconnect, postconnect, and disconnect scripts respectively. Note that you will be specifying the full path to the scripts - not the actual script contents. You will need to add/edit the script contents separately. Refer to the wicd manual page for more information.''') diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 24289ed..233525e 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -1134,8 +1134,10 @@ class WirelessDaemon(dbus.service.Object): # is done. self.wifi.before_script = self.GetWirelessProperty(id, 'beforescript') self.wifi.after_script = self.GetWirelessProperty(id, 'afterscript') - self.wifi.disconnect_script = self.GetWirelessProperty(id, - 'disconnectscript') + self.wifi.pre_disconnect_script = self.GetWirelessProperty(id, + 'predisconnectscript') + self.wifi.post_disconnect_script = self.GetWirelessProperty(id, + 'postdisconnectscript') print 'Connecting to wireless network ' + self.LastScan[id]['essid'] self.daemon.wired_bus.wired.Disconnect() self.daemon.SetForcedDisconnect(False) @@ -1222,12 +1224,14 @@ class WirelessDaemon(dbus.service.Object): write_script_ent(bssid_key, "beforescript") write_script_ent(bssid_key, "afterscript") - write_script_ent(bssid_key, "disconnectscript") + write_script_ent(bssid_key, "predisconnectscript") + write_script_ent(bssid_key, "postdisconnectscript") if cur_network["use_settings_globally"]: write_script_ent(essid_key, "beforescript") write_script_ent(essid_key, "afterscript") - write_script_ent(essid_key, "disconnectscript") + write_script_ent(essid_key, "predisconnectscript") + write_script_ent(essid_key, "postdisconnectscript") self.config.write() @@ -1421,7 +1425,8 @@ class WiredDaemon(dbus.service.Object): """ Connects to a wired network. """ self.wired.before_script = self.GetWiredProperty("beforescript") self.wired.after_script = self.GetWiredProperty("afterscript") - self.wired.disconnect_script = self.GetWiredProperty("disconnectscript") + self.wired.pre_disconnect_script = self.GetWiredProperty("predisconnectscript") + self.wired.post_disconnect_script = self.GetWiredProperty("postdisconnectscript") self.daemon.wireless_bus.wifi.Disconnect() self.daemon.SetForcedDisconnect(False) self.UnsetWiredLastUsed() @@ -1439,7 +1444,8 @@ class WiredDaemon(dbus.service.Object): for option in ["ip", "broadcast", "netmask","gateway", "search_domain", "dns_domain", "dns1", "dns2", "dns3", "beforescript", - "afterscript", "disconnectscript"]: + "afterscript", "predisconnectscript", + "postdisconnectscript"]: self.config.set(profilename, option, None) self.config.set(profilename, "default", default) self.config.write() @@ -1507,7 +1513,8 @@ class WiredDaemon(dbus.service.Object): write_script_ent(profilename, "beforescript") write_script_ent(profilename, "afterscript") - write_script_ent(profilename, "disconnectscript") + write_script_ent(profilename, "predisconnectscript") + write_script_ent(profilename, "postdisconnectscript") self.config.write() return "100: Profile Written" From 6b7bfed11ffdbfe8a0c6d06bad94fcc827f7e211 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 16 Jun 2009 23:22:40 +0800 Subject: [PATCH 10/49] removed wicd-daemon.py from .bzrignore --- .bzrignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.bzrignore b/.bzrignore index 0cfc4e1..29a8142 100644 --- a/.bzrignore +++ b/.bzrignore @@ -22,6 +22,5 @@ scripts/wicd scripts/wicd-client scripts/wicd-curses translations/* -wicd/wicd-daemon.py wicd/wpath.py *tags From 5adf46811d7cd63a292619212d7a645d889572d7 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 16 Jun 2009 23:36:58 +0800 Subject: [PATCH 11/49] fix a small typo in misc.py -- thanks to David Paleino --- wicd/misc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/misc.py b/wicd/misc.py index 1ed4e33..bc5a2bd 100644 --- a/wicd/misc.py +++ b/wicd/misc.py @@ -447,7 +447,7 @@ def choose_sudo_prog(prog_num=0): paths = [] if desktop_env == "kde": - progs = ["kdesu", "kdesudo", "ktusss"] + progs = ["kdesu", "kdesudo", "ktsuss"] else: progs = ["gksudo", "gksu", "ktsuss"] From 99fd8ee4d4633f3e6604efbd976a804b06dc0954 Mon Sep 17 00:00:00 2001 From: David Paleino Date: Tue, 16 Jun 2009 17:56:21 +0200 Subject: [PATCH 12/49] Add "status" to /etc/init.d/wicd (Debian/Ubuntu) --- in/init=debian=wicd.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/in/init=debian=wicd.in b/in/init=debian=wicd.in index f08e836..879695b 100755 --- a/in/init=debian=wicd.in +++ b/in/init=debian=wicd.in @@ -153,9 +153,12 @@ case "$1" in ;; esac ;; + status) + status_of_proc -p $PIDFILE $DAEMON $NAME + ;; *) #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2 exit 3 ;; esac From 1c761ca232e1710be1776b189c5cb43e6c18d338 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 16 Jun 2009 23:57:02 +0800 Subject: [PATCH 13/49] added forgotten underscores --- wicd/wicd-daemon.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 8d7805b..3488483 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -1671,13 +1671,13 @@ def main(argv): output = ManagedStdio(logpath) if os.path.exists(logpath): try: - os.chmod(logpath, wpath.logperms) - if wpath.loggroup: + os.chmod(logpath, wpath.log_perms) + if wpath.log_group: import grp - group = grp.getgrnam(wpath.loggroup) + group = grp.getgrnam(wpath.log_group) os.chown(logpath, 0, group[2]) except: - print 'unable to chmod log file to %s' % wpath.logperms + print 'unable to chmod log file to %s' % wpath.log_perms if redirect_stdout: sys.stdout = output if redirect_stderr: sys.stderr = output From 8de0e98010ca9c7e9962891a5ec78b7c141b32a8 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Thu, 18 Jun 2009 14:56:25 +0800 Subject: [PATCH 14/49] fixed crash that occured when clicking to connect to a secured network but without entering the security information --- wicd/gui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/gui.py b/wicd/gui.py index f49c3f9..0023b73 100644 --- a/wicd/gui.py +++ b/wicd/gui.py @@ -679,7 +679,7 @@ class appGui(object): if nettype == "wireless": if not self.check_encryption_valid(networkid, networkentry.advanced_dialog): - self.edit_advanced(None, None, nettype, networkid, networkentry) + self.edit_advanced(None, nettype, networkid, networkentry) return False wireless.ConnectWireless(networkid, reply_handler=handler, error_handler=handler) From 3578e338e66711454f85fae5c8803fbd9aabcace Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Thu, 18 Jun 2009 15:16:29 +0800 Subject: [PATCH 15/49] allow user to cancel preferences dialog if they chose not to connect after clicking connect and showing the preferences dialog --- wicd/gui.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/wicd/gui.py b/wicd/gui.py index 0023b73..03da45b 100644 --- a/wicd/gui.py +++ b/wicd/gui.py @@ -666,24 +666,28 @@ class appGui(object): """ Initiates the connection process in the daemon. """ def handler(*args): self._connect_thread_started = True - - cancel_button = self.wTree.get_widget("cancel_button") - cancel_button.set_sensitive(True) - self.network_list.set_sensitive(False) - if self.statusID: - gobject.idle_add(self.status_bar.remove, 1, self.statusID) - gobject.idle_add(self.set_status, language["disconnecting_active"]) - gobject.idle_add(self.status_area.show_all) - self.wait_for_events() - self._connect_thread_started = False + + def setup_interface_for_connection(): + cancel_button = self.wTree.get_widget("cancel_button") + cancel_button.set_sensitive(True) + self.network_list.set_sensitive(False) + if self.statusID: + gobject.idle_add(self.status_bar.remove, 1, self.statusID) + gobject.idle_add(self.set_status, language["disconnecting_active"]) + gobject.idle_add(self.status_area.show_all) + self.wait_for_events() + self._connect_thread_started = False + if nettype == "wireless": if not self.check_encryption_valid(networkid, networkentry.advanced_dialog): self.edit_advanced(None, nettype, networkid, networkentry) return False + setup_interface_for_connection() wireless.ConnectWireless(networkid, reply_handler=handler, error_handler=handler) elif nettype == "wired": + setup_interface_for_connection() wired.ConnectWired(reply_handler=handler, error_handler=handler) gobject.source_remove(self.update_cb) From fa626d2ac455519e753fa76344c762be22c8f120 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Fri, 19 Jun 2009 17:29:25 -0400 Subject: [PATCH 16/49] Made wicd-curses.py spit out an error if a dbus access denied error appears on startup. --- curses/wicd-curses.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 042a224..fdce9ce 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -38,7 +38,6 @@ at least get a network connection. Or those who don't like using X. ;-) import warnings warnings.filterwarnings("ignore","The popen2 module is deprecated. Use the subprocess module.") # UI stuff -# This library is the only reason why I wrote this program. import urwid # DBus communication stuff @@ -64,6 +63,7 @@ import netentry_curses from netentry_curses import WirelessSettingsDialog, WiredSettingsDialog,AdvancedSettingsDialog from optparse import OptionParser +from os import system # Stuff about getting the script configurer running #from grp import getgrgid @@ -72,7 +72,7 @@ from optparse import OptionParser #import logging #import logging.handler -CURSES_REVNO=wpath.curses_revision +CURSES_REV=wpath.curses_revision # Fix strings in wicd-curses from wicd.translations import language @@ -1047,7 +1047,17 @@ setup_dbus() ##### MAIN ENTRY POINT ######################################## if __name__ == '__main__': - parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REVNO,daemon.Hello())) + try: + parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REV,daemon.Hello())) + except Exception as ex: + if "Rejected send message" in ex.args[0]: + print "" + system("\ +echo ERROR: wicd-curses was denied access to the wicd daemon, make sure that \ +your user is in the group \\'$(tput bold)$(tput setaf 4)"+ wpath.wicd_group+"$(tput sgr0)\\'.") + sys.exit(1) + else: + raise parser.set_defaults(screen='raw',debug=False) parser.add_option("-r", "--raw-screen",action="store_const",const='raw' ,dest='screen',help="use urwid's raw screen controller (default)") From 94e02277f35ea98b32de7271d3bed5996c5f6fda Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Fri, 19 Jun 2009 18:48:39 -0400 Subject: [PATCH 17/49] Updated wicd-curses to use DBusException.get_dbus_name() instead of the exception arguments. --- curses/wicd-curses.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index fdce9ce..b06202a 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -1049,11 +1049,11 @@ setup_dbus() if __name__ == '__main__': try: parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REV,daemon.Hello())) - except Exception as ex: - if "Rejected send message" in ex.args[0]: + except Exception as e: + if "DBus.Error.AccessDenied" in e.get_dbus_name(): print "" system("\ -echo ERROR: wicd-curses was denied access to the wicd daemon, make sure that \ +echo ERROR: wicd-curses was denied access to the wicd daemon, please check that \ your user is in the group \\'$(tput bold)$(tput setaf 4)"+ wpath.wicd_group+"$(tput sgr0)\\'.") sys.exit(1) else: From 1142a1d084e6cd2eda9921bb18ed5fd6b6652287 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Fri, 19 Jun 2009 18:59:30 -0400 Subject: [PATCH 18/49] Fixed wicd-client to actually show the error dialog, by checking e.get_dbus_name() instead of just e. --- wicd/wicd-client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index 97f3095..c7b9114 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -86,9 +86,10 @@ def catchdbus(func): def wrapper(*args, **kwargs): try: return func(*args, **kwargs) - except DBusException, e: - if "DBus.Error.AccessDenied" in e: + except DBusException as e: + if e.get_dbus_name() != None and "DBus.Error.AccessDenied" in e.get_dbus_name(): error(None, language['access_denied']) + #raise raise DBusException(e) else: print "warning: ignoring exception %s" % e From 5eee87cf80b400f57bd4fa290bb8abda77f5c8e0 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Fri, 19 Jun 2009 20:07:10 -0400 Subject: [PATCH 19/49] Use the ANSI escape sequences to print colors instead of fetching them using tput(1) in wicd-curses. --- curses/wicd-curses.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index b06202a..691b402 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -1051,10 +1051,9 @@ if __name__ == '__main__': parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REV,daemon.Hello())) except Exception as e: if "DBus.Error.AccessDenied" in e.get_dbus_name(): - print "" - system("\ + print "\ echo ERROR: wicd-curses was denied access to the wicd daemon, please check that \ -your user is in the group \\'$(tput bold)$(tput setaf 4)"+ wpath.wicd_group+"$(tput sgr0)\\'.") +your user is in the group \'\033[1;34m"+ wpath.wicd_group+"\033[0m\'." sys.exit(1) else: raise From e10969637a60a2077fbaf62f0a56530a4028bbbf Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Fri, 19 Jun 2009 23:03:42 -0400 Subject: [PATCH 20/49] Made the wicd-curses "access denied" string translatable, and updated wicd-curses.py to use it. --- curses/wicd-curses.py | 4 +--- wicd/translations.py | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 691b402..659b880 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -1051,9 +1051,7 @@ if __name__ == '__main__': parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REV,daemon.Hello())) except Exception as e: if "DBus.Error.AccessDenied" in e.get_dbus_name(): - print "\ -echo ERROR: wicd-curses was denied access to the wicd daemon, please check that \ -your user is in the group \'\033[1;34m"+ wpath.wicd_group+"\033[0m\'." + print language['access_denied_wc'].replace('$A','\033[1;34m'+wpath.wicd_group+'\033[0m') sys.exit(1) else: raise diff --git a/wicd/translations.py b/wicd/translations.py index 77d232d..ef1206d 100644 --- a/wicd/translations.py +++ b/wicd/translations.py @@ -55,7 +55,7 @@ def get_gettext(): _ = lang.gettext return _ -# Generated automatically on Fri, 05 Jun 2009 03:13:27 CDT +# Generated automatically on Fri, 19 Jun 2009 21:59:18 CDT _ = get_gettext() language = {} language['resetting_ip_address'] = _('''Resetting IP address...''') @@ -216,3 +216,4 @@ language['establishing_connection'] = _('''Establishing connection...''') language['association_failed'] = _('''Connection failed: Could not contact the wireless access point.''') language['access_denied'] = _('''Unable to contact the Wicd daemon due to an access denied error from DBus. Please check your DBus configuration.''') language['disconnecting_active'] = _('''Disconnecting active connections...''') +language['access_denied_wc'] = _('''ERROR: wicd-curses was denied access to the wicd daemon, please check that your user is in the group "$A".''') From 1e97b34205164a320bce7d5783a9df0aa31f786a Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Fri, 19 Jun 2009 22:08:32 -0500 Subject: [PATCH 21/49] seperated chmod and chown try/excepts --- wicd/wicd-daemon.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 3488483..a04a3d4 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -1672,12 +1672,16 @@ def main(argv): if os.path.exists(logpath): try: os.chmod(logpath, wpath.log_perms) + except: + print 'unable to chmod log file to %s' % wpath.log_perms + + try: if wpath.log_group: import grp group = grp.getgrnam(wpath.log_group) os.chown(logpath, 0, group[2]) except: - print 'unable to chmod log file to %s' % wpath.log_perms + print 'unable to chown log file to %s' % group[2] if redirect_stdout: sys.stdout = output if redirect_stderr: sys.stderr = output From 340f84613aed2d3d5992edac20eb8623e2e7b5e1 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 20 Jun 2009 07:58:15 -0500 Subject: [PATCH 22/49] fix crash resulting from encryption info missing when connecting --- wicd/gui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/gui.py b/wicd/gui.py index 03da45b..2c426f9 100644 --- a/wicd/gui.py +++ b/wicd/gui.py @@ -642,7 +642,7 @@ class appGui(object): for entry_info in encryption_info.itervalues(): if entry_info[0].entry.get_text() == "" and \ entry_info[1] == 'required': - error(self, "%s (%s)" % (language['encrypt_info_missing'], + error(self.window, "%s (%s)" % (language['encrypt_info_missing'], entry_info[0].label.get_label()) ) return False From 96a7d07bca6dba459d32791872d18e7acd05a1df Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 20 Jun 2009 13:42:21 -0500 Subject: [PATCH 23/49] return 101 as the signal strength if altstrenth_pattern fails to find the strength --- wicd/wnettools.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wicd/wnettools.py b/wicd/wnettools.py index 65a2018..ac6d1c8 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -1366,7 +1366,14 @@ class BaseWirelessInterface(BaseInterface): (strength, max_strength) = (None, None) if strength in ['', None]: - [(strength, max_strength)] = altstrength_pattern.findall(output) + try: + [(strength, max_strength)] = altstrength_pattern.findall(output) + except ValueError: + # if the pattern was unable to match anything + # we'll return 101, which will allow us to stay + # connected even though we don't know the strength + # it also allows us to tell if + return 101 if strength not in ['', None] and max_strength: return (100 * int(strength) // int(max_strength)) elif strength not in ["", None]: From c93f3696bc08c699f50b9a0c699336d05e8e4fc9 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 20 Jun 2009 14:40:30 -0500 Subject: [PATCH 24/49] update FormatSignalForPrinting to return ??% instead of 101% --- wicd/wicd-daemon.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 24289ed..cf180d2 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -309,7 +309,13 @@ class WicdDaemon(dbus.service.Object): if self.GetSignalDisplayType() == 1: return (signal + " dBm") else: - return (signal + "%") + try: + if int(signal) == 101: + return '??%' + else: + return (signal + "%") + except ValueError: + return (signal + "%") @dbus.service.method('org.wicd.daemon') def SetSuspend(self, val): From 9ec96c1254484ebc9eb2900d12f53f6325920a73 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sat, 20 Jun 2009 21:41:17 -0400 Subject: [PATCH 25/49] Restore python 2.5 compatibility in both clients. --- curses/wicd-curses.py | 2 +- wicd/wicd-client.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 659b880..84fbdc9 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -1049,7 +1049,7 @@ setup_dbus() if __name__ == '__main__': try: parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REV,daemon.Hello())) - except Exception as e: + except Exception, e: if "DBus.Error.AccessDenied" in e.get_dbus_name(): print language['access_denied_wc'].replace('$A','\033[1;34m'+wpath.wicd_group+'\033[0m') sys.exit(1) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index c7b9114..6cc453b 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -86,7 +86,7 @@ def catchdbus(func): def wrapper(*args, **kwargs): try: return func(*args, **kwargs) - except DBusException as e: + except DBusException, e: if e.get_dbus_name() != None and "DBus.Error.AccessDenied" in e.get_dbus_name(): error(None, language['access_denied']) #raise From 5fa03d54aa2470eecde25aad8a55878a3eb3b71b Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 20 Jun 2009 21:59:45 -0500 Subject: [PATCH 26/49] updated translations.py --- wicd/translations.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wicd/translations.py b/wicd/translations.py index 695a1c1..e5d1092 100644 --- a/wicd/translations.py +++ b/wicd/translations.py @@ -55,7 +55,7 @@ def get_gettext(): _ = lang.gettext return _ -# Generated automatically on Sat, 20 Jun 2009 21:40:39 CDT +# Generated automatically on Sat, 20 Jun 2009 21:58:21 CDT _ = get_gettext() language = {} language['resetting_ip_address'] = _('''Resetting IP address...''') @@ -74,7 +74,7 @@ language['wired_networks'] = _('''Wired Networks''') language['backend_alert'] = _('''Changes to your backend won't occur until the daemon is restarted.''') language['about_help'] = _('''Stop a network connection in progress''') language['connecting'] = _('''Connecting''') -language['disconnect_script'] = _('''Run disconnect script''') +language['pre_disconnect_script'] = _('''Run pre-disconnect script''') language['cannot_edit_scripts_1'] = _('''To avoid various complications, wicd-curses does not support directly editing the scripts directly. However, you can edit them manually. First, (as root)", open the "$A" config file, and look for the section labeled by the $B in question. In this case, this is:''') language['cannot_edit_scripts_3'] = _('''You can also configure the wireless networks by looking for the "[]" field in the config file.''') language['cannot_edit_scripts_2'] = _('''Once there, you can adjust (or add) the "beforescript", "afterscript", and "disconnectscript" variables as needed, to change the preconnect, postconnect, and disconnect scripts respectively. Note that you will be specifying the full path to the scripts - not the actual script contents. You will need to add/edit the script contents separately. Refer to the wicd manual page for more information.''') @@ -217,3 +217,4 @@ language['association_failed'] = _('''Connection failed: Could not contact the w language['access_denied'] = _('''Unable to contact the Wicd daemon due to an access denied error from DBus. Please check your DBus configuration.''') language['disconnecting_active'] = _('''Disconnecting active connections...''') language['access_denied_wc'] = _('''ERROR: wicd-curses was denied access to the wicd daemon: please check that your user is in the "$A" group.''') +language['post_disconnect_script'] = _('''Run post-disconnect script''') From 868f5bb328059892735c9592c464008de4f8850d Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sat, 20 Jun 2009 23:46:38 -0400 Subject: [PATCH 27/49] Fix the log file chmodding (os.chmod() can't accept a string, apparently). --- wicd/wicd-daemon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 2c17100..2274b57 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -1684,7 +1684,7 @@ def main(argv): output = ManagedStdio(logpath) if os.path.exists(logpath): try: - os.chmod(logpath, wpath.log_perms) + os.chmod(logpath, int(wpath.log_perms,8)) except: print 'unable to chmod log file to %s' % wpath.log_perms From 42caa8af87091e68ecbb2302957d1af0bfa00a6e Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 20 Jun 2009 23:02:23 -0500 Subject: [PATCH 28/49] updated setup.py version and CHANGES --- CHANGES | 279 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 2 +- 2 files changed, 280 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 8946d49..e187896 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,283 @@ ------------------------------------------------------------ +revno: 425 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Sat 2009-06-20 23:46:38 -0400 +message: + Fix the log file chmodding (os.chmod() can't accept a string, apparently). +------------------------------------------------------------ +revno: 424 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-06-20 21:59:45 -0500 +message: + updated translations.py +------------------------------------------------------------ +revno: 423 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-06-20 21:44:32 -0500 +message: + merged lp:~nacl/wicd/1.6-access-denied to display an error message if access to the daemon via DBus is denied + ------------------------------------------------------------ + revno: 417.2.6 + committer: Andrew Psaltis + branch nick: 1.6-access-denied + timestamp: Sat 2009-06-20 21:41:17 -0400 + message: + Restore python 2.5 compatibility in both clients. + ------------------------------------------------------------ + revno: 417.2.5 + committer: Andrew Psaltis + branch nick: 1.6-access-denied + timestamp: Fri 2009-06-19 23:03:42 -0400 + message: + Made the wicd-curses "access denied" string translatable, and updated wicd-curses.py to use it. + ------------------------------------------------------------ + revno: 417.2.4 + committer: Andrew Psaltis + branch nick: 1.6-access-denied + timestamp: Fri 2009-06-19 20:07:10 -0400 + message: + Use the ANSI escape sequences to print colors instead of fetching them using tput(1) in wicd-curses. + ------------------------------------------------------------ + revno: 417.2.3 + committer: Andrew Psaltis + branch nick: 1.6-access-denied + timestamp: Fri 2009-06-19 18:59:30 -0400 + message: + Fixed wicd-client to actually show the error dialog, by checking e.get_dbus_name() instead of just e. + ------------------------------------------------------------ + revno: 417.2.2 + committer: Andrew Psaltis + branch nick: 1.6-access-denied + timestamp: Fri 2009-06-19 18:48:39 -0400 + message: + Updated wicd-curses to use DBusException.get_dbus_name() instead of the exception arguments. + ------------------------------------------------------------ + revno: 417.2.1 + committer: Andrew Psaltis + branch nick: 1.6-access-denied + timestamp: Fri 2009-06-19 17:29:25 -0400 + message: + Made wicd-curses.py spit out an error if a dbus access denied error appears on startup. +------------------------------------------------------------ +revno: 422 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-06-20 19:25:10 -0500 +message: + merged lp:~adamblackburn/wicd/1.6-return-101-if-no-strength to allow cards that don't report signal strength to work with Wicd's default settings + ------------------------------------------------------------ + revno: 418.1.2 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Sat 2009-06-20 14:40:30 -0500 + message: + update FormatSignalForPrinting to return ??% instead of 101% + ------------------------------------------------------------ + revno: 418.1.1 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Sat 2009-06-20 13:42:21 -0500 + message: + return 101 as the signal strength if altstrenth_pattern fails to find the strength +------------------------------------------------------------ +revno: 421 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-06-20 19:24:07 -0500 +message: + merged lp:~dpaleino/wicd/pre-post-down to allow having pre/post disconnection scripts + ------------------------------------------------------------ + revno: 415.2.1 + committer: David Paleino + branch nick: wicd + timestamp: Tue 2009-06-16 17:13:41 +0200 + message: + Provide a pre-/post-down script mechanism + + WICD currently only provides pre-/post-connection scripts, and + only one disconnection script, that is run before actually + disconnecting. This provides pre-/post-disconnection scripts, + thus increasing configuration flexibility. +------------------------------------------------------------ +revno: 420 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-06-20 19:22:36 -0500 +message: + merged lp:~adamblackburn/wicd/loggroup to allow passing the preferred log group and permissions to setup.py configure -- thanks to David Paleino + ------------------------------------------------------------ + revno: 412.3.6 + committer: Adam Blackburn + branch nick: loggroup + timestamp: Fri 2009-06-19 22:08:32 -0500 + message: + seperated chmod and chown try/excepts + ------------------------------------------------------------ + revno: 412.3.5 + committer: Adam Blackburn + branch nick: loggroup + timestamp: Tue 2009-06-16 23:57:02 +0800 + message: + added forgotten underscores + ------------------------------------------------------------ + revno: 412.3.4 + committer: Adam Blackburn + branch nick: loggroup + timestamp: Tue 2009-06-16 23:22:40 +0800 + message: + removed wicd-daemon.py from .bzrignore + ------------------------------------------------------------ + revno: 412.3.3 + committer: Adam Blackburn + branch nick: loggroup + timestamp: Tue 2009-06-16 23:15:05 +0800 + message: + merge 1.6 r415 + ------------------------------------------------------------ + revno: 412.3.2 + committer: Adam Blackburn + branch nick: loggroup + timestamp: Tue 2009-06-16 23:08:52 +0800 + message: + moved wicd-daemon.py back to wicd/ and changed wpath replacement values to use the wpath module + ------------------------------------------------------------ + revno: 412.3.1 + committer: David Paleino + branch nick: wicd + timestamp: Sat 2009-06-13 22:59:03 +0200 + message: + Support --loggroup and --logperms arguments to setup.py +------------------------------------------------------------ +revno: 419 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-06-20 19:20:42 -0500 +message: + merged lp:~adamblackburn/wicd/1.6-cancel-edit-settings to allow canceling the edit settings dialog that appears when attempting to connect to an encrypted network without entering the encryption details + ------------------------------------------------------------ + revno: 417.1.2 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Sat 2009-06-20 07:58:15 -0500 + message: + fix crash resulting from encryption info missing when connecting + ------------------------------------------------------------ + revno: 417.1.1 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Thu 2009-06-18 15:16:29 +0800 + message: + allow user to cancel preferences dialog if they chose not to connect after clicking connect and showing the preferences dialog +------------------------------------------------------------ +revno: 418 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-06-20 10:33:23 -0500 +message: + merged David Paleino's Debian init script that includes a status command + ------------------------------------------------------------ + revno: 415.1.1 + committer: David Paleino + branch nick: wicd + timestamp: Tue 2009-06-16 17:56:21 +0200 + message: + Add "status" to /etc/init.d/wicd (Debian/Ubuntu) +------------------------------------------------------------ +revno: 417 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Thu 2009-06-18 14:56:25 +0800 +message: + fixed crash that occured when clicking to connect to a secured network but without entering the security information +------------------------------------------------------------ +revno: 416 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Tue 2009-06-16 23:36:58 +0800 +message: + fix a small typo in misc.py -- thanks to David Paleino +------------------------------------------------------------ +revno: 415 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Tue 2009-06-16 07:44:27 +0800 +message: + disable automatically disconnecting when Automatically reconnect is False +------------------------------------------------------------ +revno: 414 +committer: Dan O'Reilly +branch nick: trunk +timestamp: Sun 2009-06-14 14:27:21 -0400 +message: + Merge. + ------------------------------------------------------------ + revno: 412.2.1 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Sun 2009-06-14 12:27:36 +0800 + message: + merged David's Debian patches branch + ------------------------------------------------------------ + revno: 412.1.3 + committer: David Paleino + branch nick: wicd + timestamp: Sat 2009-06-13 22:07:49 +0200 + message: + Support udhcpc, this is needed to smoothly run on the OpenMoko FreeRunner. + + Thanks to Luca Capello for porting the patch to 1.5.9, and + to "madmo" from the linked forum for making the patch. + + Patch originally taken from http://wicd.net/punbb/viewtopic.php?id=132 + + Patch ported to 1.6.0 code by David Paleino . + ------------------------------------------------------------ + revno: 412.1.2 + committer: David Paleino + branch nick: wicd + timestamp: Sat 2009-06-13 22:06:08 +0200 + message: + Update manpage with an appropriate WHATIS entry + ------------------------------------------------------------ + revno: 412.1.1 + committer: David Paleino + branch nick: wicd + timestamp: Sat 2009-06-13 22:05:10 +0200 + message: + Remove deprecated Encoding field +------------------------------------------------------------ +revno: 413 +committer: Dan O'Reilly +branch nick: trunk +timestamp: Sun 2009-06-14 14:25:06 -0400 +message: + Convert strings being prints out by dhclients to utf-8 before trying to log them. + When iwscan displays two entries for a hidden network, only display the one with the essid included. +------------------------------------------------------------ +revno: 412 +committer: Adam Blackburn +branch nick: wicd +timestamp: Tue 2009-06-09 13:25:02 +0800 +message: + display the ESSID/Wired Network in the title of the settings dialog +------------------------------------------------------------ +revno: 411 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Fri 2009-06-05 16:13:38 +0800 +message: + Updated translations.py +------------------------------------------------------------ +revno: 410 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Fri 2009-06-05 15:20:58 +0800 +message: + updated CHANGES +------------------------------------------------------------ revno: 409 committer: Adam Blackburn branch nick: 1.6 diff --git a/setup.py b/setup.py index ca9017c..ee9feb2 100755 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ import subprocess # Be sure to keep this updated! # VERSIONNUMBER -VERSION_NUM = '1.6.0' +VERSION_NUM = '1.6.1' # REVISION_NUM is automatically updated REVISION_NUM = 'unknown' CURSES_REVNO = 'uimod' From 6d1f75f5521161046a99a20898206272a8c47d4f Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sun, 21 Jun 2009 14:45:44 -0400 Subject: [PATCH 29/49] Fix typo that crashes wicd-curses on attempting to bring up the help dialog. --- curses/wicd-curses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 34d52ff..63fb43d 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -202,7 +202,7 @@ def about_dialog(body): # Modeled after htop's help def help_dialog(body): textT = urwid.Text(('header','wicd-curses help'),'right') - textSH = urwid.Text(['This is ',('blue','wicd-curses-'+CURSES_REVNO),' using wicd ',unicode(daemon.Hello()),'\n']) + textSH = urwid.Text(['This is ',('blue','wicd-curses-'+CURSES_REV),' using wicd ',unicode(daemon.Hello()),'\n']) textH = urwid.Text([ "For more detailed help, consult the wicd-curses(8) man page.\n", From 1cd377f15f396835ccd5f7126a9d7988f5c69f7e Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Wed, 24 Jun 2009 18:44:29 -0400 Subject: [PATCH 30/49] Do nothing in wicd-curses if there are no networks present. --- curses/wicd-curses.py | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 63fb43d..9799a7f 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -821,18 +821,16 @@ class appGUI(): self.diag.ready_widgets(ui,self.frame) self.frame.set_body(self.diag) self.diag_type = 'conf' - # Guess what! I actually need to put this here, else I'll have - # tons of references to self.frame lying around. ^_^ - if "enter" in keys: + if "enter" in keys or 'C' in keys: focus = self.frame.body.get_focus() if focus == self.wiredCB: self.special = focus self.connect("wired",0) else: - # wless list only other option - wid,pos = self.thePile.get_focus().get_focus() - self.connect("wireless",pos) - + # wless list only other option, if it is around + if self.wlessLB != self.no_wlan: + wid,pos = self.thePile.get_focus().get_focus() + self.connect("wireless",pos) if "esc" in keys: # Force disconnect here if connection in progress if self.connecting: @@ -853,15 +851,6 @@ class appGUI(): return True if "A" in keys: about_dialog(self.frame) - if "C" in keys: - focus = self.frame.body.get_focus() - if focus == self.wiredCB: - self.special = focus - self.connect("wired",0) - else: - # wless list only other option - wid,pos = self.thePile.get_focus().get_focus() - self.connect("wireless",pos) if "I" in keys: self.raise_hidden_network_dialog() if "H" in keys or 'h' in keys or '?' in keys: From 5f14b7a7fab3ec4ac0d05dfe2791c60acee59539 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Wed, 24 Jun 2009 19:10:30 -0400 Subject: [PATCH 31/49] Do nothing if the user makes a connection attempt while scanning. --- curses/wicd-curses.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 9799a7f..da1b1f4 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -822,15 +822,16 @@ class appGUI(): self.frame.set_body(self.diag) self.diag_type = 'conf' if "enter" in keys or 'C' in keys: - focus = self.frame.body.get_focus() - if focus == self.wiredCB: - self.special = focus - self.connect("wired",0) - else: - # wless list only other option, if it is around - if self.wlessLB != self.no_wlan: - wid,pos = self.thePile.get_focus().get_focus() - self.connect("wireless",pos) + if not self.scanning: + focus = self.frame.body.get_focus() + if focus == self.wiredCB: + self.special = focus + self.connect("wired",0) + else: + # wless list only other option, if it is around + if self.wlessLB != self.no_wlan: + wid,pos = self.thePile.get_focus().get_focus() + self.connect("wireless",pos) if "esc" in keys: # Force disconnect here if connection in progress if self.connecting: From 289f32d38739f226fbbc1949239ae29a57954f03 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Tue, 30 Jun 2009 21:51:33 -0400 Subject: [PATCH 32/49] Fix a small unicode problem in wicd-curses that caused a crash in Debian Lenny. --- curses/wicd-curses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index da1b1f4..4a0c041 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -145,7 +145,7 @@ def check_for_wireless(iwconfig, wireless_ip, set_status): if not network: return False - network = str(network) + network = unicode(network) if daemon.GetSignalDisplayType() == 0: strength = wireless.GetCurrentSignalStrength(iwconfig) else: From 2e650c7a44e2cf74632fc41504c33fcbef0ce5ba Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Tue, 30 Jun 2009 22:43:17 -0400 Subject: [PATCH 33/49] Background wicd's startup in Slackware's initscript. --- in/init=slackware=rc.wicd.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/in/init=slackware=rc.wicd.in b/in/init=slackware=rc.wicd.in index 10b3317..69c3f77 100755 --- a/in/init=slackware=rc.wicd.in +++ b/in/init=slackware=rc.wicd.in @@ -16,8 +16,8 @@ wicd_start() { echo "$PIDFILE and try again..." exit 1 else - echo "Starting wicd daemon: $DAEMON" - wicd 2>/dev/null 1>&2 + echo "Starting wicd daemon: $DAEMON &" + wicd 2>/dev/null 1>&2 & fi } From 27f2890c12e1de289628cca24702c3d4a80efd7f Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Thu, 2 Jul 2009 16:50:48 -0400 Subject: [PATCH 34/49] Fix crash when trying to create an ad-hoc network. --- wicd/networking.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/networking.py b/wicd/networking.py index c9eb8ca..13ec635 100644 --- a/wicd/networking.py +++ b/wicd/networking.py @@ -719,7 +719,7 @@ class Wireless(Controller): wiface = self.wiface print 'Creating ad-hoc network' print 'Stopping dhcp client and wpa_supplicant' - BACKEND.ReleaseDHCP() + wiface.ReleaseDHCP() wiface.StopWPA() print 'Putting wireless interface down' wiface.Down() From 6cedaf01993a4565a30566fba151774ebd7b2e44 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Thu, 2 Jul 2009 18:26:37 -0400 Subject: [PATCH 35/49] Make sure we run to_unicode on all properties we read from disk or get from the user (bug 390680). Don't try to run global scripts of the global script directory doesn't exist (bug 386244). --- wicd/configmanager.py | 2 +- wicd/misc.py | 2 ++ wicd/wicd-daemon.py | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/wicd/configmanager.py b/wicd/configmanager.py index 8862bc8..c61faff 100644 --- a/wicd/configmanager.py +++ b/wicd/configmanager.py @@ -116,7 +116,7 @@ class ConfigManager(RawConfigParser): Int32(ret) except OverflowError: ret = long(ret) - return ret + return to_unicode(ret) def get(self, *args, **kargs): """ Calls the get_option method """ diff --git a/wicd/misc.py b/wicd/misc.py index bc5a2bd..64a877d 100644 --- a/wicd/misc.py +++ b/wicd/misc.py @@ -182,6 +182,8 @@ def WriteLine(my_file, text): def ExecuteScripts(scripts_dir, verbose=False): """ Execute every executable file in a given directory. """ + if not os.path.exists(scripts_dir): + return for obj in os.listdir(scripts_dir): obj = os.path.abspath(os.path.join(scripts_dir, obj)) if os.path.isfile(obj) and os.access(obj, os.X_OK): diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 2274b57..ae38208 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -1055,14 +1055,14 @@ class WirelessDaemon(dbus.service.Object): return value @dbus.service.method('org.wicd.daemon.wireless') - def SetWirelessProperty(self, networkid, property, value): + def SetWirelessProperty(self, netid, prop, value): """ Sets property to value in network specified. """ # We don't write script settings here. - if (property.strip()).endswith("script"): + if (prop.strip()).endswith("script"): print "Setting script properties through the daemon is not" \ + " permitted." return False - self.LastScan[networkid][property] = misc.Noneify(value) + self.LastScan[netid][prop] = misc.to_unicode(misc.Noneify(value)) @dbus.service.method('org.wicd.daemon.wireless') def DetectWirelessInterface(self): @@ -1373,7 +1373,7 @@ class WiredDaemon(dbus.service.Object): print "Setting script properties through the daemon" \ + " is not permitted." return False - self.WiredNetwork[property] = misc.Noneify(value) + self.WiredNetwork[property] = misc.to_unicode(misc.Noneify(value)) return True else: print 'SetWiredProperty: WiredNetwork does not exist' From fe18999be8b59a8faee15fa116b74d55cfbe7d72 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sun, 5 Jul 2009 08:16:59 -1000 Subject: [PATCH 36/49] check to see if the interface exists in the decorator --- wicd/wnettools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wicd/wnettools.py b/wicd/wnettools.py index ac6d1c8..a94617d 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -171,7 +171,8 @@ def neediface(default_response): """ def wrapper(func): def newfunc(self, *args, **kwargs): - if not self.iface: + if not self.iface or \ + not os.path.exists('/sys/class/net/%s' % self.iface): return default_response return func(self, *args, **kwargs) newfunc.__dict__ = func.__dict__ From fef3063521ca46484e2fa9c720d3aa4bc33c915c Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sun, 5 Jul 2009 14:42:39 -0400 Subject: [PATCH 37/49] Actually tell the user that he may need to be in wpath.wicd_group if wicd-clientgets an access-denied error. --- wicd/wicd-client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index 6cc453b..118c068 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -88,7 +88,7 @@ def catchdbus(func): return func(*args, **kwargs) except DBusException, e: if e.get_dbus_name() != None and "DBus.Error.AccessDenied" in e.get_dbus_name(): - error(None, language['access_denied']) + error(None, language['access_denied'].replace("$A",""+wpath.wicd_group+"")) #raise raise DBusException(e) else: From f7e1075ec9f322327d4e586c0b283f4b8f33c149 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sun, 5 Jul 2009 08:51:39 -1000 Subject: [PATCH 38/49] updated translations.py --- wicd/translations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wicd/translations.py b/wicd/translations.py index e5d1092..3c65f65 100644 --- a/wicd/translations.py +++ b/wicd/translations.py @@ -55,7 +55,7 @@ def get_gettext(): _ = lang.gettext return _ -# Generated automatically on Sat, 20 Jun 2009 21:58:21 CDT +# Generated automatically on Sun, 05 Jul 2009 13:51:18 CDT _ = get_gettext() language = {} language['resetting_ip_address'] = _('''Resetting IP address...''') @@ -214,7 +214,7 @@ language['connection_established'] = _('''Connection established''') language['disconnected'] = _('''Disconnected''') language['establishing_connection'] = _('''Establishing connection...''') language['association_failed'] = _('''Connection failed: Could not contact the wireless access point.''') -language['access_denied'] = _('''Unable to contact the Wicd daemon due to an access denied error from DBus. Please check your DBus configuration.''') +language['access_denied'] = _('''Unable to contact the Wicd daemon due to an access denied error from DBus. Please check that your user is in the $A group.''') language['disconnecting_active'] = _('''Disconnecting active connections...''') language['access_denied_wc'] = _('''ERROR: wicd-curses was denied access to the wicd daemon: please check that your user is in the "$A" group.''') language['post_disconnect_script'] = _('''Run post-disconnect script''') From 33bc2dd489f6d3cb17e1709ac77112b3f0a9f7f0 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sun, 5 Jul 2009 08:56:26 -1000 Subject: [PATCH 39/49] updated setup.py version number, CHANGES, and NEWS --- CHANGES | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ NEWS | 78 ++++++++++++++++++++-------------- setup.py | 2 +- 3 files changed, 174 insertions(+), 33 deletions(-) diff --git a/CHANGES b/CHANGES index e187896..c386e9b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,131 @@ ------------------------------------------------------------ +revno: 434 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sun 2009-07-05 08:51:39 -1000 +message: + updated translations.py +------------------------------------------------------------ +revno: 433 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Sun 2009-07-05 14:42:39 -0400 +message: + Actually tell the user that he may need to be in wpath.wicd_group if wicd-clientgets an access-denied error. +------------------------------------------------------------ +revno: 432 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sun 2009-07-05 08:16:59 -1000 +message: + check to see if the interface exists in the decorator +------------------------------------------------------------ +revno: 431 +committer: Dan O'Reilly +branch nick: trunk +timestamp: Thu 2009-07-02 18:26:37 -0400 +message: + Make sure we run to_unicode on all properties we read from disk or get from the user (bug 390680). + Don't try to run global scripts of the global script directory doesn't exist (bug 386244). +------------------------------------------------------------ +revno: 430 +committer: Dan O'Reilly +branch nick: trunk +timestamp: Thu 2009-07-02 16:50:48 -0400 +message: + Fix crash when trying to create an ad-hoc network. +------------------------------------------------------------ +revno: 429 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Tue 2009-06-30 22:58:44 -0400 +message: + Merged r353 of 1.6-nacl. + ------------------------------------------------------------ + revno: 202.2.62 + committer: Andrew Psaltis + branch nick: 1.6-nacl + timestamp: Tue 2009-06-30 22:43:17 -0400 + message: + Background wicd's startup in Slackware's initscript. + ------------------------------------------------------------ + revno: 202.2.61 + committer: Andrew Psaltis + branch nick: 1.6-nacl + timestamp: Tue 2009-06-30 21:51:33 -0400 + message: + Fix a small unicode problem in wicd-curses that caused a crash in Debian Lenny. +------------------------------------------------------------ +revno: 428 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Wed 2009-06-24 19:14:43 -0400 +message: + Merge bugfixes from r351 of 1.6-nacl, thanks to comfrey in #wicd for noticing them. + ------------------------------------------------------------ + revno: 202.2.60 + committer: Andrew Psaltis + branch nick: 1.6-nacl + timestamp: Wed 2009-06-24 19:10:30 -0400 + message: + Do nothing if the user makes a connection attempt while scanning. + ------------------------------------------------------------ + revno: 202.2.59 + committer: Andrew Psaltis + branch nick: 1.6-nacl + timestamp: Wed 2009-06-24 18:44:29 -0400 + message: + Do nothing in wicd-curses if there are no networks present. + ------------------------------------------------------------ + revno: 202.2.58 + committer: Andrew Psaltis + branch nick: 1.6-nacl + timestamp: Wed 2009-06-24 18:43:58 -0400 + message: + Merged r417 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.57 + committer: Andrew Psaltis + branch nick: 1.6-nacl + timestamp: Sun 2009-06-21 14:07:22 -0400 + message: + Merged r426 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.56 + committer: Andrew Psaltis + branch nick: 1.6-nacl + timestamp: Fri 2009-06-19 23:20:29 -0400 + message: + Merge r417 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.55 + committer: Andrew Psaltis + branch nick: 1.6-nacl + timestamp: Wed 2009-06-17 20:52:59 -0400 + message: + Merge r416 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.54 + committer: Andrew Psaltis + branch nick: 1.6-nacl + timestamp: Sun 2009-06-07 14:53:04 -0400 + message: + Merge 411 of mainline 1.6. +------------------------------------------------------------ +revno: 427 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Sun 2009-06-21 14:45:44 -0400 +message: + Fix typo that crashes wicd-curses on attempting to bring up the help dialog. +------------------------------------------------------------ +revno: 426 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-06-20 23:02:23 -0500 +message: + updated setup.py version and CHANGES +------------------------------------------------------------ revno: 425 committer: Andrew Psaltis branch nick: 1.6 diff --git a/NEWS b/NEWS index 701ff67..887143b 100644 --- a/NEWS +++ b/NEWS @@ -1,35 +1,49 @@ -Wicd 1.6.x Branch +Wicd 1.6.0 Branch +1.6.2: + Minor Changes: + - Now deals better if the interface disappears while running + - Will now start if the global script directories don't exist + - Adhoc window will now work correctly + - PSK can be generated from non-ASCII characters + - Fix a minor wicd-curses crash while connecting during a scan -Major Changes: -- Improved tray icon and GUI images (thanks to Martin Sagastume) -- Reorganized network list in the GUI for easier navigation -- New experimental ioctl backend, which is more cpu-friendly than the - previous one -- Added a curses client (thanks to Andrew Psaltis) -- Added a right-click connection menu to the tray icon -- Added options to specify a DNS domain and search domain for static networks -- Reworked the Preferences menu to be more in line with GNOME standards -- Added support for global scripts -- Made it possible to have optional entries in encryption templates -- Added ability to show libnotify notifications on status change +1.6.1: + Minor Changes: + - User is told if the lack permission to access the daemon + - Support for wireless cards that don't report signal strength added + - Enhanced network configuration dialog title -Minor Changes and Other Enhancements: -- Better autoconnection behavior -- Tray/GUI will survive the daemon being killed -- Reasons for connection failures will now bubble back to the GUI -- Add/remove wired profile system is now more user-friendly -- Support for using resolvconf instead of directly editing /etc/resolv.conf -- Wicd won't blindly kill dhcp clients / wpa_supplicant any more -- Added an option to automatically switch from a wireless network to a wired - one as soon as a cable is plugged in -- Moved scanning to its own thread, which makes GUI and daemon more responsive - during scans -- Made it possible to specify macros in script entries -- The GUI will now display the encryption entry dialog if you attempt to - connect to an encrypted network without entering a password -- Static gateway entry is now optional -- Passwords with leading or trailing whitespace are now stored properly -- Many init/config script, man page, and setup.py fixes/updates, including - better autodetection of file placement with regard to sleep hooks and - KDE autostart files (thanks to Robby Workman) +1.6.0: + Major Changes: + - Improved tray icon and GUI images (thanks to Martin Sagastume) + - Reorganized network list in the GUI for easier navigation + - New experimental ioctl backend, which is more cpu-friendly than the + previous one + - Added a curses client (thanks to Andrew Psaltis) + - Added a right-click connection menu to the tray icon + - Added options to specify a DNS domain and search domain for static networks + - Reworked the Preferences menu to be more in line with GNOME standards + - Added support for global scripts + - Made it possible to have optional entries in encryption templates + - Added ability to show libnotify notifications on status change + + Minor Changes and Other Enhancements: + - Better autoconnection behavior + - Tray/GUI will survive the daemon being killed + - Reasons for connection failures will now bubble back to the GUI + - Add/remove wired profile system is now more user-friendly + - Support for using resolvconf instead of directly editing /etc/resolv.conf + - Wicd won't blindly kill dhcp clients / wpa_supplicant any more + - Added an option to automatically switch from a wireless network to a wired + one as soon as a cable is plugged in + - Moved scanning to its own thread, which makes GUI and daemon more responsive + during scans + - Made it possible to specify macros in script entries + - The GUI will now display the encryption entry dialog if you attempt to + connect to an encrypted network without entering a password + - Static gateway entry is now optional + - Passwords with leading or trailing whitespace are now stored properly + - Many init/config script, man page, and setup.py fixes/updates, including + better autodetection of file placement with regard to sleep hooks and + KDE autostart files (thanks to Robby Workman) diff --git a/setup.py b/setup.py index ee9feb2..a45ba71 100755 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ import subprocess # Be sure to keep this updated! # VERSIONNUMBER -VERSION_NUM = '1.6.1' +VERSION_NUM = '1.6.2' # REVISION_NUM is automatically updated REVISION_NUM = 'unknown' CURSES_REVNO = 'uimod' From cbf9ff418cf0af950a4664ae74d8a9120b1e4b2b Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sun, 5 Jul 2009 09:26:24 -1000 Subject: [PATCH 40/49] fix problem running get_translations if translations/ doesn't exist --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a45ba71..ed56e4e 100755 --- a/setup.py +++ b/setup.py @@ -412,7 +412,8 @@ class get_translations(Command): def run(self): import urllib, shutil - shutil.rmtree('translations/') + if os.path.exists('translations'): + shutil.rmtree('translations/') os.makedirs('translations') filename, headers = urllib.urlretrieve('http://wicd.sourceforge.net/translator/idlist/') id_file = open(filename, 'r') From 155bf2edfd94d92b955688bb8aa9c90864f01698 Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Tue, 7 Jul 2009 22:31:08 -0500 Subject: [PATCH 41/49] Remove obsolete entries from dbus config file org.wicd.daemon.config no longer exists; this was apparently a leftover from the 1.4.x or 1.5.x days. --- in/other=wicd.conf.in | 4 ---- 1 file changed, 4 deletions(-) diff --git a/in/other=wicd.conf.in b/in/other=wicd.conf.in index ac2fa88..7c9cd39 100644 --- a/in/other=wicd.conf.in +++ b/in/other=wicd.conf.in @@ -11,8 +11,6 @@ - - @@ -22,8 +20,6 @@ - - From 54fcdee7265fc21e9f8c334ace8762b0d0f344f9 Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Tue, 7 Jul 2009 22:36:05 -0500 Subject: [PATCH 42/49] Reorder the directives in the dbus config file This is aesthetic only; no functional change. --- in/other=wicd.conf.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/in/other=wicd.conf.in b/in/other=wicd.conf.in index 7c9cd39..d3cc2ac 100644 --- a/in/other=wicd.conf.in +++ b/in/other=wicd.conf.in @@ -13,6 +13,10 @@ + + + + @@ -23,10 +27,6 @@ - - - - From 9c64f5ac7f0d79b20296cb1a1f10fb6b4b6fdfcb Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Tue, 7 Jul 2009 22:37:30 -0500 Subject: [PATCH 43/49] Remove default allow at_console permissions for wicd client I suspect that this will be a user-visible change for lots of people; basically, the default before this was to allow any user logged in on the local machine to use wicd-client IF ConsoleKit was installed and in use on the machine. Since we don't support use of PolicyKit for obtaining authorizations, this wasn't really the proper default in my opinion. This will not affect systems that are not using ConsoleKit - they will continue to depend on group membership in whatever is defined for %WICDGROUP% in the dbus configuration file. --- in/other=wicd.conf.in | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/in/other=wicd.conf.in b/in/other=wicd.conf.in index d3cc2ac..79c10c5 100644 --- a/in/other=wicd.conf.in +++ b/in/other=wicd.conf.in @@ -17,16 +17,6 @@ - - - - - - - - - - @@ -34,4 +24,20 @@ + + + From d6b79beb8380c2129815528525f1828f8710bdad Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 7 Jul 2009 18:41:52 -1000 Subject: [PATCH 44/49] Added Robby's comment on at_console --- in/other=wicd.conf.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/in/other=wicd.conf.in b/in/other=wicd.conf.in index d3cc2ac..e7c36d3 100644 --- a/in/other=wicd.conf.in +++ b/in/other=wicd.conf.in @@ -17,6 +17,13 @@ + + From 447e9f454d7b30db7828d3ef665f5d5601131f98 Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Wed, 8 Jul 2009 01:39:53 -0500 Subject: [PATCH 45/49] Clarify at_console and Introspectable bits in dbus config This (again) is largely aesthetic, but it clarifies the %WICDGROUP% setting (previous the comment referred to "above" while it was actually below) by moving that block above the at_console block. Also this adds a comment about the Introspectable method to head off any inquiries as to why we're allowing that in wicd's config. --- in/other=wicd.conf.in | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/in/other=wicd.conf.in b/in/other=wicd.conf.in index e7c36d3..e82bb6f 100644 --- a/in/other=wicd.conf.in +++ b/in/other=wicd.conf.in @@ -17,6 +17,16 @@ + + + + + + + + - - - - - - From 35ec07e0968ab7f9b9dde542874aa40c65e2543b Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 7 Jul 2009 22:01:19 -1000 Subject: [PATCH 46/49] commit Dan's fix for long numeric keys --- wicd/configmanager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wicd/configmanager.py b/wicd/configmanager.py index c61faff..b93b1a6 100644 --- a/wicd/configmanager.py +++ b/wicd/configmanager.py @@ -111,11 +111,11 @@ class ConfigManager(RawConfigParser): except (ValueError, TypeError, AttributeError): ret = Noneify(ret) # This is a workaround for a python-dbus issue on 64-bit systems. - if isinstance(ret, (int)): + if isinstance(ret, (int, long)): try: Int32(ret) except OverflowError: - ret = long(ret) + ret = str(ret) return to_unicode(ret) def get(self, *args, **kargs): From a0ed8c4a44d11fcee546cfed087cbffef6b17222 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Mon, 13 Jul 2009 18:10:28 -0400 Subject: [PATCH 47/49] Fix typo in prefs.py --- wicd/prefs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/prefs.py b/wicd/prefs.py index 6072f8d..4677463 100644 --- a/wicd/prefs.py +++ b/wicd/prefs.py @@ -100,7 +100,7 @@ class PreferencesDialog(object): sudo_list = [self.sudoautoradio, self.gksudoradio, self.kdesuradio, self.ktsussradio] self._setup_external_app_radios(sudo_list, daemon.GetSudoApp, - daemon.SetAudoApp) + daemon.SetSudoApp) auto_conn_meth = daemon.GetWiredAutoConnectMethod() if auto_conn_meth == 1: From e1fb4584f25b16f3bd2ac5998f752353e7e2f565 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Wed, 22 Jul 2009 21:29:34 -0500 Subject: [PATCH 48/49] added support for not displaying the tray icon or the GUI, only the notifications --- wicd/wicd-client.py | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index 118c068..36679b7 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -121,13 +121,15 @@ class TrayIcon(object): Base Class for implementing a tray icon to display network status. """ - def __init__(self, animate): + def __init__(self, animate, displaytray=True): if USE_EGG: self.tr = self.EggTrayIconGUI() else: self.tr = self.StatusTrayIconGUI() self.icon_info = self.TrayConnectionInfo(self.tr, animate) self.tr.icon_info = self.icon_info + print 'displaytray %s' % displaytray + self.tr.visible(displaytray) def is_embedded(self): if USE_EGG: @@ -666,6 +668,18 @@ class TrayIcon(object): """ self.tooltip.set_tip(self.eb, val) + def visible(self, val): + """ Set if the icon is visible or not. + + If val is True, makes the icon visible, if val is False, + hides the tray icon. + + """ + if val: + self.tray.show_all() + else: + self.tray.hide_all() + if hasattr(gtk, "StatusIcon"): class StatusTrayIconGUI(gtk.StatusIcon, TrayIconGUI): @@ -696,6 +710,14 @@ class TrayIcon(object): self.current_icon_path = path gtk.StatusIcon.set_from_file(self, path) + def visible(self, val): + """ Set if the icon is visible or not. + + If val is True, makes the icon visible, if val is False, + hides the tray icon. + + """ + self.set_visible(val) def usage(): """ Print usage information. """ @@ -764,8 +786,9 @@ def main(argv): """ try: - opts, args = getopt.getopt(sys.argv[1:], 'nha', ['help', 'no-tray', - 'no-animate']) + opts, args = getopt.getopt(sys.argv[1:], 'nhao', ['help', 'no-tray', + 'no-animate', + 'only-notifications']) except getopt.GetoptError: # Print help information and exit usage() @@ -773,6 +796,7 @@ def main(argv): use_tray = True animate = True + display_app = True for opt, a in opts: if opt in ('-h', '--help'): usage() @@ -781,6 +805,10 @@ def main(argv): use_tray = False elif opt in ('-a', '--no-animate'): animate = False + elif opt in ('-o', '--only-notifications'): + print "only displaying notifications" + use_tray = False + display_app = False else: usage() sys.exit(2) @@ -789,14 +817,14 @@ def main(argv): setup_dbus() atexit.register(on_exit) - if not use_tray or not ICON_AVAIL: + if display_app and not use_tray or not ICON_AVAIL: the_gui = gui.appGui(standalone=True) mainloop = gobject.MainLoop() mainloop.run() sys.exit(0) # Set up the tray icon GUI and backend - tray_icon = TrayIcon(animate) + tray_icon = TrayIcon(animate, displaytray=display_app) # Check to see if wired profile chooser was called before icon # was launched (typically happens on startup or daemon restart). From 09c8992dc98d54d774c43db69b397d5fbdea0faa Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Wed, 22 Jul 2009 21:47:47 -0500 Subject: [PATCH 49/49] added the -o option to the help text --- wicd/wicd-client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index 36679b7..93e52dd 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -729,6 +729,7 @@ Arguments: \t-n\t--no-tray\tRun wicd without the tray icon. \t-h\t--help\t\tPrint this help information. \t-a\t--no-animate\tRun the tray without network traffic tray animations. +\t-o\t--only-notifications\tDon't display anything except notifications. """ % wpath.version def setup_dbus(force=True):