From 6272c057b93fadf675159414e31d4db7ea0739b4 Mon Sep 17 00:00:00 2001 From: Gerko de Roo Date: Thu, 18 Feb 2010 22:12:01 +0100 Subject: [PATCH] Pokerstar Big and Small blind for limit games now derived form lookup table. This also needs to be done for PokerStars, don't know for the other sites.... --- pyfpdb/Hand.py | 11 +++++------ pyfpdb/PokerStarsToFpdb.py | 30 ++++++++++++++++++++---------- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index 262ac4ad..b740a341 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -344,15 +344,14 @@ For sites (currently only Carbon Poker) which record "all in" as a special actio if blindtype == 'both': # work with the real ammount. limit games are listed as $1, $2, where # the SB 0.50 and the BB is $1, after the turn the minimum bet amount is $2.... - amount = Decimal(amount)/3 - self.bets['BLINDSANTES'][player].append(amount) - self.pot.addCommonMoney(player, amount) - amount += amount + amount = self.bb + self.bets['BLINDSANTES'][player].append(Decimal(self.sb)) + self.pot.addCommonMoney(player, Decimal(self.sb)) if blindtype == 'secondsb': amount = Decimal(0) self.bets['BLINDSANTES'][player].append(Decimal(self.sb)) - self.pot.addCommonMoney(Decimal(self.sb)) + self.pot.addCommonMoney(player, Decimal(self.sb)) self.bets['PREFLOP'][player].append(Decimal(amount)) self.pot.addMoney(player, Decimal(amount)) @@ -1450,7 +1449,7 @@ class Pot(object): # Return any uncalled bet. committed = sorted([ (v,k) for (k,v) in self.committed.items()]) - print "DEBUG: committed: %s" % committed + #print "DEBUG: committed: %s" % committed #ERROR below. lastbet is correct in most cases, but wrong when # additional money is committed to the pot in cash games # due to an additional sb being posted. (Speculate that diff --git a/pyfpdb/PokerStarsToFpdb.py b/pyfpdb/PokerStarsToFpdb.py index 87574e9d..8c222e12 100644 --- a/pyfpdb/PokerStarsToFpdb.py +++ b/pyfpdb/PokerStarsToFpdb.py @@ -140,6 +140,14 @@ class PokerStars(HandHistoryConverter): mg = m.groupdict() # translations from captured groups to fpdb info strings + Lim_Blinds = { '0.04': ('0.01', '0.02'), '0.10': ('0.02', '0.05'), '0.20': ('0.05', '0.10'), + '0.50': ('0.10', '0.25'), '1.00': ('0.25', '0.50'), '2.00': ('0.50', '1.00'), + '4.00': ('1.00', '2.00'), '6.00': ('1.00', '3.00'), '10.00': ('2.00', '5.00'), + '20.00': ('5.00', '10.00'), '30.00': ('10.00', '15.00'), '60.00': ('15.00', '30.00'), + '100.00': ('25.00', '50.00'),'200.00': ('50.00', '100.00'),'400.00': ('100.00', '200.00'), + '1000.00': ('250.00', '500.00')} + + limits = { 'No Limit':'nl', 'Pot Limit':'pl', 'Limit':'fl' } games = { # base, category "Hold'em" : ('hold','holdem'), @@ -173,6 +181,10 @@ class PokerStars(HandHistoryConverter): else: info['type'] = 'tour' + if info['limitType'] == 'fl' and info['bb'] != None: + info['sb'] = Lim_Blinds[mg['BB']][0] + info['bb'] = Lim_Blinds[mg['BB']][1] + # NB: SB, BB must be interpreted as blinds or bets depending on limit type. return info @@ -287,16 +299,14 @@ class PokerStars(HandHistoryConverter): hand.addBringIn(m.group('PNAME'), m.group('BRINGIN')) def readBlinds(self, hand): - try: - count = 0 - for a in self.re_PostSB.finditer(hand.handText): - if count == 0: - hand.addBlind(a.group('PNAME'), 'small blind', a.group('SB')) - count = 1 - else: - hand.addBlind(a.group('PNAME'), 'secondsb', a.group('SB')) - except: # no small blind - hand.addBlind(None, None, None) + liveBlind = True + for a in self.re_PostSB.finditer(hand.handText): + if liveBlind: + hand.addBlind(a.group('PNAME'), 'small blind', a.group('SB')) + liveBlind = False + else: + # Post dead blinds as ante + hand.addBlind(a.group('PNAME'), 'secondsb', a.group('SB')) for a in self.re_PostBB.finditer(hand.handText): hand.addBlind(a.group('PNAME'), 'big blind', a.group('BB')) for a in self.re_PostBoth.finditer(hand.handText):