From 1e0a1a6ad87a31940716ea6132dc9a6c309be05c Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 30 Sep 2010 18:01:47 +0800 Subject: [PATCH] OnGame: Initial Draw support No longer crashes on a Five Card draw hand --- pyfpdb/OnGameToFpdb.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pyfpdb/OnGameToFpdb.py b/pyfpdb/OnGameToFpdb.py index 9158fb05..faf52522 100755 --- a/pyfpdb/OnGameToFpdb.py +++ b/pyfpdb/OnGameToFpdb.py @@ -60,7 +60,7 @@ class OnGame(HandHistoryConverter): 'SEVEN_CARD_STUD_HI_LO' : ('stud','studhilo'), # 'Badugi' : ('draw','badugi'), # 'Triple Draw 2-7 Lowball' : ('draw','27_3draw'), - # '5 Card Draw' : ('draw','fivedraw') + 'FIVE_CARD_DRAW' : ('draw','fivedraw') } # Static regexes @@ -88,7 +88,7 @@ class OnGame(HandHistoryConverter): Table:\s(?P[\'\w\s]+)\s\[\d+\]\s\( ( (?PNO_LIMIT|Limit|LIMIT|Pot\sLimit)\s - (?PTEXAS_HOLDEM|OMAHA_HI|SEVEN_CARD_STUD|SEVEN_CARD_STUD_HI_LO|RAZZ)\s + (?PTEXAS_HOLDEM|OMAHA_HI|SEVEN_CARD_STUD|SEVEN_CARD_STUD_HI_LO|RAZZ|FIVE_CARD_DRAW)\s (%(LS)s)?(?P[.0-9]+)/ (%(LS)s)?(?P[.0-9]+) )? @@ -156,6 +156,7 @@ class OnGame(HandHistoryConverter): ["ring", "hold", "fl"], ["ring", "hold", "nl"], ["ring", "stud", "fl"], + ["ring", "draw", "fl"], ] def determineGameType(self, handText): @@ -251,7 +252,12 @@ class OnGame(HandHistoryConverter): r"(Dealing 5th street(?P.+(?=Dealing 6th street)|.+))?" r"(Dealing 6th street(?P.+(?=Dealing river)|.+))?" r"(Dealing river(?P.+))?", hand.handText,re.DOTALL) - #elif hand.gametype['base'] in ("draw"): + elif hand.gametype['base'] in ("draw"): + m = re.search(r"(?P.+(?=Dealing pocket cards)|.+)" + r"(Dealing pocket cards(?P.+(?=\*\*\* FIRST DRAW \*\*\*)|.+))?" + r"(\*\*\* FIRST DRAW \*\*\*(?P.+(?=\*\*\* SECOND DRAW \*\*\*)|.+))?" + r"(\*\*\* SECOND DRAW \*\*\*(?P.+(?=\*\*\* THIRD DRAW \*\*\*)|.+))?" + r"(\*\*\* THIRD DRAW \*\*\*(?P.+))?", hand.handText,re.DOTALL) hand.addStreets(m)