for item in self.config.items(section):
name = "%s_%s" % (section, item[0])
value = item[1]
+ if
setattr(self, name, value)
setattr(self, name.upper(), value)
c = ConfigParser.ConfigParser()
c.read(config_file)
return True
- except:
+ except ConfigParser.MissingSectionHeaderError:
return False
# bash does not have the concept of NULL
if value:
option = "%s_%s" % (section.upper(), name.upper())
- if not value.isdigit() and not bool(value):
- value = "'%s'" % value
+ if not isinstance(value, bool) and not value.isdigit():
+ value = '"%s"' % value
buf.write(option + "=" + value + os.linesep)
return buf.getvalue()