Author: andar
Revision: 4931
Log:
Add PreTorrentRemovedEvent event
Diff:
Modified: trunk/deluge/core/torrentmanager.py
===================================================================
--- trunk/deluge/core/torrentmanager.py 2009-03-25 18:01:16 UTC (rev 4930)
+++ trunk/deluge/core/torrentmanager.py 2009-03-26 21:23:56 UTC (rev 4931)
@@ -430,6 +430,9 @@
def remove(self, torrent_id, remove_data=False):
"""Remove a torrent from the manager"""
+ # Emit the signal to the clients
+ component.get("EventManager").emit(PreTorrentRemovedEvent(torrent_id))
+
try:
self.session.remove_torrent(self.torrents[torrent_id].handle,
1 if remove_data else 0)
Modified: trunk/deluge/event.py
===================================================================
--- trunk/deluge/event.py 2009-03-25 18:01:16 UTC (rev 4930)
+++ trunk/deluge/event.py 2009-03-26 21:23:56 UTC (rev 4931)
@@ -69,6 +69,16 @@
"""
self._args = [torrent_id]
+class PreTorrentRemovedEvent(DelugeEvent):
+ """
+ Emitted when a torrent is about to be removed from the session.
+ """
+ def __init__(self, torrent_id):
+ """
+ :param torrent_id: str, the torrent_id
+ """
+ self._args = [torrent_id]
+
class TorrentStateChangedEvent(DelugeEvent):
"""
Emitted when a torrent changes state.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---