logo       

CVS: BitTorrent btmakemetafile.py,1.17,1.18: msg#00244

network.bit-torrent.general

Subject: CVS: BitTorrent btmakemetafile.py,1.17,1.18

Update of /cvsroot/bittorrent/BitTorrent
In directory sc8-pr-cvs1:/tmp/cvs-serv25806

Modified Files:
btmakemetafile.py
Log Message:
added command line parameter to btmakemetafile

Index: btmakemetafile.py
===================================================================
RCS file: /cvsroot/bittorrent/BitTorrent/btmakemetafile.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** btmakemetafile.py 26 Mar 2003 03:45:25 -0000 1.17
--- btmakemetafile.py 30 Mar 2003 00:57:03 -0000 1.18
***************
*** 13,18 ****
--- 13,24 ----
from BitTorrent.bencode import bencode
from BitTorrent.btformats import check_info
+ from BitTorrent.parseargs import parseargs, formatDefinitions
from threading import Event

+ defaults = [
+ ('piece_size_pow2', None, 18,
+ "which power of 2 to set the piece size to"),
+ ]
+
ignore = ['core', 'CVS'] # ignoring these files could be trouble

***************
*** 20,27 ****
pass

! def make_meta_file(file, url, piece_length = None,
flag = Event(), progress = dummy, progress_percent=1):
! if piece_length is None:
! piece_length = 2 ** 18
a, b = split(file)
if b == '':
--- 26,32 ----
pass

! def make_meta_file(file, url, piece_len_exp = 18,
flag = Event(), progress = dummy, progress_percent=1):
! piece_length = 2 ** piece_len_exp
a, b = split(file)
if b == '':
***************
*** 126,128 ****

if __name__ == '__main__':
! make_meta_file(argv[1], argv[2], progress = prog)
--- 131,144 ----

if __name__ == '__main__':
! if len(argv) < 3:
! print 'usage is -'
! print argv[0] + ' file trackerurl [params]'
! print
! print formatDefinitions(defaults, 80)
! else:
! try:
! config, args = parseargs(argv[3:], defaults, 0, 0)
! make_meta_file(argv[1], argv[2], config['piece_size_pow2'],
progress = prog)
! except ValueError, e:
! print 'error: ' + str(e)
! print 'run with no args for parameter explanations'



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/W7NydA/hdqFAA/VygGAA/dkFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
BitTorrent-unsubscribe@xxxxxxxxxxxxxxx



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise