aboutsummaryrefslogtreecommitdiffstats
path: root/python/markit_red.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/markit_red.py')
-rw-r--r--python/markit_red.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/python/markit_red.py b/python/markit_red.py
index 630ca472..9241502f 100644
--- a/python/markit_red.py
+++ b/python/markit_red.py
@@ -1,7 +1,6 @@
import csv
from lxml import etree
import requests, io, zipfile, shutil
-import common
import os
from db import with_connection
@@ -11,7 +10,7 @@ def request_payload(payload):
with zipfile.ZipFile(io.BytesIO(r.content)) as z:
for f in z.namelist():
if f.endswith("xml"):
- z.extract(f, path=os.path.join(common.root, "Tranche_data", "RED_reports"))
+ z.extract(f, path=os.path.join(os.environ['BASE_DIR'], "Tranche_data", "RED_reports"))
res.append(f)
return res
@@ -32,7 +31,7 @@ def download_report(report):
@with_connection('serenitasdb')
def update_redcodes(conn, fname):
- with open(os.path.join(common.root, "Tranche_data", "RED_reports", fname)) as fh:
+ with open(os.path.join(os.environ['BASE_DIR'], "Tranche_data", "RED_reports", fname)) as fh:
et = etree.parse(fh)
r = []
for indextype in ['HY', 'IG', 'EU', 'XO']:
@@ -52,7 +51,7 @@ def update_redcodes(conn, fname):
conn.commit()
def update_redindices(fname):
- basedir = os.path.join(common.root, "Tranche_Data", "RED_reports")
+ basedir = os.path.join(os.environ['BASE_DIR'], "Tranche_Data", "RED_reports")
with open(os.path.join(basedir, fname)) as fh:
e = etree.parse(fh)
root = e.getroot()