From 1091054b3860fe12a4dd004745aa9032fb515dce Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Tue, 2 Jun 2009 00:56:05 +0000 Subject: [PATCH] Add ability to run individual set functions --- deluge/config.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/deluge/config.py b/deluge/config.py index eb4631028..fd93983ad 100644 --- a/deluge/config.py +++ b/deluge/config.py @@ -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