Beispiel #1
0
    def failed(self, torrent, is_external):
        self.doneflag.set()

    def finished(self, torrent):
        self.d.finished()


if __name__ == '__main__':
    uiname = 'anondownloadcurses'
    defaults = get_defaults(uiname)

    if len(sys.argv) <= 1:
        printHelp(uiname, defaults)
        sys.exit(1)
    try:
        config, args = configfile.parse_configuration_and_args(defaults,
                                       uiname, sys.argv[1:], 0, 1)
        if args:
            if config['responsefile']:
                raise BTFailure, 'must have responsefile as arg or ' \
                      'parameter, not both'
            config['responsefile'] = args[0]
        try:
            if config['responsefile']:
                h = file(config['responsefile'], 'rb')
                metainfo = h.read()
                h.close()
            elif config['url']:
                h = urlopen(config['url'])
                metainfo = h.read()
                h.close()
            else:
Beispiel #2
0
def main(parent=None):
    config, args = configfile.parse_configuration_and_args(defaults,
                                'makeatorrentgui', sys.argv[1:], 0, None)
    w = MainWindow(config, parent)
    save_options = ('torrent_dir','piece_size_pow2','tracker_name')
    configfile.save_ui_config(w.config, 'makeatorrentgui', save_options)
Beispiel #3
0
    def failed(self, torrent, is_external):
        self.doneflag.set()

    def finished(self, torrent):
        self.d.finished()


if __name__ == '__main__':
    uiname = 'anondownloadcurses'
    defaults = get_defaults(uiname)

    if len(sys.argv) <= 1:
        printHelp(uiname, defaults)
        sys.exit(1)
    try:
        config, args = configfile.parse_configuration_and_args(
            defaults, uiname, sys.argv[1:], 0, 1)
        if args:
            if config['responsefile']:
                raise BTFailure, 'must have responsefile as arg or ' \
                      'parameter, not both'
            config['responsefile'] = args[0]
        try:
            if config['responsefile']:
                h = file(config['responsefile'], 'rb')
                metainfo = h.read()
                h.close()
            elif config['url']:
                h = urlopen(config['url'])
                metainfo = h.read()
                h.close()
            else:
Beispiel #4
0
def main(parent=None):
    config, args = configfile.parse_configuration_and_args(
        defaults, 'makeatorrentgui', sys.argv[1:], 0, None)
    w = MainWindow(config, parent)
    save_options = ('torrent_dir', 'piece_size_pow2', 'tracker_name')
    configfile.save_ui_config(w.config, 'makeatorrentgui', save_options)