Example #1
0
def track(args):
    if len(args) == 0:
        print formatDefinitions(defaults, 80)
        return
    try:
        config, files = parseargs(args, defaults, 0, 0)
    except ValueError, e:
        print _("error: ") + str(e)
        print _("run with no arguments for parameter explanations")
        return
Example #2
0
def track(args):
    if len(args) == 0:
        print formatDefinitions(defaults, 80)
        return
    try:
        config, files = parseargs(args, defaults, 0, 0)
    except ValueError, e:
        print 'error: ' + str(e)
        print 'run with no arguments for parameter explanations'
        return
Example #3
0
def subfiles(d):
    r = []
    stack = [([], d)]
    while len(stack) > 0:
        p, n = stack.pop()
        if isdir(n):
            for s in listdir(n):
                if s not in ignore and s[:1] != '.':
                    stack.append((copy(p) + [s], join(n, s)))
        else:
            r.append((p, n))
    return r

def prog(amount):
    print '%.1f%% complete\r' % (amount * 100),

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,
                comment = config['comment'], target = config['target'])
        except ValueError, e:
            print 'error: ' + str(e)
            print 'run with no args for parameter explanations'
Example #4
0
            for s in listdir(n):
                if s not in ignore and s[:1] != '.':
                    stack.append((copy(p) + [s], join(n, s)))
        else:
            r.append((p, n))
    return r


def prog(amount):
    print '%.1f%% complete\r' % (amount * 100),


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,
                           comment=config['comment'],
                           target=config['target'])
        except ValueError, e:
            print 'error: ' + str(e)
            print 'run with no args for parameter explanations'