diff options
Diffstat (limited to 'python/report_ops/__main__.py')
| -rw-r--r-- | python/report_ops/__main__.py | 49 |
1 files changed, 27 insertions, 22 deletions
diff --git a/python/report_ops/__main__.py b/python/report_ops/__main__.py index 4372137a..4124ef08 100644 --- a/python/report_ops/__main__.py +++ b/python/report_ops/__main__.py @@ -83,31 +83,36 @@ if args.sma_positions: if args.cash_reports or args.wire_reports: em = ExchangeMessage() + if args.cash_reports: + Report = CashReport + else: + Report = WireReport for fund, custodians in _fund_custodians.items(): for custodian in custodians: get_custodian_download_fun(custodian)(args.date, fund, em=em) - if args.cash_reports: - cash_report = CashReport[custodian] - try: - for row in cash_report.yield_rows(args.date, fund): - cash = cash_report.from_report_line( - row | {"fund": fund, "knowledge_date": args.date} - ) - cash.stage() - cash_report.commit() - cash_report.clear() - except (MissingDataError, RuntimeError) as e: - logger.warning(e) - if args.wire_reports: - wire_report = WireReport[custodian] - try: - for row in wire_report.yield_rows(args.date, fund): - wire = wire_report.from_report_line(row | {"fund": fund}) - wire.stage() - wire_report.commit() - wire_report.clear() - except (MissingDataError, RuntimeError) as e: - logger.warning(e) + report = Report[custodian](args.date, fund) + report.commit() + # cash_report = CashReport[custodian] + # try: + # for row in cash_report.yield_rows(args.date, fund): + # cash = cash_report.from_report_line( + # row | {"fund": fund, "knowledge_date": args.date} + # ) + # cash.stage() + # cash_report.commit() + # cash_report.clear() + # except (MissingDataError, RuntimeError) as e: + # logger.warning(e) + # if args.wire_reports: + # wire_report = WireReport[custodian] + # try: + # for row in wire_report.yield_rows(args.date, fund): + # wire = wire_report.from_report_line(row | {"fund": fund}) + # wire.stage() + # wire_report.commit() + # wire_report.clear() + # except (MissingDataError, RuntimeError) as e: + # logger.warning(e) if args.isosel_reports: for fund in ("ISOSEL",): |
