]>
Commit | Line | Data |
---|---|---|
1 | import sys | |
2 | import helper, market | |
3 | ||
4 | args = helper.main_parse_args(sys.argv[1:]) | |
5 | ||
6 | pg_config, report_path = helper.main_parse_config(args.config) | |
7 | ||
8 | for market_config, user_id in helper.main_fetch_markets(pg_config, args.user): | |
9 | try: | |
10 | market_config["apiKey"] = market_config.pop("key") | |
11 | user_market = market.Market.from_config(market_config, debug=args.debug) | |
12 | helper.main_process_market(user_market, args.action, before=args.before, after=args.after) | |
13 | except Exception as e: | |
14 | print("{}: {}".format(e.__class__.__name__, e)) | |
15 | finally: | |
16 | helper.main_store_report(report_path, user_id, user_market) |