aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/report_ops/__main__.py10
-rw-r--r--python/report_ops/admin.py5
2 files changed, 9 insertions, 6 deletions
diff --git a/python/report_ops/__main__.py b/python/report_ops/__main__.py
index 0345a049..ab50c632 100644
--- a/python/report_ops/__main__.py
+++ b/python/report_ops/__main__.py
@@ -15,7 +15,7 @@ from .sma import (
CDXSwaptionPosition,
)
from .cash import NTCashReport, UMBCashReport, BNYCashReport
-from .admin import AccruedReport, AllReport
+from .admin import CitcoReport
from .wires import Wire
from .custodians import upload_to_custodian
from .utils import notify_payment_settlements, PaymentMonitor
@@ -89,12 +89,10 @@ if args.cash_reports:
logger.warning(e)
if args.isosel_reports:
- for report_cls in (
- AccruedReport,
- AllReport,
- ):
+ for report in ("isosel_accrued", "citco_reports"):
+ report = CitcoReport[report]
try:
- report_cls.to_db(cob)
+ report.to_db(cob)
except ValueError as e:
logger.info(e)
diff --git a/python/report_ops/admin.py b/python/report_ops/admin.py
index 337cc73b..05269659 100644
--- a/python/report_ops/admin.py
+++ b/python/report_ops/admin.py
@@ -26,16 +26,21 @@ class CitcoReport:
_conn: dbconn = dbconn("dawndb")
date_cols: List[str] = []
dtkey_fun: ClassVar
+ _registry = {}
def __init_subclass__(cls, table, fname, date_cols, dtkey):
cls.table = table
cls.fname = fname
cls.date_cols = date_cols
cls.dtkey_fun = partial(dt_from_citco, file_tag=cls.fname, dt_format=dtkey)
+ cls._registry[table] = cls
def __init__(self, date):
self.date = date
+ def __class_getitem__(cls, table):
+ return cls._registry[table]
+
@classmethod
def get_newest_report(cls, date):
p = max(