From 34e7fb0459232bea8d8206fabb0af7f75111896e Mon Sep 17 00:00:00 2001 From: Worros Date: Mon, 23 Nov 2009 00:20:51 +0800 Subject: [PATCH] [NEWIMPORT] Fix HandsPlayers.cardX init --- pyfpdb/Database.py | 12 ++++++++---- pyfpdb/DerivedStats.py | 14 ++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 040b1417..dbd7afe1 100755 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1389,6 +1389,9 @@ class Database: pdata[p]['card2'], pdata[p]['card3'], pdata[p]['card4'], + pdata[p]['card5'], + pdata[p]['card6'], + pdata[p]['card7'], pdata[p]['winnings'], pdata[p]['street0VPI'], pdata[p]['street1Seen'], @@ -1411,6 +1414,9 @@ class Database: card2, card3, card4, + card5, + card6, + card7, winnings, street0VPI, street1Seen, @@ -1424,7 +1430,8 @@ class Database: street4Aggr ) VALUES ( - %s, %s, %s, %s, + %s, %s, + %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s @@ -1432,9 +1439,6 @@ class Database: # position, # tourneyTypeId, -# card5, -# card6, -# card7, # startCards, # rake, # totalProfit, diff --git a/pyfpdb/DerivedStats.py b/pyfpdb/DerivedStats.py index c8dcfef8..e4d59336 100644 --- a/pyfpdb/DerivedStats.py +++ b/pyfpdb/DerivedStats.py @@ -117,8 +117,10 @@ class DerivedStats(): self.aggr(self.hand, i) default_holecards = ["Xx", "Xx", "Xx", "Xx"] + for street in hand.holeStreets: for player in hand.players: + for i in range(1,8): self.handsplayers[player[1]]['card%d' % i] = 0 if player[1] in hand.holecards[street].keys(): self.handsplayers[player[1]]['card1'] = Card.encodeCard(hand.holecards[street][player[1]][1][0]) self.handsplayers[player[1]]['card2'] = Card.encodeCard(hand.holecards[street][player[1]][1][1]) @@ -126,16 +128,8 @@ class DerivedStats(): self.handsplayers[player[1]]['card3'] = Card.encodeCard(hand.holecards[street][player[1]][1][2]) self.handsplayers[player[1]]['card4'] = Card.encodeCard(hand.holecards[street][player[1]][1][3]) except IndexError: - self.handsplayers[player[1]]['card3'] = 0 - self.handsplayers[player[1]]['card4'] = 0 - #print "DEBUG: hand.holecards[%s][%s][0]: %s" % (street, player[1], hand.holecards[street][player[1]][1]) - else: - #print "DEBUG: player doesn't exist, setting card1-4 to 0" - self.handsplayers[player[1]]['card1'] = 0 - self.handsplayers[player[1]]['card2'] = 0 - self.handsplayers[player[1]]['card3'] = 0 - self.handsplayers[player[1]]['card4'] = 0 - + # Just means no player cards for that street/game - continue + pass def assembleHudCache(self, hand): pass