diff options
author | John Garland <johnnybg+deluge@gmail.com> | 2010-06-08 00:17:22 +1000 |
---|---|---|
committer | John Garland <johnnybg+deluge@gmail.com> | 2010-06-08 00:20:07 +1000 |
commit | 4d2b7df49dde4327415ca6e8560bd558b9e77763 (patch) | |
tree | 5b304250211114c79094ed51f58d6954e614cb36 | |
parent | bd775d0d401686e260dccce94ca61f4edcf3a452 (diff) | |
download | deluge-4d2b7df49dde4327415ca6e8560bd558b9e77763.tar.gz deluge-4d2b7df49dde4327415ca6e8560bd558b9e77763.tar.bz2 deluge-4d2b7df49dde4327415ca6e8560bd558b9e77763.zip |
Fix execute plugin only executing last event (#1306)
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | deluge/plugins/execute/execute/core.py | 9 |
2 files changed, 9 insertions, 3 deletions
@@ -2,6 +2,9 @@ ==== ConsoleUI ==== * #1307: Fix not being able to add torrents +==== Execute ==== + * #1306: Fix always executing last event + === Deluge 1.3.0-rc1 (08 May 2010) === ==== Core ==== * Implement #1063 option to delete torrent file copy on torrent removal - patch from Ghent diff --git a/deluge/plugins/execute/execute/core.py b/deluge/plugins/execute/execute/core.py index 57fd13f46..4c5e66005 100644 --- a/deluge/plugins/execute/execute/core.py +++ b/deluge/plugins/execute/execute/core.py @@ -84,8 +84,11 @@ class Core(CorePluginBase): if event in self.registered_events: continue - def event_handler(torrent_id): - self.execute_commands(torrent_id, command[EXECUTE_EVENT]) + def create_event_handler(event): + def event_handler(torrent_id): + self.execute_commands(torrent_id, event) + return event_handler + event_handler = create_event_handler(event) event_manager.register_event_handler(EVENT_MAP[event], event_handler) self.registered_events[event] = event_handler @@ -102,7 +105,7 @@ class Core(CorePluginBase): else: save_path = info["save_path"] - log.debug("[execute] Running commands for %s", EXECUTE_EVENT) + log.debug("[execute] Running commands for %s", event) # Go through and execute all the commands for command in self.config["commands"]: |