aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/bowdst_wire.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/python/bowdst_wire.py b/python/bowdst_wire.py
index 4e8c99f0..412e953c 100644
--- a/python/bowdst_wire.py
+++ b/python/bowdst_wire.py
@@ -4,8 +4,17 @@ from citco_ops.bowdst import BowdstWire
import datetime
+def dt_from_fname(f):
+ return datetime.datetime.strptime(
+ f.name.split("_")[1].split(".")[0], "%d %b %Y%H%M%S"
+ )
+
+
def load_wire_report(workdate: datetime.date):
- p = get_dir(workdate) / f"BowdstWires_{workdate:%d %b %Y}.csv"
+ p = max(
+ [f for f in get_dir(workdate).iterdir() if "BowdstWires" in f.name],
+ key=dt_from_fname,
+ )
with open(p) as fh:
reader = DictReader(fh)
for line in reader: