1 theshadow 1.1 #!/usr/bin/env python
2
3 # Written by Bram Cohen
4 # see LICENSE.txt for license information
5
|
6 theshadow 1.2 from BitTornado import PSYCO
|
7 theshadow 1.1 if PSYCO.psyco:
8 try:
9 import psyco
10 assert psyco.__version__ >= 0x010100f0
11 psyco.full()
12 except:
13 pass
14
|
15 theshadow 1.6 from sys import argv, version, exit
|
16 theshadow 1.4 assert version >= '2', "Install Python 2.0 or greater"
|
17 theshadow 1.1 from os import listdir
18 from os.path import join, split
19 from threading import Event
20 from traceback import print_exc
|
21 theshadow 1.5 from BitTornado.BT1.makemetafile import defaults, completedir, print_announcelist_details
|
22 theshadow 1.2 from BitTornado.parseargs import parseargs, formatDefinitions
|
23 theshadow 1.1
24
|
25 theshadow 1.3 if len(argv) < 3:
26 a,b = split(argv[0])
27 print 'Usage: ' + b + ' <trackerurl> <dir> [dir...] [params...]'
28 print 'makes a .torrent file for every file or directory present in each dir.'
29 print
30 print formatDefinitions(defaults, 80)
31 print_announcelist_details()
32 print ('')
33 exit(2)
34
35 try:
36 config, args = parseargs(argv[1:], defaults, 2, None)
37 for dir in args[1:]:
38 completedir(dir, args[0], config)
39 except ValueError, e:
40 print 'error: ' + str(e)
41 print 'run with no args for parameter explanations'
|