attempt to fix #12

This commit is contained in:
Arvid Norberg
2007-04-19 01:26:23 +00:00
parent 6b0f60e73d
commit 6186e3fce7
2 changed files with 57 additions and 2 deletions

View File

@@ -146,6 +146,24 @@ def print_peer_info(console, peers):
write_line(console, out)
def print_download_queue(console, download_queue):
out = ""
for e in download_queue:
out += '%4d: [' % e['piece_index'];
finished_blocks = e['finished_blocks']
requested_blocks = e['requested_blocks']
for index in xrange(len(e['peers']))
if (finished_blocks[index])
out += '#'
elif requested_blocks[index]
out += '+'
else
out += '-'
out += ']\n'
def main():
from optparse import OptionParser
@@ -279,8 +297,8 @@ def main():
write_line(console, out)
peers = h.get_peer_info()
print_peer_info(console, peers)
print_peer_info(console, h.get_peer_info())
print_download_queue(console, h.get_download_queue())
if True and s.state != lt.torrent_status.seeding:
out = '\n'