diff --git a/pyfpdb/PartyPokerToFpdb.py b/pyfpdb/PartyPokerToFpdb.py index ba597881..35daca14 100755 --- a/pyfpdb/PartyPokerToFpdb.py +++ b/pyfpdb/PartyPokerToFpdb.py @@ -47,22 +47,22 @@ class PartyPoker(HandHistoryConverter): # $5 USD NL Texas Hold'em - Saturday, July 25, 07:53:52 EDT 2009 # NL Texas Hold'em $1 USD Buy-in Trny:45685440 Level:8 Blinds-Antes(600/1 200 -50) - Sunday, May 17, 11:25:07 MSKS 2009 re_GameInfoRing = re.compile(""" - (?P\$|)\s*(?P[0-9,]+)\s*(?:USD)?\s* - (?P(NL|PL|))\s+ + (?P\$|)\s*(?P[.,0-9]+)\s*(?:USD)?\s* + (?P(NL|PL|))\s* (?P(Texas\ Hold\'em|Omaha)) \s*\-\s* (?P.+) """, re.VERBOSE) re_GameInfoTrny = re.compile(""" - (?P(NL|PL|))\s+ + (?P(NL|PL|))\s* (?P(Texas\ Hold\'em|Omaha))\s+ - (?P\$?[.0-9]+)\s*(?PUSD)?\s*Buy-in\s+ + (?:(?P\$?[.,0-9]+)\s*(?PUSD)?\s*Buy-in\s+)? Trny:\s?(?P\d+)\s+ Level:\s*(?P\d+)\s+ - Blinds(?:-Antes)?\( - (?P[.0-9 ]+)\s* - /(?P[.0-9 ]+) - (?:\s*-\s*(?P[.0-9 ]+)\$?)? + ((Blinds|Stakes)(?:-Antes)?)\( + (?P[,.0-9 ]+)\s* + /(?P[,.0-9 ]+) + (?:\s*-\s*(?P[,.0-9 ]+)\$?)? \) \s*\-\s* (?P.+) @@ -72,10 +72,13 @@ class PartyPoker(HandHistoryConverter): re_PlayerInfo = re.compile(""" Seat\s(?P\d+):\s (?P.*)\s - \(\s*\$?(?P[0-9,.]+)\s*(?:USD|)\s*\) + \(\s*\$?(?P[.,0-9]+)\s*(?:USD|)\s*\) """ , re.VERBOSE) + # Table $250 Freeroll (1810210) Table #309 (Real Money) + # Table Speed #1465003 (Real Money) + re_HandInfo = re.compile(""" ^Table\s+ (?P[^#()]+)\s+ # Regular, Speed, etc @@ -124,7 +127,7 @@ class PartyPoker(HandHistoryConverter): for key in ('CUR_SYM', 'CUR'): subst[key] = re.escape(subst[key]) self.re_PostSB = re.compile( - r"^%(PLYR)s posts small blind \[%(CUR_SYM)s(?P[,.0-9]+) ?%(CUR)s\]\." % subst, + r"^%(PLYR)s posts small blind \[%(CUR_SYM)s(?P[.,0-9]+) ?%(CUR)s\]\." % subst, re.MULTILINE) self.re_PostBB = re.compile( r"^%(PLYR)s posts big blind \[%(CUR_SYM)s(?P[.,0-9]+) ?%(CUR)s\]\." % subst, @@ -133,7 +136,7 @@ class PartyPoker(HandHistoryConverter): r"^%(PLYR)s posts big blind \+ dead \[(?P[.,0-9]+) ?%(CUR_SYM)s\]\." % subst, re.MULTILINE) self.re_Antes = re.compile( - r"^%(PLYR)s posts ante \[%(CUR_SYM)s(?P[.0-9]+) ?%(CUR)s\]" % subst, + r"^%(PLYR)s posts ante \[%(CUR_SYM)s(?P[.,0-9]+) ?%(CUR)s\]" % subst, re.MULTILINE) self.re_HeroCards = re.compile( r"^Dealt to %(PLYR)s \[\s*(?P.+)\s*\]" % subst, @@ -295,20 +298,29 @@ class PartyPoker(HandHistoryConverter): if key == 'BUYIN': # FIXME: it's dirty hack T_T # code below assumes that tournament rake is equal to zero - cur = info[key][0] if info[key][0] not in '0123456789' else '' - hand.buyin = info[key] + '+%s0' % cur + # added handle for freeroll tourney's + # code added for freeroll the buyin is overwritten by $0+$0 + if info[key] == None: #assume freeroll + cur = '$' + hand.buyin = "$0" + '+%s0' % cur + else: + cur = info[key][0] if info[key][0] not in '0123456789' else '' + hand.buyin = info[key] + '+%s0' % cur if key == 'TABLE_ID': hand.tablename = info[key] if key == 'TABLE_NUM': # FIXME: there is no such property in Hand class - hand.table_num = info[key] + if info[key] != None: + hand.tablename = info[key] + hand.tourNo = info['TABLE_ID'] if key == 'COUNTED_SEATS': hand.counted_seats = info[key] if key == 'LEVEL': hand.level = info[key] if key == 'PLAY' and info['PLAY'] != 'Real': # if realy party doesn's save play money hh - hand.gametype['currency'] = 'play' + hand.gametype['currency'] = 'play' + def readButton(self, hand): m = self.re_Button.search(hand.handText)