Merge branch 'master' of git://github.com/kangaderoo/fpdb-grindi

This commit is contained in:
grindi 2009-12-19 18:54:19 +03:00
commit 40c8d31b19
3 changed files with 37 additions and 21 deletions

View File

@ -666,6 +666,9 @@ class Stat_Window:
return True return True
if event.button == 1: # left button event 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? # TODO: make position saving save sizes as well?
if event.state & gtk.gdk.SHIFT_MASK: 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) self.window.begin_resize_drag(gtk.gdk.WINDOW_EDGE_SOUTH_EAST, event.button, int(event.x_root), int(event.y_root), event.time)

View File

@ -47,22 +47,22 @@ class PartyPoker(HandHistoryConverter):
# $5 USD NL Texas Hold'em - Saturday, July 25, 07:53:52 EDT 2009 # $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 # 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(""" re_GameInfoRing = re.compile("""
(?P<CURRENCY>\$|)\s*(?P<RINGLIMIT>[0-9,]+)\s*(?:USD)?\s* (?P<CURRENCY>\$|)\s*(?P<RINGLIMIT>[.,0-9]+)\s*(?:USD)?\s*
(?P<LIMIT>(NL|PL|))\s+ (?P<LIMIT>(NL|PL|))\s*
(?P<GAME>(Texas\ Hold\'em|Omaha)) (?P<GAME>(Texas\ Hold\'em|Omaha))
\s*\-\s* \s*\-\s*
(?P<DATETIME>.+) (?P<DATETIME>.+)
""", re.VERBOSE) """, re.VERBOSE)
re_GameInfoTrny = re.compile(""" re_GameInfoTrny = re.compile("""
(?P<LIMIT>(NL|PL|))\s+ (?P<LIMIT>(NL|PL|))\s*
(?P<GAME>(Texas\ Hold\'em|Omaha))\s+ (?P<GAME>(Texas\ Hold\'em|Omaha))\s+
(?P<BUYIN>\$?[.0-9]+)\s*(?P<BUYIN_CURRENCY>USD)?\s*Buy-in\s+ (?:(?P<BUYIN>\$?[.,0-9]+)\s*(?P<BUYIN_CURRENCY>USD)?\s*Buy-in\s+)?
Trny:\s?(?P<TOURNO>\d+)\s+ Trny:\s?(?P<TOURNO>\d+)\s+
Level:\s*(?P<LEVEL>\d+)\s+ Level:\s*(?P<LEVEL>\d+)\s+
Blinds(?:-Antes)?\( ((Blinds|Stakes)(?:-Antes)?)\(
(?P<SB>[.0-9 ]+)\s* (?P<SB>[,.0-9 ]+)\s*
/(?P<BB>[.0-9 ]+) /(?P<BB>[,.0-9 ]+)
(?:\s*-\s*(?P<ANTE>[.0-9 ]+)\$?)? (?:\s*-\s*(?P<ANTE>[,.0-9 ]+)\$?)?
\) \)
\s*\-\s* \s*\-\s*
(?P<DATETIME>.+) (?P<DATETIME>.+)
@ -72,10 +72,13 @@ class PartyPoker(HandHistoryConverter):
re_PlayerInfo = re.compile(""" re_PlayerInfo = re.compile("""
Seat\s(?P<SEAT>\d+):\s Seat\s(?P<SEAT>\d+):\s
(?P<PNAME>.*)\s (?P<PNAME>.*)\s
\(\s*\$?(?P<CASH>[0-9,.]+)\s*(?:USD|)\s*\) \(\s*\$?(?P<CASH>[.,0-9]+)\s*(?:USD|)\s*\)
""" , """ ,
re.VERBOSE) re.VERBOSE)
# Table $250 Freeroll (1810210) Table #309 (Real Money)
# Table Speed #1465003 (Real Money)
re_HandInfo = re.compile(""" re_HandInfo = re.compile("""
^Table\s+ ^Table\s+
(?P<TABLE_TYPE>[^#()]+)\s+ # Regular, Speed, etc (?P<TABLE_TYPE>[^#()]+)\s+ # Regular, Speed, etc
@ -124,7 +127,7 @@ class PartyPoker(HandHistoryConverter):
for key in ('CUR_SYM', 'CUR'): for key in ('CUR_SYM', 'CUR'):
subst[key] = re.escape(subst[key]) subst[key] = re.escape(subst[key])
self.re_PostSB = re.compile( self.re_PostSB = re.compile(
r"^%(PLYR)s posts small blind \[%(CUR_SYM)s(?P<SB>[,.0-9]+) ?%(CUR)s\]\." % subst, r"^%(PLYR)s posts small blind \[%(CUR_SYM)s(?P<SB>[.,0-9]+) ?%(CUR)s\]\." % subst,
re.MULTILINE) re.MULTILINE)
self.re_PostBB = re.compile( self.re_PostBB = re.compile(
r"^%(PLYR)s posts big blind \[%(CUR_SYM)s(?P<BB>[.,0-9]+) ?%(CUR)s\]\." % subst, r"^%(PLYR)s posts big blind \[%(CUR_SYM)s(?P<BB>[.,0-9]+) ?%(CUR)s\]\." % subst,
@ -133,7 +136,7 @@ class PartyPoker(HandHistoryConverter):
r"^%(PLYR)s posts big blind \+ dead \[(?P<BBNDEAD>[.,0-9]+) ?%(CUR_SYM)s\]\." % subst, r"^%(PLYR)s posts big blind \+ dead \[(?P<BBNDEAD>[.,0-9]+) ?%(CUR_SYM)s\]\." % subst,
re.MULTILINE) re.MULTILINE)
self.re_Antes = re.compile( self.re_Antes = re.compile(
r"^%(PLYR)s posts ante \[%(CUR_SYM)s(?P<ANTE>[.0-9]+) ?%(CUR)s\]" % subst, r"^%(PLYR)s posts ante \[%(CUR_SYM)s(?P<ANTE>[.,0-9]+) ?%(CUR)s\]" % subst,
re.MULTILINE) re.MULTILINE)
self.re_HeroCards = re.compile( self.re_HeroCards = re.compile(
r"^Dealt to %(PLYR)s \[\s*(?P<NEWCARDS>.+)\s*\]" % subst, r"^Dealt to %(PLYR)s \[\s*(?P<NEWCARDS>.+)\s*\]" % subst,
@ -295,13 +298,21 @@ class PartyPoker(HandHistoryConverter):
if key == 'BUYIN': if key == 'BUYIN':
# FIXME: it's dirty hack T_T # FIXME: it's dirty hack T_T
# code below assumes that tournament rake is equal to zero # code below assumes that tournament rake is equal to zero
cur = info[key][0] if info[key][0] not in '0123456789' else '' # added handle for freeroll tourney's
hand.buyin = info[key] + '+%s0' % cur # 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': if key == 'TABLE_ID':
hand.tablename = info[key] hand.tablename = info[key]
if key == 'TABLE_NUM': if key == 'TABLE_NUM':
# FIXME: there is no such property in Hand class # 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': if key == 'COUNTED_SEATS':
hand.counted_seats = info[key] hand.counted_seats = info[key]
if key == 'LEVEL': if key == 'LEVEL':
@ -310,6 +321,7 @@ class PartyPoker(HandHistoryConverter):
# if realy party doesn's save play money hh # if realy party doesn's save play money hh
hand.gametype['currency'] = 'play' hand.gametype['currency'] = 'play'
def readButton(self, hand): def readButton(self, hand):
m = self.re_Button.search(hand.handText) m = self.re_Button.search(hand.handText)
if m: if m:

View File

@ -40,15 +40,13 @@ class PokerStars(HandHistoryConverter):
'LEGAL_ISO' : "USD|EUR|GBP|CAD|FPP", # legal ISO currency codes 'LEGAL_ISO' : "USD|EUR|GBP|CAD|FPP", # legal ISO currency codes
'LS' : "\$|\xe2\x82\xac|" # legal currency symbols - Euro(cp1252, utf-8) 'LS' : "\$|\xe2\x82\xac|" # legal currency symbols - Euro(cp1252, utf-8)
} }
# Static regexes # Static regexes
re_GameInfo = re.compile(u""" re_GameInfo = re.compile(u"""
PokerStars\sGame\s\#(?P<HID>[0-9]+):\s+ PokerStars\sGame\s\#(?P<HID>[0-9]+):\s+
(Tournament\s\# # open paren of tournament info (Tournament\s\# # open paren of tournament info
(?P<TOURNO>\d+),\s (?P<TOURNO>\d+),\s
(?P<BUYIN>[%(LS)s\+\d\.]+ # here's how I plan to use LS # here's how I plan to use LS
\s?(?P<TOUR_ISO>%(LEGAL_ISO)s)? (?P<BUYIN>([%(LS)s\+\d\.]+\s?(?P<TOUR_ISO>%(LEGAL_ISO)s)?)|Freeroll)\s+)? # close paren of tournament info
)\s)? # close paren of tournament info
(?P<MIXED>HORSE|8\-Game|HOSE)?\s?\(? (?P<MIXED>HORSE|8\-Game|HOSE)?\s?\(?
(?P<GAME>Hold\'em|Razz|7\sCard\sStud|7\sCard\sStud\sHi/Lo|Omaha|Omaha\sHi/Lo|Badugi|Triple\sDraw\s2\-7\sLowball|5\sCard\sDraw)\s (?P<GAME>Hold\'em|Razz|7\sCard\sStud|7\sCard\sStud\sHi/Lo|Omaha|Omaha\sHi/Lo|Badugi|Triple\sDraw\s2\-7\sLowball|5\sCard\sDraw)\s
(?P<LIMIT>No\sLimit|Limit|Pot\sLimit)\)?,?\s (?P<LIMIT>No\sLimit|Limit|Pot\sLimit)\)?,?\s
@ -148,7 +146,7 @@ class PokerStars(HandHistoryConverter):
'7 Card Stud Hi/Lo' : ('stud','studhilo'), '7 Card Stud Hi/Lo' : ('stud','studhilo'),
'Badugi' : ('draw','badugi'), 'Badugi' : ('draw','badugi'),
'Triple Draw 2-7 Lowball' : ('draw','27_3draw'), 'Triple Draw 2-7 Lowball' : ('draw','27_3draw'),
'5 Card Draw' : ('draw','fivedraw') '5 Card Draw' : ('draw','fivedraw'),
} }
currencies = { u'':'EUR', '$':'USD', '':'T$' } currencies = { u'':'EUR', '$':'USD', '':'T$' }
# I don't think this is doing what we think. mg will always have all # 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': if key == 'TOURNO':
hand.tourNo = info[key] hand.tourNo = info[key]
if key == 'BUYIN': if key == 'BUYIN':
hand.buyin = info[key] if info[key] == 'Freeroll':
hand.buyin = '$0+$0'
else:
hand.buyin = info[key]
if key == 'LEVEL': if key == 'LEVEL':
hand.level = info[key] hand.level = info[key]