From e387593967a26dbfb1242b0b95fd6b879ef662ef Mon Sep 17 00:00:00 2001 From: Worros Date: Wed, 16 Feb 2011 15:10:48 +0800 Subject: [PATCH] Stars: Fix accounting error in single draw games. There is no indicator between 'streets' in single draw games on Stars. Patch adds a new regex for single draw games to detect the draw and divide streets. --- pyfpdb/PokerStarsToFpdb.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pyfpdb/PokerStarsToFpdb.py b/pyfpdb/PokerStarsToFpdb.py index fdb6ca22..67d8c433 100644 --- a/pyfpdb/PokerStarsToFpdb.py +++ b/pyfpdb/PokerStarsToFpdb.py @@ -338,7 +338,14 @@ class PokerStars(HandHistoryConverter): r"(\*\*\* 6th STREET \*\*\*(?P.+(?=\*\*\* RIVER \*\*\*)|.+))?" r"(\*\*\* RIVER \*\*\*(?P.+))?", hand.handText,re.DOTALL) elif hand.gametype['base'] in ("draw"): - m = re.search(r"(?P.+(?=\*\*\* DEALING HANDS \*\*\*)|.+)" + if hand.gametype['category'] in ('27_1draw', 'fivedraw'): + # There is no marker between deal and draw in Stars single draw games + # This unfortunately affects the accounting. + m = re.search(r"(?P.+(?=\*\*\* DEALING HANDS \*\*\*)|.+)" + r"(\*\*\* DEALING HANDS \*\*\*(?P.+(?=(: stands pat on|: discards))|.+))?" + r"((: stands pat on|: discards)(?P.+))?", hand.handText,re.DOTALL) + else: + m = re.search(r"(?P.+(?=\*\*\* DEALING HANDS \*\*\*)|.+)" r"(\*\*\* DEALING HANDS \*\*\*(?P.+(?=\*\*\* FIRST DRAW \*\*\*)|.+))?" r"(\*\*\* FIRST DRAW \*\*\*(?P.+(?=\*\*\* SECOND DRAW \*\*\*)|.+))?" r"(\*\*\* SECOND DRAW \*\*\*(?P.+(?=\*\*\* THIRD DRAW \*\*\*)|.+))?"