How to get from_state?
Posted: Sun Sep 04, 2016 1:08 pm
I'm trying to check from_state when a torrent is added using the same method as the label plugin. That is, creating a listener:
And then a function with from_state as a param:
However, I'm constantly getting the following error message:
I also tried another method of getting the from_state variable, using the same method as the execute plugin, but I get the same behavior; the from_state variable is never passed.
Is there any foolproof way to get from_state?
Code: Select all
component.get("EventManager").register_event_handler("TorrentAddedEvent", self.post_torrent_add)
Code: Select all
def post_torrent_add(self, torrent_id, from_state):
I've actually downloaded the latest label plugin off git, built an .egg [without touching the contents of the files] and replaced the label .egg in the plugins folder, and that breaks it too.eventmanager:59 Event handler TorrentAddedEvent failed in <bound method Core.post_torrent_add of <deluge.plugins.label.core.Core object at 0x04B7D5F0>> with exception post_torrent_add() takes exactly 3 arguments (2 given)
I also tried another method of getting the from_state variable, using the same method as the execute plugin, but I get the same behavior; the from_state variable is never passed.
Is there any foolproof way to get from_state?