def download(self, params): action = params[0] self.logger = logging.getLogger(action) defaults.extend( [ ( 'parse_dir_interval', 60, "how often to rescan the torrent directory, in seconds" ), ( 'recursive_torrents_search', True, "search folder for torrents recursively or semi-resursively in launchmany mode" ), ( 'saveas_style', 1, "How to name torrent downloads (1 = rename to torrent name, " + "2 = save under name in torrent, 3 = save in directory under torrent name)" ), ( 'display_path', 1, "whether to display the full path or the torrent contents for each torrent" ), ] ) try: configdir = ConfigDir('launchmany') defaultsToIgnore = ['responsefile', 'url', 'priority'] configdir.setDefaults(defaults,defaultsToIgnore) configdefaults = configdir.loadConfig() defaults.append(('save_options',0, "whether to save the current options as the new default configuration " + "(only for btlaunchmany.py)")) config, args = parseargs(params[1:], defaults, 1, 1, configdefaults) if config['save_options']: configdir.saveConfig(config) configdir.deleteOldCacheData(config['expire_cache_data']) if not os.path.isdir(args[0]): raise ValueError("Warning: "+args[0]+" is not a directory") config['torrent_dir'] = args[0] except ValueError, e: self.logger.error(str(e) + '\nrun with no args for parameter explanations') exit(1)
print "### " + s def exception(self, s): Exceptions.append(s) self.message('SYSTEM ERROR - EXCEPTION GENERATED') if __name__ == '__main__': if sys.argv[1:] == ['--version']: print version sys.exit(0) defaults.extend([ ('parse_dir_interval', 60, "how often to rescan the torrent directory, in seconds"), ('saveas_style', 1, 'How to name torrent downloads (1 = rename to ' 'torrent name, 2 = save under name in torrent, 3 = save in directory ' 'under torrent name)'), ('display_path', 1, 'whether to display the full path or the torrent ' 'contents for each torrent'), ]) try: configdir = ConfigDir('launchmany') defaultsToIgnore = ['responsefile', 'url', 'priority'] configdir.setDefaults(defaults, defaultsToIgnore) configdefaults = configdir.loadConfig() defaults.append( ('save_options', 0, 'whether to save the current options as the ' 'new default configuration (only for btlaunchmany.py)')) if len(sys.argv) < 2: print "Usage: btlaunchmany.py <directory> <global options>\n" print "<directory> - directory to look for .torrent files " \
def LaunchManyWrapper(scrwin, config): LaunchMany(config, CursesDisplayer(scrwin)) if __name__ == '__main__': if argv[1:] == ['--version']: print version exit(0) defaults.extend( [ ( 'parse_dir_interval', 60, "how often to rescan the torrent directory, in seconds" ), ( 'saveas_style', 2, "How to name torrent downloads (1 = rename to torrent name, " + "2 = save under name in torrent, 3 = save in directory under torrent name)" ), ( 'display_path', 0, "whether to display the full path or the torrent contents for each torrent" ), ] ) try: configdir = ConfigDir('launchmanycurses') defaultsToIgnore = ['responsefile', 'url', 'priority'] configdir.setDefaults(defaults,defaultsToIgnore) configdefaults = configdir.loadConfig() defaults.append(('save_options',0, "whether to save the current options as the new default configuration " + "(only for btlaunchmanycurses.py)")) if len(argv) < 2: print "Usage: btlaunchmanycurses.py <directory> <global options>\n" print "<directory> - directory to look for .torrent files (semi-recursive)"
self.message('SYSTEM ERROR - EXCEPTION GENERATED') def LaunchManyWrapper(scrwin, config): LaunchMany(config, CursesDisplayer(scrwin)) if __name__ == '__main__': if sys.argv[1:] == ['--version']: print version sys.exit(0) defaults.extend([ ('parse_dir_interval', 60, 'how often to rescan the torrent directory, in seconds'), ('saveas_style', 2, 'How to name torrent downloads (1 = rename to ' 'torrent name, 2 = save under name in torrent, 3 = save in directory ' 'under torrent name)'), ('display_path', 0, 'whether to display the full path or the torrent ' 'contents for each torrent'), ]) try: configdir = ConfigDir('launchmanycurses') defaultsToIgnore = ['responsefile', 'url', 'priority'] configdir.setDefaults(defaults, defaultsToIgnore) configdefaults = configdir.loadConfig() defaults.append(('save_options', 0, 'whether to save the current ' 'options as the new default configuration (only for ' 'btlaunchmanycurses.py)')) if len(sys.argv) < 2: print "Usage: btlaunchmanycurses.py <directory> <global options>\n" print "<directory> - directory to look for .torrent files " \
def exception(self, s): Exceptions.append(s) self.message('SYSTEM ERROR - EXCEPTION GENERATED') if __name__ == '__main__': if argv[1:] == ['--version']: print version exit(0) defaults.extend([ ('parse_dir_interval', 60, "how often to rescan the torrent directory, in seconds"), ('saveas_style', 1, "How to name torrent downloads (1 = rename to torrent name, " + "2 = save under name in torrent, 3 = save in directory under torrent name)" ), ('display_path', 1, "whether to display the full path or the torrent contents for each torrent" ), ]) try: configdir = ConfigDir('launchmany') defaultsToIgnore = ['responsefile', 'url', 'priority'] configdir.setDefaults(defaults, defaultsToIgnore) configdefaults = configdir.loadConfig() defaults.append(( 'save_options', 0, "whether to save the current options as the new default configuration " + "(only for btlaunchmany.py)")) if len(argv) < 2: