aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/collateral/jpm.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/python/collateral/jpm.py b/python/collateral/jpm.py
index 52b2e26f..6d62a8b3 100644
--- a/python/collateral/jpm.py
+++ b/python/collateral/jpm.py
@@ -23,11 +23,11 @@ accounts = {
passwords = {"BowdSt": "tm64EO", "Serenitas": "JV3RJu", "Selene": "s3agvz"}
-def load_file(d, fund):
+def load_file(d, fund, ext="pdf"):
try:
fname = next(
(DAILY_DIR / fund / "JPM_reports").glob(
- f"CSCFTCSTMT-*-{d:%y%m%d}-{accounts[fund]}_2.pdf"
+ f"CSCFTCSTMT-*-{d:%y%m%d}-{accounts[fund]}_2.{ext}"
)
)
except StopIteration:
@@ -76,7 +76,7 @@ def download_files(em, count=20, *, fund="BowdSt", **kwargs):
if fname.endswith("pdf"):
pdf = Pdf.open(stream, password=passwords[fund])
pdf.save(p)
- else:
+ elif fname.endswith("xls"):
xl_file = msoffcrypto.OfficeFile(stream)
xl_file.load_key(password=passwords[fund])
with p.open("wb") as fh: