changeset 119:f671602635b7

Rename some objects and variables.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 18 Oct 2016 14:39:59 +0300
parents 03e0063cb15c
children 1f7967aa0133
files multimerge.py
diffstat 1 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- 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