1 diff -ur wicd-1.7.0/wicd/configmanager.py wicd-1.7.0.new/wicd/configmanager.py
2 --- wicd-1.7.0/wicd/configmanager.py 2010-01-15 05:49:11.000000000 +0100
3 +++ wicd-1.7.0.new/wicd/configmanager.py 2010-10-08 13:14:22.084345024 +0200
5 class ConfigManager(RawConfigParser):
6 """ A class that can be used to manage a given configuration file. """
7 def __init__(self, path, debug=False, mark_whitespace="`'`"):
8 - RawConfigParser.__init__(self)
9 + RawConfigParser.__init__(self, allow_no_value=True)
10 self.config_file = path
12 self.mrk_ws = mark_whitespace
16 def _copy_section(self, name):
17 - # Yes, deepcopy sucks, but it is robust to changes in both
18 - # this class and RawConfigParser.
19 - p = copy.deepcopy(self)
20 - for sname in p.sections():
22 - p.remove_section(sname)
23 + p = ConfigManager("", self.debug, self.mrk_ws)
25 + for (iname, value) in self.items(name):
26 + p.set(name, iname, value)
27 + # Store the filename this section was read from.
28 p.config_file = p.get_option(name, '_filename_', p.config_file)
29 p.remove_option(name, '_filename_')
33 """ Writes the loaded config file to disk. """
34 - # Really don't like this deepcopy.
35 - p = copy.deepcopy(self)
36 - for sname in p.sections():
37 - fname = p.get_option(sname, '_filename_')
39 + for sname in self.sections():
40 + fname = self.get_option(sname, '_filename_')
41 if fname and fname != self.config_file:
42 + # Write sections from other files
43 section = self._copy_section(sname)
44 - p.remove_section(sname)
47 + # Save names of local sections
48 + in_this_file.append(sname)
50 - for sname in p.sections():
51 + # Make an instance with only these sections
52 + p = ConfigManager("", self.debug, self.mrk_ws)
53 + p.config_file = self.config_file
54 + for sname in in_this_file:
55 + p.add_section(sname)
56 + for (iname, value) in self.items(sname):
57 + p.set(sname, iname, value)
58 p.remove_option(sname, '_filename_')
61 diff -ur wicd-1.7.0/wicd/wicd-daemon.py wicd-1.7.0.new/wicd/wicd-daemon.py
62 --- wicd-1.7.0/wicd/wicd-daemon.py 2010-01-15 05:49:11.000000000 +0100
63 +++ wicd-1.7.0.new/wicd/wicd-daemon.py 2010-10-08 13:11:15.811786603 +0200
65 wicd_bus = dbus.service.BusName('org.wicd.daemon', bus=bus)
66 daemon = WicdDaemon(wicd_bus, auto_connect=auto_connect)
68 - child_pid = Popen([misc.find_path("python"), "-O",
69 + child_pid = Popen([misc.find_path("python2"), "-O",
70 os.path.join(wpath.daemon, "monitor.py")],
71 shell=False, close_fds=True).pid
72 atexit.register(on_exit, child_pid)