Coverage for ion/util/config : 75.93%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
|
#!/usr/bin/env python
@file ion/util/config.py @author Michael Meisinger @brief supports work with config files """
""" Helper class managing config files """
""" @brief Creates a new Config for retrieving configuration @param cfgFile filename or key within Config @param config if present, a Config instance for which the value given by cfgFile will be extracted """
# Save config to look up later else: # Load config from filename
result = '' result += 'Config File Name: %s \n' % self.filename result += 'Config Content: \n %s' % str(self.obj) return result
# lookup in live configuration
return None
value = self.getValue2(key1, key2, {}) return self._getValue(value, key3, default)
# Load config override from filename filecontent = open(filename,).read() updates = eval(filecontent) self.update(updates)
""" Recursively updates configuration dict with values in given dict. """
""" Recursively updates a dict with values in another dict. """ if not ukey in src: src[ukey] = {} self._update_dict(src[ukey], uval) else: |