aboutsummaryrefslogtreecommitdiff
path: root/main.py
blob: d4bab0296855383ff439341b87ab70f45297fc00 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import sys
import helper, market

args = helper.main_parse_args(sys.argv[1:])

pg_config, report_path = helper.main_parse_config(args.config)

for market_config, user_id in helper.main_fetch_markets(pg_config, args.user):
    try:
        user_market = market.Market.from_config(market_config, debug=args.debug)
        helper.main_process_market(user_market, args.action, before=args.before, after=args.after)
    except Exception as e:
        try:
            user_market.report.log_error("main", exception=e)
        except:
            print("{}: {}".format(e.__class__.__name__, e))
    finally:
        helper.main_store_report(report_path, user_id, user_market)