From 3e0b0e08733e8f7ca170d1b8af886f5176dbc4d8 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 22 Jul 2009 08:54:30 -0400 Subject: [PATCH] Allow parsing of play money tables and fix some typos. --- pyfpdb/FulltiltToFpdb.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pyfpdb/FulltiltToFpdb.py b/pyfpdb/FulltiltToFpdb.py index 3c95df2f..b860fe94 100755 --- a/pyfpdb/FulltiltToFpdb.py +++ b/pyfpdb/FulltiltToFpdb.py @@ -33,17 +33,19 @@ class Fulltilt(HandHistoryConverter): -\s(?P\$|)? (?P[.0-9]+)/ \$?(?P[.0-9]+)\s - (Ante\s\$(?P[.0-9]+)\s)?-\s + (Ante\s\$?(?P[.0-9]+)\s)?-\s (?P(No\sLimit|Pot\sLimit|Limit))?\s - (?P(Hold\'em|Omaha\sHi|Omaha\sH/L|7\sCard\sStud|Stud\sH/L|Razz)) + (?P(Hold\'em|Omaha\sHi|Omaha\sH/L|7\sCard\sStud|Stud\sH/L|Razz|Stud\sHi)) ''', re.VERBOSE) re_SplitHands = re.compile(r"\n\n+") re_TailSplitHands = re.compile(r"(\n\n+)") re_HandInfo = re.compile('''.*\#(?P[0-9]+):\s (?:(?P.+)\s\((?P\d+)\),\s)? - Table\s(?P[-\s\da-zA-Z]+)\s + Table\s + (?PPlay\sChip\s|PC) + (?P
[-\s\da-zA-Z]+)\s (\((?P.+)\)\s)?-\s - \$?(?P[.0-9]+)/\$?(?P[.0-9]+)\s(Ante\s\$(?P[.0-9]+)\s)?-\s + \$?(?P[.0-9]+)/\$?(?P[.0-9]+)\s(Ante\s\$?(?P[.0-9]+)\s)?-\s (?P[a-zA-Z\/\'\s]+)\s-\s (?P.*) ''', re.VERBOSE) @@ -109,7 +111,6 @@ follow : whether to tail -f the input""" m = self.re_GameInfo.search(handText) if not m: return None - mg = m.groupdict() # translations from captured groups to our info strings @@ -119,8 +120,8 @@ follow : whether to tail -f the input""" 'Omaha Hi' : ('hold','omahahi'), 'Omaha H/L' : ('hold','omahahilo'), 'Razz' : ('stud','razz'), - '7 Card Stud' : ('stud','studhi'), - 'Stud H/L' : ('stud', 'studhilo') + 'Stud Hi' : ('stud','studhi'), + 'Stud H/L' : ('stud','studhilo') } currencies = { u' €':'EUR', '$':'USD', '':'T$' } info['limitType'] = limits[mg['LIMIT']] @@ -137,7 +138,7 @@ follow : whether to tail -f the input""" def readHandInfo(self, hand): m = self.re_HandInfo.search(hand.handText,re.DOTALL) - + print "m =", m.groupdict() if(m == None): logging.info("Didn't match re_HandInfo") logging.info(hand.handText) @@ -150,8 +151,8 @@ follow : whether to tail -f the input""" hand.maxseats = int(m2.group(2)) hand.tourNo = m.group('TOURNO') -# if key == 'PLAY' and info['PLAY'] != None: -# hand.gametype['currency'] = 'play' + if m.group('PLAY') != None: + hand.gametype['currency'] = 'play' # These work, but the info is already in the Hand class - should be used for tourneys though. # m.group('SB') @@ -214,6 +215,7 @@ follow : whether to tail -f the input""" m = self.re_Antes.finditer(hand.handText) for player in m: logging.debug("hand.addAnte(%s,%s)" %(player.group('PNAME'), player.group('ANTE'))) +# if player.group() != hand.addAnte(player.group('PNAME'), player.group('ANTE')) def readBringIn(self, hand):