From 22ff84852bf1794b7e86abaadcf165162ebc041d Mon Sep 17 00:00:00 2001 From: Worros Date: Sun, 15 Mar 2009 00:30:38 +0900 Subject: [PATCH 01/16] Kludge maxseats for Stars --- pyfpdb/PokerStarsToFpdb.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyfpdb/PokerStarsToFpdb.py b/pyfpdb/PokerStarsToFpdb.py index 1915bb42..b7322a1b 100755 --- a/pyfpdb/PokerStarsToFpdb.py +++ b/pyfpdb/PokerStarsToFpdb.py @@ -114,7 +114,12 @@ follow : whether to tail -f the input""" def readHandInfo(self, hand): info = {} m = self.re_HandInfo.search(hand.handText,re.DOTALL) - if m: info.update(m.groupdict()) + if m: + info.update(m.groupdict()) + # TODO: Be less lazy and parse maxseats from the HandInfo regex + if m.group('TABLEATTRIBUTES'): + m2 = re.search("\s*(\d+)-max", m.group('TABLEATTRIBUTES')) + hand.maxseats = int(m2.group(1)) m = self.re_GameInfo.search(hand.handText) if m: info.update(m.groupdict()) m = self.re_Button.search(hand.handText) From 40d98b11d9f8313ae68c5286c2ffbd496c628987 Mon Sep 17 00:00:00 2001 From: Worros Date: Sun, 15 Mar 2009 14:32:52 +0900 Subject: [PATCH 02/16] PokerStarsToFpdb - PLO parsing update --- pyfpdb/PokerStarsToFpdb.py | 8 ++++---- pyfpdb/test_PokerStars.py | 10 ++++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/pyfpdb/PokerStarsToFpdb.py b/pyfpdb/PokerStarsToFpdb.py index b7322a1b..8b905005 100755 --- a/pyfpdb/PokerStarsToFpdb.py +++ b/pyfpdb/PokerStarsToFpdb.py @@ -24,9 +24,9 @@ from HandHistoryConverter import * # PokerStars HH Format class PokerStars(HandHistoryConverter): - + # Static regexes - re_GameInfo = re.compile("PokerStars Game #(?P[0-9]+):\s+(HORSE)? \(?(?PHold\'em|Razz|7 Card Stud|Omaha Hi/Lo|Badugi) (?PNo Limit|Limit|Pot Limit),? \(?(?P\$|)?(?P[.0-9]+)/\$?(?P[.0-9]+)\) - (?P.*$)", re.MULTILINE) + re_GameInfo = re.compile("PokerStars Game #(?P[0-9]+):\s+(HORSE)? \(?(?PHold\'em|Razz|7 Card Stud|Omaha|Omaha Hi/Lo|Badugi) (?PNo Limit|Limit|Pot Limit),? \(?(?P\$|)?(?P[.0-9]+)/\$?(?P[.0-9]+)\) - (?P.*$)", re.MULTILINE) re_SplitHands = re.compile('\n\n+') re_HandInfo = re.compile("^Table \'(?P[- a-zA-Z]+)\'(?P.+?$)?", re.MULTILINE) re_Button = re.compile('Seat #(?P