From aae1ad082e3e9d9770ef95914d10ab9c895fa6b7 Mon Sep 17 00:00:00 2001 From: Worros Date: Wed, 15 Sep 2010 13:25:44 +0800 Subject: [PATCH] OnGame: add dead blind detection --- pyfpdb/OnGameToFpdb.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyfpdb/OnGameToFpdb.py b/pyfpdb/OnGameToFpdb.py index 22f283d2..62eb2d96 100755 --- a/pyfpdb/OnGameToFpdb.py +++ b/pyfpdb/OnGameToFpdb.py @@ -139,7 +139,8 @@ class OnGame(HandHistoryConverter): self.re_PostBB = re.compile('(?P.*) posts big blind \((%(CUR)s)?(?P[\.0-9]+)\)' % subst, re.MULTILINE) self.re_Antes = re.compile(r"^%(PLYR)s: posts the ante (%(CUR)s)?(?P[\.0-9]+)" % subst, re.MULTILINE) self.re_BringIn = re.compile(r"^%(PLYR)s: brings[- ]in( low|) for (%(CUR)s)?(?P[\.0-9]+)" % subst, re.MULTILINE) - self.re_PostBoth = re.compile('(?P.*): posts small \& big blinds \( (%(CUR)s)?(?P[\.0-9]+)\)' % subst) + self.re_PostBoth = re.compile('(?P.*): posts small \& big blind \( (%(CUR)s)?(?P[\.0-9]+)\)' % subst) + self.re_PostDead = re.compile('(?P.*) posts dead blind \((%(CUR)s)?(?P[\.0-9]+)\)' % subst, re.MULTILINE) self.re_HeroCards = re.compile('Dealing\sto\s%(PLYR)s:\s\[(?P.*)\]' % subst) #lopllopl checks, Eurolll checks, .Lucchess checks. @@ -286,7 +287,6 @@ class OnGame(HandHistoryConverter): hand.setCommunityCards(street, m.group('CARDS').split(', ')) def readBlinds(self, hand): - #log.debug( _("readBlinds starting, hand=") + "\n["+hand.handText+"]" ) try: m = self.re_PostSB.search(hand.handText) hand.addBlind(m.group('PNAME'), 'small blind', m.group('SB')) @@ -295,6 +295,9 @@ class OnGame(HandHistoryConverter): #hand.addBlind(None, None, None) for a in self.re_PostBB.finditer(hand.handText): hand.addBlind(a.group('PNAME'), 'big blind', a.group('BB')) + for a in self.re_PostDead.finditer(hand.handText): + #print "DEBUG: Found dead blind: addBlind(%s, 'secondsb', %s)" %(a.group('PNAME'), a.group('DEAD')) + hand.addBlind(a.group('PNAME'), 'secondsb', a.group('DEAD')) for a in self.re_PostBoth.finditer(hand.handText): hand.addBlind(a.group('PNAME'), 'small & big blinds', a.group('SBBB'))