diff options
Diffstat (limited to 'python/task_server/globeop.py')
| -rw-r--r-- | python/task_server/globeop.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/python/task_server/globeop.py b/python/task_server/globeop.py index 0f0f60c9..acd91302 100644 --- a/python/task_server/globeop.py +++ b/python/task_server/globeop.py @@ -76,14 +76,17 @@ def convert_to_csv(f): f.unlink() -def download_data(engine, workdate: datetime.date): +def download_data(engine, workdate: datetime.date, fund): ftp = FtpClient.from_creds("globeop") ftp.client.cwd("outgoing") files = ftp.client.nlst() pnlfiles = [ filename for filename in files - if filename.endswith("csv.asc") and "Profit" in filename and "KD" in filename + if filename.endswith("csv.asc") + and "Profit" in filename + and "KD" in filename + and fund in filename if get_ped(filename) < workdate ] valuationfiles = [ @@ -92,6 +95,7 @@ def download_data(engine, workdate: datetime.date): if filename.endswith("csv.asc") and "Valuation_TradeID" in filename and "KD" in filename + and fund in filename if get_ped(filename) < workdate ] cdsfiles = [ @@ -124,9 +128,9 @@ def download_data(engine, workdate: datetime.date): gpg = get_gpg() for filename in available_files: if "Profit" in filename: - newfilename = "Pnl_Report.csv" + newfilename = f"Pnl_Report_{fund}.csv" elif "Valuation" in filename: - newfilename = "Valuation_Report.csv" + newfilename = f"Valuation_Report_{fund}.csv" else: newfilename = "CDS_Report.xls" with (reports_dir / filename).open("rb") as fh: |
