From bb446ad95572eb03eefd0d2d3e438728eb4c5a03 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 18 Dec 2009 20:25:20 +0100 Subject: [PATCH 1/3] Stakes added for limit games. blinds now supported for > 1000 Freerolls supported --> buyin fixed to $0+$0 Table indentification for tourney and ring games supported --> HUD --- pyfpdb/PartyPokerToFpdb.py | 42 ++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 15 deletions(-) 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) From 545d4f37fb45967e805fc8837422bdd4a9ff8bad Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 19 Dec 2009 10:57:07 +0100 Subject: [PATCH 2/3] Add freeroll support to Pokerstars --- pyfpdb/PokerStarsToFpdb.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pyfpdb/PokerStarsToFpdb.py b/pyfpdb/PokerStarsToFpdb.py index b3463da9..b998bf95 100755 --- a/pyfpdb/PokerStarsToFpdb.py +++ b/pyfpdb/PokerStarsToFpdb.py @@ -40,15 +40,13 @@ class PokerStars(HandHistoryConverter): 'LEGAL_ISO' : "USD|EUR|GBP|CAD|FPP", # legal ISO currency codes 'LS' : "\$|\xe2\x82\xac|" # legal currency symbols - Euro(cp1252, utf-8) } - # Static regexes re_GameInfo = re.compile(u""" PokerStars\sGame\s\#(?P[0-9]+):\s+ (Tournament\s\# # open paren of tournament info (?P\d+),\s - (?P[%(LS)s\+\d\.]+ # here's how I plan to use LS - \s?(?P%(LEGAL_ISO)s)? - )\s)? # close paren of tournament info + # here's how I plan to use LS + (?P([%(LS)s\+\d\.]+\s?(?P%(LEGAL_ISO)s)?)|Freeroll)\s+)? # close paren of tournament info (?PHORSE|8\-Game|HOSE)?\s?\(? (?PHold\'em|Razz|7\sCard\sStud|7\sCard\sStud\sHi/Lo|Omaha|Omaha\sHi/Lo|Badugi|Triple\sDraw\s2\-7\sLowball|5\sCard\sDraw)\s (?PNo\sLimit|Limit|Pot\sLimit)\)?,?\s @@ -148,7 +146,7 @@ class PokerStars(HandHistoryConverter): '7 Card Stud Hi/Lo' : ('stud','studhilo'), 'Badugi' : ('draw','badugi'), 'Triple Draw 2-7 Lowball' : ('draw','27_3draw'), - '5 Card Draw' : ('draw','fivedraw') + '5 Card Draw' : ('draw','fivedraw'), } currencies = { u'€':'EUR', '$':'USD', '':'T$' } # I don't think this is doing what we think. mg will always have all @@ -203,7 +201,10 @@ class PokerStars(HandHistoryConverter): if key == 'TOURNO': hand.tourNo = info[key] if key == 'BUYIN': - hand.buyin = info[key] + if info[key] == 'Freeroll': + hand.buyin = '$0+$0' + else: + hand.buyin = info[key] if key == 'LEVEL': hand.level = info[key] From 3a742148ef7f1b91b8483d7a8fddb45007aef254 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 19 Dec 2009 11:02:45 +0100 Subject: [PATCH 3/3] Close stat window with double-click --- pyfpdb/Hud.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyfpdb/Hud.py b/pyfpdb/Hud.py index c9420a8a..944eacd0 100644 --- a/pyfpdb/Hud.py +++ b/pyfpdb/Hud.py @@ -666,6 +666,9 @@ class Stat_Window: return True if event.button == 1: # left button event + if event.type == gtk.gdk._2BUTTON_PRESS: + self.window.hide() + return True # TODO: make position saving save sizes as well? if event.state & gtk.gdk.SHIFT_MASK: self.window.begin_resize_drag(gtk.gdk.WINDOW_EDGE_SOUTH_EAST, event.button, int(event.x_root), int(event.y_root), event.time)