From a35b1a8b3c48924fc1141a4f39a9bed26b1b1caf Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 4 Jul 2009 15:19:46 -0400 Subject: [PATCH] Make WriteHand for stud report mucked hand. --- pyfpdb/Hand.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index 237b609a..bf2b1ab2 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -1042,7 +1042,7 @@ dealt whether they were seen in a 'dealt to' line if len(cards) > 2: self.holecards['THIRD'][player] = (cards[0:3], None) if len(cards) > 6: - self.holecards['SEVENTH'][player] = (cards[6], None) + self.holecards['SEVENTH'][player] = ([cards[6]], None) # TODO: def addComplete(self, player, amount): def addComplete(self, street, player, amountTo): @@ -1212,11 +1212,13 @@ Add a complete on [street] by [player] to [amountTo] seatnum = player[0] name = player[1] if name in self.collectees and name in self.shown: - print >>fh, _("Seat %d: %s showed [%s] and won ($%s)" % (seatnum, name, " ".join(self.holecards[name]), self.collectees[name])) + print >>fh, _("Seat %d: %s showed [%s] and won ($%s)" % (seatnum, name, self.join_holecards(name), self.collectees[name])) elif name in self.collectees: print >>fh, _("Seat %d: %s collected ($%s)" % (seatnum, name, self.collectees[name])) elif name in self.shown: - print >>fh, _("Seat %d: %s showed [%s]" % (seatnum, name, " ".join(self.holecards[name]))) + print >>fh, _("Seat %d: %s showed [%s]" % (seatnum, name, self.join_holecards(name))) + elif name in self.mucked: + print >>fh, _("Seat %d: %s mucked [%s]" % (seatnum, name, self.join_holecards(name))) elif name in self.folded: print >>fh, _("Seat %d: %s folded" % (seatnum, name)) else: @@ -1225,6 +1227,12 @@ Add a complete on [street] by [player] to [amountTo] print >>fh, "\n\n" + def join_holecards(self, player): + holecards = [] + for street in self.holeStreets: + if self.holecards[street].has_key(player): + holecards = holecards + self.holecards[street][player][0] + return " ".join(holecards) class Pot(object):