From 354a67c0e4a2f1b10826b2e9d956ed9a2b2839a0 Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 26 Feb 2009 01:23:46 +0900 Subject: [PATCH] Some bringin code for stud/razz --- pyfpdb/FulltiltToFpdb.py | 1 + pyfpdb/Hand.py | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/pyfpdb/FulltiltToFpdb.py b/pyfpdb/FulltiltToFpdb.py index d46db318..1ad2c330 100755 --- a/pyfpdb/FulltiltToFpdb.py +++ b/pyfpdb/FulltiltToFpdb.py @@ -166,6 +166,7 @@ class FullTilt(HandHistoryConverter): # print hand.string m = self.re_BringIn.search(hand.string,re.DOTALL) print "DEBUG: Player bringing in: %s for %s" %(m.group('PNAME'), m.group('BRINGIN')) + hand.addBringIn(m.group('PNAME'), m.group('BRINGIN')) def readButton(self, hand): hand.buttonpos = int(self.re_Button.search(hand.string).group('BUTTON')) diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index 847d5f34..861808ab 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -221,6 +221,14 @@ Card ranks will be uppercased self.posted = self.posted + [[player,blindtype]] #print "DEBUG: self.posted: %s" %(self.posted) + def addBringIn(self, player, ante): + if player is not None: + self.bets['THIRD'][player].append(Decimal(ante)) + self.stacks[player] -= Decimal(ante) + act = (player, 'bringin', "bringin", ante, self.stacks[player]==0) + self.actions['THIRD'].append(act) + self.pot.addMoney(player, Decimal(ante)) + def addCall(self, street, player=None, amount=None): # Potentially calculate the amount of the call if not supplied @@ -513,6 +521,7 @@ Map the tuple self.gametype onto the pokerstars string describing it if 'THIRD' in self.actions: print >>fh, _("*** 3RD STREET ***") for act in self.actions['THIRD']: + #FIXME: Need some logic here for bringin vs completes self.printActionLine(act, fh) if 'FOURTH' in self.actions: