From 167c0de3b5a3a14d342fa1f49f7f5666c2a601f8 Mon Sep 17 00:00:00 2001 From: sqlcoder Date: Sat, 13 Dec 2008 02:02:07 +0000 Subject: [PATCH] include antes in hudcache totalProfit figure --- pyfpdb/fpdb_parse_logic.py | 6 +++--- pyfpdb/fpdb_simple.py | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pyfpdb/fpdb_parse_logic.py b/pyfpdb/fpdb_parse_logic.py index a345dc93..d30a7b3f 100644 --- a/pyfpdb/fpdb_parse_logic.py +++ b/pyfpdb/fpdb_parse_logic.py @@ -135,11 +135,11 @@ def mainParser(backend, db, cursor, site, category, hand): if base=="hold": hudImportData=fpdb_simple.generateHudCacheData(playerIDs, base, category, actionTypes , allIns, actionTypeByNo, winnings, totalWinnings, positions - , actionTypes, actionAmounts) + , actionTypes, actionAmounts, None) else: hudImportData=fpdb_simple.generateHudCacheData(playerIDs, base, category, actionTypes , allIns, actionTypeByNo, winnings, totalWinnings, None - , actionTypes, actionAmounts) + , actionTypes, actionAmounts, antes) if isTourney: ranks=[] @@ -185,7 +185,7 @@ def mainParser(backend, db, cursor, site, category, hand): , seatNos) else: raise fpdb_simple.FpdbError ("unrecognised category") - db.commit() + db.commit() return result #end def mainParser diff --git a/pyfpdb/fpdb_simple.py b/pyfpdb/fpdb_simple.py index dd7d56e8..e03666fc 100755 --- a/pyfpdb/fpdb_simple.py +++ b/pyfpdb/fpdb_simple.py @@ -1426,7 +1426,7 @@ VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, #end def store_hands_players_stud_tourney def generateHudCacheData(player_ids, base, category, action_types, allIns, actionTypeByNo - ,winnings, totalWinnings, positions, actionTypes, actionAmounts): + ,winnings, totalWinnings, positions, actionTypes, actionAmounts, antes): """calculates data for the HUD during import. IMPORTANT: if you change this method make sure to also change the following storage method and table_viewer.prepare_data if necessary """ @@ -1953,7 +1953,9 @@ sure to also change the following storage method and table_viewer.prepare_data i #print "b4 totprof calc, len(playerIds)=", len(player_ids) for pl in range (len(player_ids)): #print "pl=", pl - myTotalProfit=winnings[pl] # still need to deduct costs + myTotalProfit=winnings[pl] # still need to deduct other costs + if antes: + myTotalProfit=winnings[pl] - antes[pl] for i in range (len(actionTypes)): #iterate through streets #for j in range (len(actionTypes[i])): #iterate through names (using pl loop above) for k in range (len(actionTypes[i][pl])): #iterate through individual actions of that player on that street