Merge branch 'master' of git://git.assembla.com/fpdboz
This commit is contained in:
commit
411715c44d
|
@ -28,7 +28,7 @@ SQLITE = 4
|
||||||
|
|
||||||
fastStoreHudCache = True # set this to True to test the new storeHudCache routine
|
fastStoreHudCache = True # set this to True to test the new storeHudCache routine
|
||||||
|
|
||||||
saveActions = False # set this to False to avoid storing action data
|
saveActions = True # set this to False to avoid storing action data
|
||||||
# Pros: speeds up imports
|
# Pros: speeds up imports
|
||||||
# Cons: no action data is saved, so you need to keep the hand histories
|
# Cons: no action data is saved, so you need to keep the hand histories
|
||||||
# variance not available on stats page
|
# variance not available on stats page
|
||||||
|
@ -70,8 +70,10 @@ def ring_holdem_omaha(config, backend, db, cursor, base, category, site_hand_no,
|
||||||
"""stores a holdem/omaha hand into the database"""
|
"""stores a holdem/omaha hand into the database"""
|
||||||
|
|
||||||
import_options = config.get_import_parameters()
|
import_options = config.get_import_parameters()
|
||||||
saveActions = True if import_options['saveActions'] == 'True' else False
|
saveActions = False if import_options['saveActions'] == 'False' else True
|
||||||
fastStoreHudCache = True if import_options['fastStoreHudCache'] == 'True' else False
|
fastStoreHudCache = False if import_options['fastStoreHudCache'] == 'False' else True
|
||||||
|
|
||||||
|
# print "DEBUG: saveActions = '%s' fastStoreHudCache = '%s'"%(saveActions, fastStoreHudCache)
|
||||||
|
|
||||||
t0 = time()
|
t0 = time()
|
||||||
fpdb_simple.fillCardArrays(len(names), base, category, card_values, card_suits)
|
fpdb_simple.fillCardArrays(len(names), base, category, card_values, card_suits)
|
||||||
|
|
|
@ -29,6 +29,8 @@ MYSQL_INNODB = 2
|
||||||
PGSQL = 3
|
PGSQL = 3
|
||||||
SQLITE = 4
|
SQLITE = 4
|
||||||
|
|
||||||
|
DBTEST = False
|
||||||
|
|
||||||
# Data Structures for index and foreign key creation
|
# Data Structures for index and foreign key creation
|
||||||
# drop_code is an int with possible values: 0 - don't drop for bulk import
|
# drop_code is an int with possible values: 0 - don't drop for bulk import
|
||||||
# 1 - drop during bulk import
|
# 1 - drop during bulk import
|
||||||
|
@ -1512,11 +1514,18 @@ def storeActions(cursor, handsPlayersIds, actionTypes, allIns, actionAmounts, ac
|
||||||
#stores into table hands_actions
|
#stores into table hands_actions
|
||||||
#print "start of storeActions, actionNos:",actionNos
|
#print "start of storeActions, actionNos:",actionNos
|
||||||
#print " action_amounts:",action_amounts
|
#print " action_amounts:",action_amounts
|
||||||
|
inserts = []
|
||||||
for i in xrange(len(actionTypes)): #iterate through streets
|
for i in xrange(len(actionTypes)): #iterate through streets
|
||||||
for j in xrange(len(actionTypes[i])): #iterate through names
|
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
|
for k in xrange(len(actionTypes[i][j])): #iterate through individual actions of that player on that street
|
||||||
cursor.execute ("INSERT INTO HandsActions (handPlayerId, street, actionNo, action, allIn, amount) VALUES (%s, %s, %s, %s, %s, %s)"
|
if DBTEST == False:
|
||||||
, (handsPlayersIds[j], i, actionNos[i][j][k], actionTypes[i][j][k], allIns[i][j][k], actionAmounts[i][j][k]))
|
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])]
|
||||||
|
|
||||||
|
if DBTEST == True:
|
||||||
|
cursor.executemany("INSERT INTO HandsActions (handPlayerId, street, actionNo, action, allIn, amount) VALUES (%s, %s, %s, %s, %s, %s)", inserts)
|
||||||
#end def storeActions
|
#end def storeActions
|
||||||
|
|
||||||
def store_board_cards(cursor, hands_id, board_values, board_suits):
|
def store_board_cards(cursor, hands_id, board_values, board_suits):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user