1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-20 12:58:07 +01:00

Fixed bad except statement in misc.py.

Cleaned up formatting in gui.py.
Made glade template for preferences dialog and rewrote gui.py to use it instead of creating it explictly in the code.
Fixed a bunch indentation/whitespace problems.
Cleaned up a ton of formatting in daemon.py
Fixed a wired autoconnect bug.
Rewrote part of the connection monitoring code, further minimizing the number of external program calls, as well as number of dbus calls.
Added StatusInformation methods to daemon.py, to allow external apps to poll for the current connection status without making several dbus calls.
Fixed bad function call to GetDBMSignalStrength in daemon.py.
This commit is contained in:
imdano
2008-01-29 21:03:19 +00:00
parent 4b4bc55614
commit d46da02511
8 changed files with 866 additions and 406 deletions

View File

@@ -106,32 +106,32 @@ def get_script_info(network, network_type):
def write_scripts(network, network_type, script_info):
""" Writes script info to disk and loads it into the daemon. """
con = ConfigParser.ConfigParser()
print "writing scripts, type",network_type
print "writing scripts, type", network_type
if network_type == "wired":
con.read(wired_conf)
if con.has_section(network):
con.add_section(network)
con.set(network, "beforescript", script_info["pre_entry"])
con.set(network, "afterscript", script_info["post_entry"])
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.write(open(wired_conf, "w"))
config.ReadWiredNetworkProfile(network)
config.SaveWiredNetworkProfile(network)
con.write(open(wired_conf, "w"))
config.ReadWiredNetworkProfile(network)
config.SaveWiredNetworkProfile(network)
else:
bssid = wireless.GetWirelessProperty(int(network), "bssid")
con.read(wireless_conf)
if con.has_section(bssid):
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.write(open(wireless_conf, "w"))
config.ReadWirelessNetworkProfile(int(network))
config.SaveWirelessNetworkProfile(int(network))
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.write(open(wireless_conf, "w"))
config.ReadWirelessNetworkProfile(int(network))
config.SaveWirelessNetworkProfile(int(network))
def main (argv):
"""Runs the script configuration dialog."""
""" Runs the script configuration dialog. """
if len(argv) < 2:
print 'Network id to configure is missing, aborting.'
sys.exit(1)