deluge/test.py

39 lines
1015 B
Python
Raw Normal View History

2006-12-01 18:07:03 +00:00
#/*
#Copyright: A. Zakai ('Kripken') <kripkensteiner@gmail.com> http://6thsenseless.blogspot.com
#
#2006-15-9
#
#This code is licensed under the terms of the GNU General Public License (GPL),
#version 2 or above; See /usr/share/common-licenses/GPL , or see
#http://www.fsf.org/licensing/licenses/gpl.html
#*/
2007-01-08 20:07:39 +00:00
import deluge
2006-12-01 18:07:03 +00:00
from time import sleep
2006-12-03 19:08:51 +00:00
import os
2006-12-01 18:07:03 +00:00
2007-01-08 20:07:39 +00:00
manager = deluge.manager("FL", "0500", "deluge - testing only",
2006-12-08 14:17:36 +00:00
os.path.expanduser("~") + "/Temp")# blank_slate=True)
2006-12-01 18:07:03 +00:00
2006-12-05 16:19:48 +00:00
#manager.set_pref('max_upload_rate', 6*1024)
2006-12-05 09:22:53 +00:00
2006-12-05 14:35:58 +00:00
#my_torrent = manager.add_torrent("xubuntu-6.10-desktop-i386.iso.torrent", ".", True)
2006-12-03 18:20:15 +00:00
2006-12-03 19:08:51 +00:00
#print "Unique ID:", my_torrent
2006-12-01 18:07:03 +00:00
2006-12-05 09:22:53 +00:00
print "PREFS:", manager.prefs
try:
while True:
2006-12-05 14:32:17 +00:00
print "STATE:", manager.get_state()
print "# torrents:", manager.get_num_torrents()
for unique_ID in manager.get_unique_IDs():
print unique_ID, manager.get_torrent_state(unique_ID)
manager.handle_events()
2006-12-05 09:22:53 +00:00
print ""
sleep(2)
except KeyboardInterrupt:
2006-12-05 17:25:30 +00:00
print "Shutting down..."
2006-12-05 09:22:53 +00:00
manager.quit()