aboutsummaryrefslogtreecommitdiffstats
path: root/python/load_intex_collateral.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/load_intex_collateral.py')
-rw-r--r--python/load_intex_collateral.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/python/load_intex_collateral.py b/python/load_intex_collateral.py
index 8a5c0ffa..aa6c793a 100644
--- a/python/load_intex_collateral.py
+++ b/python/load_intex_collateral.py
@@ -42,7 +42,7 @@ def upload_data(dealnames, workdate, conn, cursor):
dr = csv.DictReader(fh, dialect = 'excel-tab')
missingfields = set(fields) - set(dr.fieldnames)
if "LoanX ID" in missingfields:
- print "LoanX ID column is missing. Probably an error in exporting from intex"
+ print("LoanX ID column is missing. Probably an error in exporting from intex")
pdb.set_trace()
data = []
for line in dr:
@@ -55,7 +55,7 @@ def upload_data(dealnames, workdate, conn, cursor):
if line['LoanX ID']:
line['LoanX ID'] = line['LoanX ID'].upper()
if len(line['LoanX ID']) > 8:
- print "dubious id found: {0}".format(line['LoanX ID'])
+ print("dubious id found: {0}".format(line['LoanX ID']))
line['LoanX ID'] = line['LoanX ID'][:8]
try:
# make sure the string is utf8 safe
@@ -65,7 +65,7 @@ def upload_data(dealnames, workdate, conn, cursor):
line['Reinvest Collat'] = True
line['Issuer'] = line['ID Number']
except AttributeError as detail:
- print dealname
+ print(dealname)
if 'Spread' in missingfields or not line['Spread']:
line['Spread'] = line['Gross Margin']
@@ -98,7 +98,7 @@ def upload_data(dealnames, workdate, conn, cursor):
try:
updatedate = deal_table[dealname]
except KeyError as detail:
- print detail
+ print(detail)
pdb.set_trace()
reinsert = False
@@ -107,7 +107,7 @@ def upload_data(dealnames, workdate, conn, cursor):
cursor.execute(sqlstr, (dealname, updatedate))
currlen = cursor.fetchone()[0]
if currlen <> len(data):
- print "{0} has {1} rows in the database and current collateral file has {2}".format(dealname, currlen, len(data))
+ print("{0} has {1} rows in the database and current collateral file has {2}".format(dealname, currlen, len(data)))
sqlstr = "DELETE FROM et_collateral where dealname = %s and updatedate = %s"
cursor.execute(sqlstr, (dealname, updatedate))
conn.commit()
@@ -133,10 +133,10 @@ def upload_data(dealnames, workdate, conn, cursor):
try:
cursor.execute(sqlstr, (dealname, updatedate) + tuple(row))
except psycopg2.DataError as detail:
- print detail
+ print(detail)
pdb.set_trace()
except psycopg2.IntegrityError as detail:
- print detail
+ print(detail)
# crazy hack intex unique id is not really unique
conn.rollback()
# make sure the loan name is unique by tagging it
@@ -159,4 +159,4 @@ if __name__ == "__main__":
upload_data(dealnames, workdate, common.conn, common.cursor)
common.cursor.close()
common.conn.close()
- print "done"
+ print("done")