1
0
mirror of https://github.com/gryf/wicd.git synced 2026-01-05 21:34:16 +01:00

Still trying to get rid of this empty wired-settings.conf section bug.

This commit is contained in:
Dan O'Reilly
2009-09-19 17:24:40 -04:00
parent fe6d854cdf
commit 265dd40113
2 changed files with 5 additions and 0 deletions

View File

@@ -124,6 +124,9 @@ class ConfigManager(RawConfigParser):
def write(self):
""" Writes the loaded config file to disk. """
for section in self.sections():
if not section:
self.remove_section(section)
configfile = open(self.config_file, 'w')
RawConfigParser.write(self, configfile)
configfile.close()

View File

@@ -1446,6 +1446,8 @@ class WiredDaemon(dbus.service.Object):
@dbus.service.method('org.wicd.daemon.wired')
def CreateWiredNetworkProfile(self, profilename, default=False):
""" Creates a wired network profile. """
if not profilename:
return False
profilename = misc.to_unicode(profilename)
print "Creating wired profile for " + profilename
if self.config.has_section(profilename):