return args
+def process(market_config, user_id, report_path, args):
+ try:
+ market.Market\
+ .from_config(market_config, debug=args.debug, user_id=user_id, report_path=report_path)\
+ .process(args.action, before=args.before, after=args.after)
+ except Exception as e:
+ print("{}: {}".format(e.__class__.__name__, e))
+
def main(argv):
args = parse_args(argv)
pg_config, report_path = parse_config(args.config)
for market_config, user_id in fetch_markets(pg_config, args.user):
- try:
- market.Market\
- .from_config(market_config, debug=args.debug, user_id=user_id, report_path=report_path)\
- .process(args.action, before=args.before, after=args.after)
- except Exception as e:
- print("{}: {}".format(e.__class__.__name__, e))
+ process(market_config, user_id, report_path, args)
if __name__ == '__main__': # pragma: no cover
main(sys.argv[1:])