diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2006-10-09 21:48:04 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2006-10-09 21:48:04 +0000 |
| commit | 0c40ad392824c8a5ee1e0efe7556e12f54d3ceed (patch) | |
| tree | 9f874d48967c4b153794bb3ad291e3dd45c21283 /lib/python/Components | |
| parent | c7d2c96f39fbb38e026ac336c2e338090ce7eb30 (diff) | |
| download | enigma2-0c40ad392824c8a5ee1e0efe7556e12f54d3ceed.tar.gz enigma2-0c40ad392824c8a5ee1e0efe7556e12f54d3ceed.zip | |
add optional addNotifier(initial_call=False)-support
Diffstat (limited to 'lib/python/Components')
| -rw-r--r-- | lib/python/Components/config.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index cf94614c..b16b93e3 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -71,19 +71,20 @@ class ConfigElement(object): for x in self.notifiers: x(self) - def addNotifier(self, notifier): + def addNotifier(self, notifier, initial_call = True): assert callable(notifier), "notifiers must be callable" self.notifiers.append(notifier) - + # CHECKME: # do we want to call the notifier - # - at all when adding it? (yes) + # - at all when adding it? (yes, though optional) # - when the default is active? (yes) # - when no value *yet* has been set, # because no config has ever been read (currently yes) # (though that's not so easy to detect. # the entry could just be new.) - notifier(self) + if initial_call: + notifier(self) def disableSave(self): self.save_disabled = True |
