# HG changeset patch # User Matti Hamalainen # Date 1476790799 -10800 # Node ID f671602635b7dd9316634830370239c7fefd4a2c # Parent 03e0063cb15cb77eea65f91812e6ed6527335978 Rename some objects and variables. diff -r 03e0063cb15c -r f671602635b7 multimerge.py --- a/multimerge.py Tue Oct 18 14:03:18 2016 +0300 +++ b/multimerge.py Tue Oct 18 14:39:59 2016 +0300 @@ -301,10 +301,10 @@ else: return None - def mread(self, cfgparser, sect): + def mread(self, cfg_parser, sect): for name in self.m_settable: - if cfgparser.has_option(sect, name): - value = cfgparser.get(sect, name) + if cfg_parser.has_option(sect, name): + value = cfg_parser.get(sect, name) self.mset(name, value) gcm_debug(4, u"{0} -> '{1}' == {2}".format(name, value, self.mget(name))) @@ -399,6 +399,7 @@ ## Settings +cfg_section = "gcm" cfg = GCMSettings() cfg.mdef("debug", True, cfg.is_bool, cfg.trans_bool, False) @@ -445,23 +446,22 @@ ## Read, parse and validate configuration file gcm_debug(3, u"Reading configuration from '{0}'.".format(sys.argv[1])) try: - cfgparser = ConfigParser.RawConfigParser() - cfgparser.readfp(codecs.open(sys.argv[1], "r", "UTF-8")) + cfg_parser = ConfigParser.RawConfigParser() + cfg_parser.readfp(codecs.open(sys.argv[1], "r", "UTF-8")) except Exception as e: gcm_fatal(u"Failed to read configuration file '{0}': {1}".format(sys.argv[1], str(e))) # Check that the required section exists -section = "gcm" -if not cfgparser.has_section(section): - gcm_fatal(u"Invalid configuration, missing '{0}' section.".format(section)) +if not cfg_parser.has_section(cfg_section): + gcm_fatal(u"Invalid configuration, missing '{0}' section.".format(cfg_section)) # Debug setting is a special case, we need to get it # set before everything else, so do it here .. -if cfgparser.has_option(section, "debug"): - cfg.mset("debug", cfgparser.get(section, "debug")) +if cfg_parser.has_option(cfg_section, "debug"): + cfg.mset("debug", cfg_parser.get(cfg_section, "debug")) # Parse the settings and validate -cfg.mread(cfgparser, section) +cfg.mread(cfg_parser, cfg_section) ## Validate settings