summaryrefslogtreecommitdiffstats
path: root/pyload/interaction/EventManager.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-07-12 13:12:59 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-07-12 13:12:59 +0200
commit3512605b8c0370905ae9e7a2adc79ddded2d8d20 (patch)
treeb7a9b68ebd599ecbe96dee0ca650d120093f632b /pyload/interaction/EventManager.py
parentMerge remote-tracking branch 'origin/stable' (diff)
downloadpyload-3512605b8c0370905ae9e7a2adc79ddded2d8d20.tar.xz
fixed addon related bugs
Diffstat (limited to 'pyload/interaction/EventManager.py')
-rw-r--r--pyload/interaction/EventManager.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/pyload/interaction/EventManager.py b/pyload/interaction/EventManager.py
index 7d37ca6b9..329961d93 100644
--- a/pyload/interaction/EventManager.py
+++ b/pyload/interaction/EventManager.py
@@ -3,6 +3,7 @@
from threading import Lock
from traceback import print_exc
+
class EventManager:
"""
Handles all event-related tasks, also stores an event queue for clients, so they can retrieve them later.
@@ -29,19 +30,11 @@ class EventManager:
self.core = core
self.log = core.log
- # uuid : list of events
- self.clients = {}
self.events = {"event": []}
self.lock = Lock()
- def getEvents(self, uuid):
- """ Get accumulated events for uuid since last call, this also registers a new client """
- if uuid not in self.clients:
- self.clients[uuid] = Client()
- return self.clients[uuid].get()
-
- def addEvent(self, event, func):
+ def listenTo(self, event, func):
"""Adds an event listener for event name"""
if event in self.events:
if func in self.events[event]:
@@ -69,7 +62,7 @@ class EventManager:
f(event, *args)
except Exception, e:
self.log.warning("Error calling event handler %s: %s, %s, %s"
- % ("event", f, args, str(e)))
+ % ("event", f, args, str(e)))
if self.core.debug:
print_exc()
@@ -79,6 +72,6 @@ class EventManager:
f(*args)
except Exception, e:
self.log.warning("Error calling event handler %s: %s, %s, %s"
- % (event, f, args, str(e)))
+ % (event, f, args, str(e)))
if self.core.debug:
print_exc() \ No newline at end of file