From e9853c1ff23b88514bb5126928697b0e12c7674d Mon Sep 17 00:00:00 2001 From: Worros Date: Sun, 22 Mar 2009 04:07:08 +0900 Subject: [PATCH 1/2] Make previous executemany() function the default --- pyfpdb/fpdb_simple.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pyfpdb/fpdb_simple.py b/pyfpdb/fpdb_simple.py index 7f241a2c..aa876804 100644 --- a/pyfpdb/fpdb_simple.py +++ b/pyfpdb/fpdb_simple.py @@ -29,7 +29,6 @@ MYSQL_INNODB = 2 PGSQL = 3 SQLITE = 4 -DBTEST = False # Data Structures for index and foreign key creation # drop_code is an int with possible values: 0 - don't drop for bulk import @@ -1517,14 +1516,10 @@ def storeActions(cursor, handsPlayersIds, actionTypes, allIns, actionAmounts, ac for i in xrange(len(actionTypes)): #iterate through streets for j in xrange(len(actionTypes[i])): #iterate through names for k in xrange(len(actionTypes[i][j])): #iterate through individual actions of that player on that street - if DBTEST == False: - cursor.execute("INSERT INTO HandsActions (handPlayerId, street, actionNo, action, allIn, amount) VALUES (%s, %s, %s, %s, %s, %s)", (handsPlayersIds[j], i, actionNos[i][j][k], actionTypes[i][j][k], allIns[i][j][k], actionAmounts[i][j][k])) - else: - # Add inserts into a list and let - inserts = inserts + [(handsPlayersIds[j], i, actionNos[i][j][k], actionTypes[i][j][k], allIns[i][j][k], actionAmounts[i][j][k])] + # Add inserts into a list and let + inserts = inserts + [(handsPlayersIds[j], i, actionNos[i][j][k], actionTypes[i][j][k], allIns[i][j][k], actionAmounts[i][j][k])] - if DBTEST == True: - cursor.executemany("INSERT INTO HandsActions (handPlayerId, street, actionNo, action, allIn, amount) VALUES (%s, %s, %s, %s, %s, %s)", inserts) + cursor.executemany("INSERT INTO HandsActions (handPlayerId, street, actionNo, action, allIn, amount) VALUES (%s, %s, %s, %s, %s, %s)", inserts) #end def storeActions def store_board_cards(cursor, hands_id, board_values, board_suits): From 40c17cffaa082396735cd1b930fa6aa23bf3f2df Mon Sep 17 00:00:00 2001 From: Worros Date: Sun, 22 Mar 2009 18:52:30 +0900 Subject: [PATCH 2/2] Recognise deep 6 tables at Full Tilt --- pyfpdb/FulltiltToFpdb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyfpdb/FulltiltToFpdb.py b/pyfpdb/FulltiltToFpdb.py index b5f0cc4e..6a897bad 100755 --- a/pyfpdb/FulltiltToFpdb.py +++ b/pyfpdb/FulltiltToFpdb.py @@ -124,8 +124,8 @@ follow : whether to tail -f the input""" hand.starttime = time.strptime(m.group('DATETIME'), "%H:%M:%S ET - %Y/%m/%d") hand.maxseats = 8 # assume 8-max until we see otherwise if m.group('TABLEATTRIBUTES'): - m2 = re.search("(\d+) max", m.group('TABLEATTRIBUTES')) - hand.maxseats = int(m2.group(1)) + m2 = re.search("(deep )?(\d+)( max)?", m.group('TABLEATTRIBUTES')) + hand.maxseats = int(m2.group(2)) # These work, but the info is already in the Hand class - should be used for tourneys though. # m.group('SB') # m.group('BB')