Coverage for flexget : 30%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
|
#!/usr/bin/python
"""Main entry point for Command Line Interface"""
logger.initialize()
parser = CoreOptionParser() plugin.load_plugins(parser)
options = parser.parse_args()[0]
try: manager = Manager(options) except IOError, e: # failed to load config, TODO: why should it be handled here? So sys.exit isn't called in webui? log.critical(e) logger.flush_logging_to_console() sys.exit(1)
log_level = logging.getLevelName(options.loglevel.upper()) log_file = os.path.expanduser(manager.options.logfile) # If an absolute path is not specified, use the config directory. if not os.path.isabs(log_file): log_file = os.path.join(manager.config_base, log_file) logger.start(log_file, log_level)
if options.profile: try: import cProfile as profile except ImportError: import profile profile.runctx('manager.execute()', globals(), locals(), os.path.join(manager.config_base, 'flexget.profile')) else: manager.execute() manager.shutdown() |