From 7e9b6e816fedf1b8f8df0c3d7e4ad0f35a2781a9 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 5 Dec 2006 14:46:04 +0000 Subject: [PATCH] --- library/pytorrent.py | 8 +++++--- library/test.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/library/pytorrent.py b/library/pytorrent.py index e8f616924..62fbf66c5 100644 --- a/library/pytorrent.py +++ b/library/pytorrent.py @@ -184,11 +184,13 @@ class manager: self.prefs[key] = value + self.apply_prefs() + def apply_prefs(self): print "Applying preferences" - pytorrent_core.set_download_rate_limit(self.get_pref('max_download_rate')*1024) + pytorrent_core.set_download_rate_limit(self.get_pref('max_download_rate')) - pytorrent_core.set_upload_rate_limit(self.get_pref('max_upload_rate')*1024) + pytorrent_core.set_upload_rate_limit(self.get_pref('max_upload_rate')) pytorrent_core.set_listen_on(self.get_pref('listen_on')[0], self.get_pref('listen_on')[1]) @@ -342,7 +344,7 @@ class manager: event = pytorrent_core.pop_event() while event is not None: - print "EVENT: ", event +# print "EVENT: ", event if event['event_type'] is self.constants['EVENT_FINISHED']: # If we are autoseeding, then we need to apply the queue diff --git a/library/test.py b/library/test.py index 3dfb89f20..8a25940d5 100644 --- a/library/test.py +++ b/library/test.py @@ -16,7 +16,7 @@ import os manager = pytorrent.manager("PT", "0500", "pytorrent - testing only", os.path.expanduser("~") + "/Temp") -#manager.prefs['max_active_torrents'] = 1 +manager.set_pref('max_upload_rate', 6*1024) #my_torrent = manager.add_torrent("xubuntu-6.10-desktop-i386.iso.torrent", ".", True)