Exemple #1
0
 def load_config_file(self):
     ''' Loads configuration settings from the specified XML config
         file.
     '''
     defaults = {}
     if os.path.exists(self.arguments.config_file):
         tree = ElementTree.ElementTree()
         tree.parse(self.arguments.config_file)
         for key in list(vars(self.arguments).keys()):
             value = xml_utils.get_text(tree, key)
             if value != None:
                 defaults[key] = value
     else:
         LOG.warning(self.arguments.config_file + " not found")
     return defaults
Exemple #2
0
 def load_config_file(self):
     ''' Loads configuration settings from the specified XML config
         file.
     '''
     defaults = {}
     if os.path.exists(self.arguments.config_file):
         tree = ElementTree.ElementTree()
         tree.parse(self.arguments.config_file)
         for key in list(vars(self.arguments).keys()):
             # LOG.debug('key: ' + key)
             if key in list(Config.arglist_subtypes.keys()):
                 defaults[key] = xml_utils.get_text_list \
                     (tree, key, Config.arglist_subtypes[key])
             else:
                 value = xml_utils.get_text(tree, key)
                 if value != None:
                     defaults[key] = value
     else:
         LOG.warning(self.arguments.config_file + " not found")
     # LOG.debug('defaults: ' + str(defaults))
     return defaults