diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/clo_universe.py | 3 | ||||
| -rw-r--r-- | python/load_intex_collateral.py | 15 |
2 files changed, 8 insertions, 10 deletions
diff --git a/python/clo_universe.py b/python/clo_universe.py index 2590dd21..721a6c0e 100644 --- a/python/clo_universe.py +++ b/python/clo_universe.py @@ -12,7 +12,8 @@ if os.name=='nt': elif os.name=='posix': root = "/home/share/CorpCDOs/" -universe = "data/clo_universe_intex_2012-11-21.txt" +workdate = '2012-11-30' +universe = os.path.join("data", "clo_universe_intex_" + workdate + ".txt") def convertToNone(s): return None if s=="-" or s=="" else s diff --git a/python/load_intex_collateral.py b/python/load_intex_collateral.py index 0ccaa1da..a16430bc 100644 --- a/python/load_intex_collateral.py +++ b/python/load_intex_collateral.py @@ -22,7 +22,7 @@ conn = psycopg2.connect(database="ET", user="et_user", password="Serenitas1", ho cursor = conn.cursor() prog = re.compile("\((.*)\)") -workdate = "2012-11-20" +workdate = "2012-11-30" with open(os.path.join(root, "data", "clo_universe_intex_" + workdate + ".txt")) as fh: dr = csv.DictReader(fh, dialect='excel-tab') deal_table = {line['Deal,Tr/CUSIP/ISIN']: datetime.strptime(line['Latest Update'], '%b %d, %Y').date() \ @@ -98,16 +98,13 @@ for dealname in os.listdir(os.path.join(root, "Collaterals_" + workdate)): print detail pdb.set_trace() except psycopg2.IntegrityError as detail: + print detail # crazy hack intex unique id is not really unique - if dealname in ["caval1", "octag11", "octagon8", "windriv2"]: - conn.rollback() - # make sure the loan name is unique by tagging it - row[0] = row[0] + str(tag) - tag = tag+1 + conn.rollback() + # make sure the loan name is unique by tagging it + row[0] = row[0] + "_tag_" + str(tag) + tag = tag+1 cursor.execute(sqlstr, (dealname, updatedate) + tuple(row)) - else: - print detail - pdb.set_trace() conn.commit() |
