This commit is contained in:
Alon Zakai 2006-12-05 14:46:04 +00:00
parent b4abcee340
commit 7e9b6e816f
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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)