diff options
Diffstat (limited to 'bin/tools/config.py')
| -rw-r--r-- | bin/tools/config.py | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/bin/tools/config.py b/bin/tools/config.py index 770fdea7de1..2dd6b1131bf 100644 --- a/bin/tools/config.py +++ b/bin/tools/config.py @@ -66,7 +66,7 @@ class configmanager(object): 'import_partial': "", 'pidfile': None, 'logfile': None, - 'logrotate': '1', + 'logrotate': '1', 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, @@ -82,8 +82,8 @@ class configmanager(object): 'login_message': False, 'list_db' : True, } - - self.misc = {} + + self.misc = {} hasSSL = check_ssl() @@ -135,7 +135,7 @@ class configmanager(object): group = optparse.OptionGroup(parser, "Logging Configuration") group.add_option("--logfile", dest="logfile", help="file where the server log will be stored") group.add_option("--no-logrotate", dest="logrotate", action="store_false", - default=None, help="do not rotate the logfile") + default=None, help="do not rotate the logfile") group.add_option("--syslog", action="store_true", dest="syslog", default=False, help="Send the log to the syslog server") group.add_option('--log-level', dest='log_level', type='choice', choices=self._LOGLEVELS.keys(), @@ -226,7 +226,7 @@ class configmanager(object): 'db_port', 'list_db', 'logfile', 'pidfile', 'smtp_port', 'cache_timeout', 'email_from', 'smtp_server', 'smtp_user', 'smtp_password', 'price_accuracy', 'netinterface', 'netport', 'db_maxconn', 'import_partial', 'addons_path', - 'netrpc', 'xmlrpc', 'syslog', 'without_demo'] + 'netrpc', 'xmlrpc', 'syslog', 'without_demo'] if hasSSL: keys.extend(['smtp_ssl', 'secure_cert_file', 'secure_pkey_file']) @@ -341,18 +341,18 @@ class configmanager(object): if value=='False' or value=='false': value = False self.options[name] = value - #parse the other sections, as well - for sec in p.sections(): - if sec == 'options': - continue - if not self.misc.has_key(sec): - self.misc[sec]= {} - for (name, value) in p.items(sec): - if value=='True' or value=='true': - value = True - if value=='False' or value=='false': - value = False - self.misc[sec][name] = value + #parse the other sections, as well + for sec in p.sections(): + if sec == 'options': + continue + if not self.misc.has_key(sec): + self.misc[sec]= {} + for (name, value) in p.items(sec): + if value=='True' or value=='true': + value = True + if value=='False' or value=='false': + value = False + self.misc[sec][name] = value except IOError: pass except ConfigParser.NoSectionError: @@ -369,10 +369,10 @@ class configmanager(object): p.set('options', opt, loglevelnames.get(self.options[opt], self.options[opt])) else: p.set('options', opt, self.options[opt]) - - for sec in self.misc.keys(): - for opt in self.misc[sec].keys(): - p.set(sec,opt,self.misc[sec][opt]) + + for sec in self.misc.keys(): + for opt in self.misc[sec].keys(): + p.set(sec,opt,self.misc[sec][opt]) # try to create the directories and write the file try: |
