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
|
|
|
|
#*/
|
|
|
|
|
|
|
|
|
2006-12-03 18:20:15 +00:00
|
|
|
import pytorrent
|
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
|
|
|
|
2006-12-03 19:08:51 +00:00
|
|
|
manager = pytorrent.manager("PT", "0500", "pytorrent - testing only",
|
2006-12-04 16:42:35 +00:00
|
|
|
os.path.expanduser("~") + "/Temp")
|
2006-12-01 18:07:03 +00:00
|
|
|
|
2006-12-05 09:22:53 +00:00
|
|
|
#manager.prefs['max_active_torrents'] = 1
|
|
|
|
|
2006-12-03 19:08:51 +00:00
|
|
|
#my_torrent = manager.add_torrent("ubuntu.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:
|
|
|
|
print "STATE:", manager.get_num_torrents()
|
|
|
|
for j in range(manager.get_num_torrents()):
|
|
|
|
print manager.get_state(j)
|
|
|
|
print ""
|
|
|
|
sleep(2)
|
|
|
|
except KeyboardInterrupt:
|
|
|
|
manager.quit()
|