Add ability to run individual set functions

This commit is contained in:
Andrew Resch 2009-06-02 00:56:05 +00:00
parent 502fa6983e
commit 1091054b38

View File

@ -271,6 +271,17 @@ class Config(object):
for key, value in self.__set_functions.iteritems():
value(key, self.__config[key])
def apply_set_functions(self, key):
"""
Calls set functions for `:param:key`.
:param key: str, the config key
"""
log.debug("Calling set functions for key %s..", key)
if key in self.__set_functions:
self.__set_functions[key](key, self.__config[key])
def load(self, filename=None):
"""
Load a config file