From 9db2824bfef2272ef1b95d70c1476ecfde3632fd Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Fri, 15 Feb 2008 23:14:15 +0000 Subject: [PATCH] Expose set_torrent_max_connections(), set_torrent_max_upload_slots(), set_torrent_max_upload_speed(), set_torrent_max_download_speed(), set_torrent_private_flag(), set_torrent_file_priorities(). --- deluge/core/core.py | 24 ++++++++++++++++++++++++ deluge/ui/client.py | 23 +++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/deluge/core/core.py b/deluge/core/core.py index 5107e94ad..97a247275 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -474,7 +474,31 @@ class Core( def export_set_torrent_trackers(self, torrent_id, trackers): """Sets a torrents tracker list. trackers will be [{"url", "tier"}]""" return self.torrents[torrent_id].set_trackers(trackers) + + def export_set_torrent_max_connections(self, torrent_id, value): + """Sets a torrents max number of connections""" + return self.torrents[torrent_id].set_max_connections(value) + + def export_set_torrent_max_upload_slots(self, torrent_id, value): + """Sets a torrents max number of upload slots""" + return self.torrents[torrent_id].set_max_upload_slots(value) + def export_set_torrent_max_upload_speed(self, torrent_id, value): + """Sets a torrents max upload speed""" + return self.torrents[torrent_id].set_max_upload_speed(value) + + def export_set_torrent_max_download_speed(self, torrent_id, value): + """Sets a torrents max download speed""" + return self.torrents[torrent_id].set_max_download_speed(value) + + def export_set_torrent_private_flag(self, torrent_id, value): + """Sets a torrents private flag""" + return self.torrents[torrent_id].set_private_flag(value) + + def export_set_torrent_file_priorities(self, torrent_id, priorities): + """Sets a torrents file priorities""" + return self.torrents[torrent_id].set_file_priorities(priorities) + # Signals def torrent_added(self, torrent_id): """Emitted when a new torrent is added to the core""" diff --git a/deluge/ui/client.py b/deluge/ui/client.py index 341b8f508..247c525a5 100644 --- a/deluge/ui/client.py +++ b/deluge/ui/client.py @@ -344,3 +344,26 @@ def set_torrent_trackers(torrent_id, trackers): """Sets the torrents trackers""" get_core().call("set_torrent_trackers", None, torrent_id, trackers) +def set_torrent_max_connections(torrent_id, value): + """Sets a torrents max number of connections""" + get_core().call("set_torrent_max_connections", None, torrent_id, value) + +def set_torrent_max_upload_slots(torrent_id, value): + """Sets a torrents max number of upload slots""" + get_core().call("set_torrent_max_upload_slots", None, torrent_id, value) + +def set_torrent_max_upload_speed(torrent_id, value): + """Sets a torrents max upload speed""" + get_core().call("set_torrent_max_upload_speed", None, torrent_id, value) + +def set_torrent_max_download_speed(torrent_id, value): + """Sets a torrents max download speed""" + get_core().call("set_torrent_max_download_speed", None, torrent_id, value) + +def set_torrent_private_flag(torrent_id, value): + """Sets a torrents private flag""" + get_core().call("set_torrent_private_flag", None, torrent_id, value) + +def set_torrent_file_priorities(torrent_id, priorities): + """Sets a torrents file priorities""" + get_core().call("set_torrent_file_priorities", None, torrent_id, priorities)