update simple_client.py

This commit is contained in:
Andrew Resch 2008-10-02 06:37:54 +00:00
parent f8862302cc
commit 5ca35b8ef3
1 changed files with 10 additions and 2 deletions

View File

@ -13,12 +13,20 @@ ses.listen_on(6881, 6891)
e = lt.bdecode(open("test.torrent", 'rb').read())
info = lt.torrent_info(e)
h = ses.add_torrent(info, "./")
atp = {}
atp["ti"] = info
atp["save_path"] = "./"
atp["storage_mode"] = lt.storage_mode_t(1)
atp["paused"] = False
atp["auto_managed"] = True
atp["duplicate_is_error"] = True
h = ses.add_torrent(atp)
while (not h.is_seed()):
s = h.status()
state_str = ['queued', 'checking', 'connecting', 'downloading metadata', \
state_str = ['queued', 'checking', 'downloading metadata', \
'downloading', 'finished', 'seeding', 'allocating']
print '\r%.2f%% complete (down: %.1f kb/s up: %.1f kB/s peers: %d) %s' % \
(s.progress * 100, s.download_rate / 1000, s.upload_rate / 1000, \