print "Error: %s" % e return 1 # Setup logging level = logging.WARNING if args.quiet else ( logging.DEBUG if args.verbose else logging.INFO) ch = logging.StreamHandler() ch.setFormatter(logging.Formatter("%(message)s")) log = logging.getLogger() log.setLevel(level) log.addHandler(ch) # Build a list of jobs, process them. if args.config: try: jobs, global_config = config.load_config_from_file(args.config) except config.ConfigError, e: log.fatal('Error loading config file: %s' % e) return 1 else: # Only a single job, as given on the command line jobs = {None: Job(**{'target': args.target, 'dateformat': args.dateformat, 'deltas': args.deltas, 'sources': args.sources})} global_config = {} # Validate the requested list of jobs to run if args.jobs: unknown = set(args.jobs) - set(jobs.keys()) if unknown: log.fatal('Error: not defined in the config file: %s' % ", ".join(unknown)) return 1
print "Error: %s" % e return 1 # Setup logging level = logging.WARNING if args.quiet else ( logging.DEBUG if args.verbose else logging.INFO) ch = logging.StreamHandler() ch.setFormatter(logging.Formatter("%(message)s")) log = logging.getLogger() log.setLevel(level) log.addHandler(ch) # Build a list of jobs, process them. if args.config: try: jobs = config.load_config_from_file(args.config) except config.ConfigError, e: log.fatal('Error loading config file: %s' % e) return 1 else: # Only a single job, as given on the command line jobs = {None: Job(**{'target': args.target, 'dateformat': args.dateformat, 'deltas': args.deltas, 'sources': args.sources})} # Validate the requested list of jobs to run if args.jobs: unknown = set(args.jobs) - set(jobs.keys()) if unknown: log.fatal('Error: not defined in the config file: %s' % ", ".join(unknown)) return 1 jobs_to_run = dict([(n, j) for n, j in jobs.iteritems() if n in args.jobs])
print "Error: %s" % e return 1 # Setup logging level = logging.WARNING if args.quiet else ( logging.DEBUG if args.verbose else logging.INFO) ch = logging.StreamHandler() ch.setFormatter(logging.Formatter("%(message)s")) log = logging.getLogger() log.setLevel(level) log.addHandler(ch) # Build a list of jobs, process them. if args.config: try: jobs = config.load_config_from_file(args.config) except config.ConfigError, e: log.fatal('Error loading config file: %s' % e) return 1 else: # Only a single job, as given on the command line jobs = { None: Job( **{ 'target': args.target, 'dateformat': args.dateformat, 'deltas': args.deltas, 'sources': args.sources }) }