From e1bb9a602bdd8a9825e0dc9ef5ec832f5bb12121 Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 9 Sep 2010 13:19:19 +0800 Subject: [PATCH] Stars/Hand: Fix issue produced by last regression test file 7-Stud-USD-0.04-0.08-200907.Missing.Showdown.Card.txt only contains 6 showdown cards. Put filthy hack in addShownCards to guard against this condition, and add a commented out debug print in the HHC --- pyfpdb/Hand.py | 3 ++- pyfpdb/PokerStarsToFpdb.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index 9f9d009d..c1dec3ff 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -1224,7 +1224,8 @@ class StudHand(Hand): self.addHoleCards('FOURTH', player, open=[cards[3]], closed=[cards[2]], shown=shown, mucked=mucked) self.addHoleCards('FIFTH', player, open=[cards[4]], closed=cards[2:4], shown=shown, mucked=mucked) self.addHoleCards('SIXTH', player, open=[cards[5]], closed=cards[2:5], shown=shown, mucked=mucked) - self.addHoleCards('SEVENTH', player, open=[], closed=[cards[6]], shown=shown, mucked=mucked) + if len(cards) > 6: + self.addHoleCards('SEVENTH', player, open=[], closed=[cards[6]], shown=shown, mucked=mucked) def addPlayerCards(self, player, street, open=[], closed=[]): diff --git a/pyfpdb/PokerStarsToFpdb.py b/pyfpdb/PokerStarsToFpdb.py index bac45faf..baa7718b 100644 --- a/pyfpdb/PokerStarsToFpdb.py +++ b/pyfpdb/PokerStarsToFpdb.py @@ -454,6 +454,7 @@ class PokerStars(HandHistoryConverter): if m.group('SHOWED') == "showed": shown = True elif m.group('SHOWED') == "mucked": mucked = True + #print "DEBUG: hand.addShownCards(%s, %s, %s, %s)" %(cards, m.group('PNAME'), shown, mucked) hand.addShownCards(cards=cards, player=m.group('PNAME'), shown=shown, mucked=mucked) if __name__ == "__main__":