diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-07-14 20:59:01 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-07-14 20:59:01 +0200 |
commit | 853d29a0f12cdcb6c406b829a57439c7ea9b570d (patch) | |
tree | 047d94a11037617521c7a50130a6ead538c5daf7 /module/HookManager.py | |
parent | fixed config on webif + show description (diff) | |
download | pyload-853d29a0f12cdcb6c406b829a57439c7ea9b570d.tar.xz |
has_key refractored, package name generator by Geek
Diffstat (limited to 'module/HookManager.py')
-rw-r--r-- | module/HookManager.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/module/HookManager.py b/module/HookManager.py index 94faaba6e..47e7d88fb 100644 --- a/module/HookManager.py +++ b/module/HookManager.py @@ -87,7 +87,7 @@ class HookManager: plugin = plugin.rpartition(".")[2] doc = doc.strip() if doc else "" - if self.methods.has_key(plugin): + if plugin in self.methods: self.methods[plugin][func] = doc else: self.methods[plugin] = {func: doc} @@ -234,23 +234,23 @@ class HookManager: def addEvent(self, event, func): """Adds an event listener for event name""" - if self.events.has_key(event): + if event in self.events: self.events[event].append(func) else: self.events[event] = [func] def removeEvent(self, event, func): """removes previously added event listener""" - if self.events.has_key(event): + if event in self.events: self.events[event].remove(func) def dispatchEvent(self, event, *args): """dispatches event with args""" - if self.events.has_key(event): + if event in self.events: for f in self.events[event]: try: f(*args) except Exception, e: self.log.debug("Error calling event handler %s: %s, %s, %s" % (event, f, args, str(e))) -
\ No newline at end of file + |