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
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)
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)