home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / lib / python2.4 / site-packages / BitTorrent / spewout.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2006-08-31  |  1.0 KB  |  46 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.4)
  3.  
  4.  
  5. def print_spew(spew):
  6.     s = StringIO()
  7.     s.write('\n\n\n')
  8.     for c in spew:
  9.         s.write('%20s ' % c['ip'])
  10.         if c['initiation'] == 'local':
  11.             s.write('l')
  12.         else:
  13.             s.write('r')
  14.         (rate, interested, choked) = c['upload']
  15.         s.write(' %10s ' % str(int(rate)))
  16.         if c['is_optimistic_unchoke']:
  17.             s.write('*')
  18.         else:
  19.             s.write(' ')
  20.         if interested:
  21.             s.write('i')
  22.         else:
  23.             s.write(' ')
  24.         if choked:
  25.             s.write('c')
  26.         else:
  27.             s.write(' ')
  28.         (rate, interested, choked, snubbed) = c['download']
  29.         s.write(' %10s ' % str(int(rate)))
  30.         if interested:
  31.             s.write('i')
  32.         else:
  33.             s.write(' ')
  34.         if choked:
  35.             s.write('c')
  36.         else:
  37.             s.write(' ')
  38.         if snubbed:
  39.             s.write('s')
  40.         else:
  41.             s.write(' ')
  42.         s.write('\n')
  43.     
  44.     print s.getvalue()
  45.  
  46.