add variable at top of file to control whether actions are saved

or not and commented out timing debug statement
This commit is contained in:
sqlcoder 2008-12-14 02:38:09 +00:00
parent d4e03424bf
commit fb6b8e5a5b

View File

@ -22,6 +22,11 @@ from time import time
import fpdb_simple import fpdb_simple
saveActions=False # set this to False to avoid storing action data
# Pros: speeds up imports
# Cons: no action data is saved, need to keep the hand histories
# variance not available on stats page
#stores a stud/razz hand into the database #stores a stud/razz hand into the database
def ring_stud(backend, db, cursor, base, category, site_hand_no, gametype_id, hand_start_time def ring_stud(backend, db, cursor, base, category, site_hand_no, gametype_id, hand_start_time
,names, player_ids, start_cashes, antes, card_values, card_suits, winnings, rakes ,names, player_ids, start_cashes, antes, card_values, card_suits, winnings, rakes
@ -39,6 +44,7 @@ def ring_stud(backend, db, cursor, base, category, site_hand_no, gametype_id, ha
fpdb_simple.storeHudCache(cursor, base, category, gametype_id, player_ids, hudImportData) fpdb_simple.storeHudCache(cursor, base, category, gametype_id, player_ids, hudImportData)
if saveActions:
fpdb_simple.storeActions(cursor, hands_players_ids, action_types fpdb_simple.storeActions(cursor, hands_players_ids, action_types
,allIns, action_amounts, actionNos) ,allIns, action_amounts, actionNos)
return hands_id return hands_id
@ -66,10 +72,10 @@ def ring_holdem_omaha(backend, db, cursor, base, category, site_hand_no, gametyp
t5 = time() t5 = time()
fpdb_simple.store_board_cards(cursor, hands_id, board_values, board_suits) fpdb_simple.store_board_cards(cursor, hands_id, board_values, board_suits)
t6 = time() t6 = time()
if saveActions:
fpdb_simple.storeActions(cursor, hands_players_ids, action_types, allIns, action_amounts, actionNos) fpdb_simple.storeActions(cursor, hands_players_ids, action_types, allIns, action_amounts, actionNos)
t7 = time() t7 = time()
print "cards=%4.3f board=%4.3f hands=%4.3f plyrs=%4.3f hudcache=%4.3f board=%4.3f actions=%4.3f" \ #print "fills=(%4.3f) saves=(%4.3f,%4.3f,%4.3f,%4.3f)" % (t2-t0, t3-t2, t4-t3, t5-t4, t6-t5)
% (t1-t0, t2-t1, t3-t2, t4-t3, t5-t4, t6-t5, t7-t6)
return hands_id return hands_id
#end def ring_holdem_omaha #end def ring_holdem_omaha
@ -98,6 +104,7 @@ def tourney_holdem_omaha(backend, db, cursor, base, category, siteTourneyNo, buy
fpdb_simple.store_board_cards(cursor, hands_id, board_values, board_suits) fpdb_simple.store_board_cards(cursor, hands_id, board_values, board_suits)
if saveActions:
fpdb_simple.storeActions(cursor, hands_players_ids, action_types, allIns, action_amounts, actionNos) fpdb_simple.storeActions(cursor, hands_players_ids, action_types, allIns, action_amounts, actionNos)
return hands_id return hands_id
#end def tourney_holdem_omaha #end def tourney_holdem_omaha
@ -122,6 +129,7 @@ def tourney_stud(backend, db, cursor, base, category, siteTourneyNo, buyin, fee,
fpdb_simple.storeHudCache(cursor, base, category, gametypeId, playerIds, hudImportData) fpdb_simple.storeHudCache(cursor, base, category, gametypeId, playerIds, hudImportData)
if saveActions:
fpdb_simple.storeActions(cursor, hands_players_ids, actionTypes, allIns, actionAmounts, actionNos) fpdb_simple.storeActions(cursor, hands_players_ids, actionTypes, allIns, actionAmounts, actionNos)
return hands_id return hands_id
#end def tourney_stud #end def tourney_stud