Beispiel #1
0
 def get_raw(self, key):
     '''Returns the value of the given key.
        If the key is not found a CfgEx is raised.'''
     key = InternalCfg.convert_key(key)
     rval = InternalCfg.get_value(key, self.config)
     # This is the tricky part: With this construct each
     # sub-configuration is again a configuration.
     if type(rval) == DictType:
         return Cfg(rval)
     return rval
Beispiel #2
0
 def append_list(self, key, value):
     '''Appends value to existing list under key.
        If key does not exists, a new list is created.'''
     key = InternalCfg.convert_key(key)
     InternalCfg.append_list(self.config, key, value)
Beispiel #3
0
 def set_value(self, key, value):
     '''Sets the value. If the key is already there a CfgEx is
        raised.'''
     key = InternalCfg.convert_key(key)
     InternalCfg.set_value(self.config, key, value)