From 3b04c1baacc24ff7484d7c1cdb73dec923f9d6df Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 23 Mar 2009 22:50:54 -0400 Subject: [PATCH 1/3] Fix bug in accessing mucked cards in stud games. --- pyfpdb/HUD_main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyfpdb/HUD_main.py b/pyfpdb/HUD_main.py index 81e8700a..bfa62529 100755 --- a/pyfpdb/HUD_main.py +++ b/pyfpdb/HUD_main.py @@ -153,7 +153,8 @@ class HUD_main(object): stat_dict = self.db_connection.get_stats_from_hand(new_hand_id) cards = self.db_connection.get_cards(new_hand_id) comm_cards = self.db_connection.get_common_cards(new_hand_id) - cards['common'] = comm_cards['common'] + if comm_cards != {}: # stud! + cards['common'] = comm_cards['common'] except Exception, err: print "db error: skipping ", new_hand_id, err sys.stderr.write("Database error %s in hand %d. Skipping.\n" % (err, int(new_hand_id))) From aebbae8ed0f859a427c0f83cfd21659349ff517b Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 23 Mar 2009 22:58:13 -0400 Subject: [PATCH 2/3] Change str 0 to int 0 in card translating. --- pyfpdb/fpdb_simple.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfpdb/fpdb_simple.py b/pyfpdb/fpdb_simple.py index 27ce23da..4f5fb4d1 100644 --- a/pyfpdb/fpdb_simple.py +++ b/pyfpdb/fpdb_simple.py @@ -514,7 +514,7 @@ def convertCardValues(arr): #end def convertCardValues # a 0-card is one in a stud game that we did not see or was not shown -card_map = { "0": 0, "2": 2, "3" : 3, "4" : 4, "5" : 5, "6" : 6, "7" : 7, "8" : 8, "9" : 9, "T" : 10, "J" : 11, "Q" : 12, "K" : 13, "A" : 14} +card_map = { 0: 0, "2": 2, "3" : 3, "4" : 4, "5" : 5, "6" : 6, "7" : 7, "8" : 8, "9" : 9, "T" : 10, "J" : 11, "Q" : 12, "K" : 13, "A" : 14} #converts the strings in the given array to ints (changes the passed array, no returning). see table design for conversion details def convertCardValuesBoard(arr): From 60ffb0896e4a2ca0cbfa26b2762182f7aff9c80f Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 24 Mar 2009 11:23:33 -0400 Subject: [PATCH 3/3] Make isWinLine find low pots. --- pyfpdb/fpdb_simple.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyfpdb/fpdb_simple.py b/pyfpdb/fpdb_simple.py index 27b03dae..057e4f86 100644 --- a/pyfpdb/fpdb_simple.py +++ b/pyfpdb/fpdb_simple.py @@ -788,6 +788,7 @@ def isTourney(topline): #end def isTourney WinLines = ( "wins the pot", "ties for the ", "wins side pot", "wins the low main pot", "wins the high main pot", + "wins the low", "wins the high pot", "wins the high side pot", "wins the main pot", "wins the side pot", "collected" ) #returns boolean whether the passed line is a win line def isWinLine(line):