From 5eeafc4503acc84498f72154b8f0117431203590 Mon Sep 17 00:00:00 2001 From: Chaz Littlejohn Date: Thu, 24 Mar 2011 04:08:08 +0000 Subject: [PATCH] Added regex & methods for picking up the 'discards' and 'stands pat' actions in FTP draw hands --- pyfpdb/FulltiltToFpdb.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pyfpdb/FulltiltToFpdb.py b/pyfpdb/FulltiltToFpdb.py index 956e362a..c6775e92 100755 --- a/pyfpdb/FulltiltToFpdb.py +++ b/pyfpdb/FulltiltToFpdb.py @@ -172,7 +172,10 @@ class Fulltilt(HandHistoryConverter): self.re_BringIn = re.compile(r"^%(PLAYERS)s brings in for [%(LS)s]?(?P[%(NUM)s]+)" % self.substitutions, re.MULTILINE) self.re_PostBoth = re.compile(r"^%(PLAYERS)s posts small \& big blinds \[[%(LS)s]? (?P[%(NUM)s]+)" % self.substitutions, re.MULTILINE) self.re_HeroCards = re.compile(r"^Dealt to %s(?: \[(?P.+?)\])?( \[(?P.+?)\])" % player_re, re.MULTILINE) - self.re_Action = re.compile(r"^%(PLAYERS)s(?P bets| checks| raises to| completes it to| calls| folds)( [%(LS)s]?(?P[%(NUM)s]+))?" % self.substitutions, re.MULTILINE) + self.re_Action = re.compile(r""" + ^%(PLAYERS)s(?P bets| checks| raises to| completes it to| calls| folds| discards| stands pat) + ( [%(LS)s]?(?P[%(NUM)s]+))? + (\scards?(\s\[(?P.+?)\])?)?""" % self.substitutions, re.MULTILINE) self.re_ShowdownAction = re.compile(r"^%s shows \[(?P.*)\]" % player_re, re.MULTILINE) self.re_CollectPot = re.compile(r"^Seat (?P[0-9]+): %(PLAYERS)s (\(button\) |\(small blind\) |\(big blind\) )?(collected|showed \[.*\] and won) \([%(LS)s]?(?P[%(NUM)s]+)\)(, mucked| with.*)?" % self.substitutions, re.MULTILINE) self.re_SitsOut = re.compile(r"^%s sits out" % player_re, re.MULTILINE) @@ -483,6 +486,10 @@ class Fulltilt(HandHistoryConverter): hand.addFold( street, action.group('PNAME')) elif action.group('ATYPE') == ' checks': hand.addCheck( street, action.group('PNAME')) + elif action.group('ATYPE') == ' discards': + hand.addDiscard(street, action.group('PNAME'), action.group('BET'), action.group('DISCARDED')) + elif action.group('ATYPE') == ' stands pat': + hand.addStandsPat( street, action.group('PNAME')) else: print _("FullTilt: DEBUG: unimplemented readAction: '%s' '%s'") %(action.group('PNAME'),action.group('ATYPE'),)