Revert e52018bfcd
. Simply fail. It's documented on the ChangeLog.
This commit is contained in:
parent
860457ff48
commit
90d23ce582
|
@ -53,19 +53,7 @@ class EventManager(component.Component):
|
|||
if event.name in self.handlers:
|
||||
for handler in self.handlers[event.name]:
|
||||
#log.debug("Running handler %s for event %s with args: %s", event.name, handler, event.args)
|
||||
try:
|
||||
handler(*event.args)
|
||||
except TypeError:
|
||||
if event.name != "TorrentAddedEvent":
|
||||
raise
|
||||
else:
|
||||
log.warning("TorrentAddedEvent recently got an extra "
|
||||
"argument, \"from_state\" and the handler "
|
||||
"\"%s\" is not accepting that extra "
|
||||
"argument. Correcting for now but this code "
|
||||
"should be changed.", handler)
|
||||
handler(event.args[0])
|
||||
|
||||
handler(*event.args)
|
||||
|
||||
def register_event_handler(self, event, handler):
|
||||
"""
|
||||
|
|
|
@ -167,22 +167,9 @@ class DelugeRPCProtocol(Protocol):
|
|||
#log.debug("Received RPCEvent: %s", event)
|
||||
# A RPCEvent was received from the daemon so run any handlers
|
||||
# associated with it.
|
||||
def call_handler(event, handler, args):
|
||||
try:
|
||||
handler(*args)
|
||||
except TypeError:
|
||||
if event != "TorrentAddedEvent":
|
||||
raise
|
||||
else:
|
||||
log.warning("TorrentAddedEvent recently got an extra "
|
||||
"argument, \"from_state\" and the handler "
|
||||
"\"%s\" is not accepting that extra "
|
||||
"argument. Correcting for now but this code "
|
||||
"should be changed.", handler)
|
||||
handler(args[0])
|
||||
if event in self.factory.event_handlers:
|
||||
for handler in self.factory.event_handlers[event]:
|
||||
reactor.callLater(0, call_handler, event, handler, request[2])
|
||||
reactor.callLater(0, handler, *request[2])
|
||||
continue
|
||||
|
||||
request_id = request[1]
|
||||
|
|
Loading…
Reference in New Issue