From 147cc6c95035164c48e12f0e2719fce228f0c959 Mon Sep 17 00:00:00 2001 From: Worros Date: Tue, 16 Nov 2010 11:57:09 +0800 Subject: [PATCH] Absolute: Deal with ','s in blinds --- pyfpdb/AbsoluteToFpdb.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pyfpdb/AbsoluteToFpdb.py b/pyfpdb/AbsoluteToFpdb.py index e0ceed48..59f75a8f 100755 --- a/pyfpdb/AbsoluteToFpdb.py +++ b/pyfpdb/AbsoluteToFpdb.py @@ -54,7 +54,7 @@ class Absolute(HandHistoryConverter): (?P\(1\son\s1\)|Single\ Tournament|Multi\ Normal\ Tournament|)\s* (?PNo\ Limit|Pot\ Limit|Normal|)\s? (?P\$|\s€|) - (?P[.0-9]+)/?(?:\$|\s€|)(?P[.0-9]+)? + (?P[.,0-9]+)/?(?:\$|\s€|)(?P[.,0-9]+)? \s+-\s+ (?P\d\d\d\d-\d\d-\d\d\ \d\d:\d\d:\d\d)\s+ (?: \( (?P[A-Z]+) \)\s+ )? @@ -95,10 +95,10 @@ class Absolute(HandHistoryConverter): player_re = "(?P" + "|".join(map(re.escape, players)) + ")" logging.debug("player_re: "+ player_re) #(?P\$| €|)(?P[0-9]*[.0-9]+) - self.re_PostSB = re.compile(ur"^%s - Posts small blind (?:\$| €|)(?P[0-9]*[.0-9]+)" % player_re, re.MULTILINE) - self.re_PostBB = re.compile(ur"^%s - Posts big blind (?:\$| €|)(?P[0-9]*[.0-9]+)" % player_re, re.MULTILINE) + self.re_PostSB = re.compile(ur"^%s - Posts small blind (?:\$| €|)(?P[,.0-9]+)" % player_re, re.MULTILINE) + self.re_PostBB = re.compile(ur"^%s - Posts big blind (?:\$| €|)(?P[.,0-9]+)" % player_re, re.MULTILINE) # TODO: Absolute posting when coming in new: %s - Posts $0.02 .. should that be a new Post line? where do we need to add support for that? *confused* - self.re_PostBoth = re.compile(ur"^%s - Posts dead (?:\$| €|)(?P[0-9]*[.0-9]+)" % player_re, re.MULTILINE) + self.re_PostBoth = re.compile(ur"^%s - Posts dead (?:\$| €|)(?P[,.0-9]+)" % player_re, re.MULTILINE) self.re_Action = re.compile(ur"^%s - (?PBets |Raises |All-In |All-In\(Raise\) |Calls |Folds|Checks)?\$?(?P[0-9]*[.0-9]+)?" % player_re, re.MULTILINE) self.re_ShowdownAction = re.compile(ur"^%s - Shows \[(?P.*)\]" % player_re, re.MULTILINE) self.re_CollectPot = re.compile(ur"^Seat [0-9]: %s(?: \(dealer\)|)(?: \(big blind\)| \(small blind\)|) (?:won|collected) Total \((?:\$| €|)(?P[0-9]*[.0-9]+)\)" % player_re, re.MULTILINE) @@ -175,11 +175,13 @@ class Absolute(HandHistoryConverter): if info['currency'] == 'T$': info['type'] = 'tour' if 'SB' in mg: + mg['SB'] = mg['SB'].replace(',', '') info['sb'] = mg['SB'] if 'BB' in mg: info['bb'] = mg['BB'] # NB: SB, BB must be interpreted as blinds or bets depending on limit type. if info['bb'] is None: + mg['SB'] = mg['SB'].replace(',', '') info['bb'] = mg['SB'] info['sb'] = str(float(mg['SB']) * 0.5) # TODO: AP does provide Small BET for Limit .. I think? at least 1-on-1 limit they do.. sigh