Merge branch 'master' of git://trac-git.assembla.com/fpdb-sql

This commit is contained in:
Mika Bostrom 2009-10-03 00:57:25 +03:00
commit a1d5f2292f
3 changed files with 46 additions and 27 deletions

8
pyfpdb/FulltiltToFpdb.py Normal file → Executable file
View File

@ -40,6 +40,7 @@ class Fulltilt(HandHistoryConverter):
(?P<SB>[.0-9]+)/ (?P<SB>[.0-9]+)/
\$?(?P<BB>[.0-9]+)\s \$?(?P<BB>[.0-9]+)\s
(Ante\s\$?(?P<ANTE>[.0-9]+)\s)?-\s (Ante\s\$?(?P<ANTE>[.0-9]+)\s)?-\s
\$?(?P<CAP>[.0-9]+\sCap\s)?
(?P<LIMIT>(No\sLimit|Pot\sLimit|Limit))?\s (?P<LIMIT>(No\sLimit|Pot\sLimit|Limit))?\s
(?P<GAME>(Hold\'em|Omaha\sHi|Omaha\sH/L|7\sCard\sStud|Stud\sH/L|Razz|Stud\sHi)) (?P<GAME>(Hold\'em|Omaha\sHi|Omaha\sH/L|7\sCard\sStud|Stud\sH/L|Razz|Stud\sHi))
''', re.VERBOSE) ''', re.VERBOSE)
@ -52,6 +53,7 @@ class Fulltilt(HandHistoryConverter):
(?P<TABLE>[-\s\da-zA-Z]+)\s (?P<TABLE>[-\s\da-zA-Z]+)\s
(\((?P<TABLEATTRIBUTES>.+)\)\s)?-\s (\((?P<TABLEATTRIBUTES>.+)\)\s)?-\s
\$?(?P<SB>[.0-9]+)/\$?(?P<BB>[.0-9]+)\s(Ante\s\$?(?P<ANTE>[.0-9]+)\s)?-\s \$?(?P<SB>[.0-9]+)/\$?(?P<BB>[.0-9]+)\s(Ante\s\$?(?P<ANTE>[.0-9]+)\s)?-\s
\$?(?P<CAP>[.0-9]+\sCap\s)?
(?P<GAMETYPE>[a-zA-Z\/\'\s]+)\s-\s (?P<GAMETYPE>[a-zA-Z\/\'\s]+)\s-\s
(?P<DATETIME>\d+:\d+:\d+\s\w+\s-\s\d+/\d+/\d+)\s? (?P<DATETIME>\d+:\d+:\d+\s\w+\s-\s\d+/\d+/\d+)\s?
(?P<PARTIAL>\(partial\))?\n (?P<PARTIAL>\(partial\))?\n
@ -143,6 +145,7 @@ class Fulltilt(HandHistoryConverter):
return [["ring", "hold", "nl"], return [["ring", "hold", "nl"],
["ring", "hold", "pl"], ["ring", "hold", "pl"],
["ring", "hold", "fl"], ["ring", "hold", "fl"],
["ring", "hold", "cn"],
["ring", "stud", "fl"], ["ring", "stud", "fl"],
@ -175,7 +178,10 @@ class Fulltilt(HandHistoryConverter):
'Stud H/L' : ('stud','studhilo') 'Stud H/L' : ('stud','studhilo')
} }
currencies = { u'':'EUR', '$':'USD', '':'T$' } currencies = { u'':'EUR', '$':'USD', '':'T$' }
info['limitType'] = limits[mg['LIMIT']] if mg['CAP']:
info['limitType'] = 'cn'
else:
info['limitType'] = limits[mg['LIMIT']]
info['sb'] = mg['SB'] info['sb'] = mg['SB']
info['bb'] = mg['BB'] info['bb'] = mg['BB']
if mg['GAME'] != None: if mg['GAME'] != None:

View File

@ -152,38 +152,32 @@ class Hud:
aggitem.set_submenu(self.aggMenu) aggitem.set_submenu(self.aggMenu)
# set agg_bb_mult to 1 to stop aggregation # set agg_bb_mult to 1 to stop aggregation
item = gtk.CheckMenuItem('For This Blind Level Only') item = gtk.CheckMenuItem('For This Blind Level Only')
item.ms = 1
self.aggMenu.append(item) self.aggMenu.append(item)
item.connect("activate", self.set_aggregation) item.connect("activate", self.set_aggregation, 1)
setattr(self, 'showStatsMenuItem1', item) setattr(self, 'aggBBmultItem1', item)
# #
item = gtk.MenuItem('For Multiple Blind Levels:') item = gtk.MenuItem('For Multiple Blind Levels:')
self.aggMenu.append(item) self.aggMenu.append(item)
setattr(self, 'showStatsMenuItem2', item)
# #
item = gtk.CheckMenuItem(' 0.5 to 2.0 x Current Blinds') item = gtk.CheckMenuItem(' 0.5 to 2.0 x Current Blinds')
item.ms = 2
self.aggMenu.append(item) self.aggMenu.append(item)
item.connect("activate", self.set_aggregation) item.connect("activate", self.set_aggregation, 2)
setattr(self, 'showStatsMenuItem3', item) setattr(self, 'aggBBmultItem2', item)
# #
item = gtk.CheckMenuItem(' 0.33 to 3.0 x Current Blinds') item = gtk.CheckMenuItem(' 0.33 to 3.0 x Current Blinds')
item.ms = 3
self.aggMenu.append(item) self.aggMenu.append(item)
item.connect("activate", self.set_aggregation) item.connect("activate", self.set_aggregation, 3)
setattr(self, 'showStatsMenuItem4', item) setattr(self, 'aggBBmultItem3', item)
# #
item = gtk.CheckMenuItem(' 0.1 to 10 x Current Blinds') item = gtk.CheckMenuItem(' 0.1 to 10 x Current Blinds')
item.ms = 10
self.aggMenu.append(item) self.aggMenu.append(item)
item.connect("activate", self.set_aggregation) item.connect("activate", self.set_aggregation, 10)
setattr(self, 'showStatsMenuItem5', item) setattr(self, 'aggBBmultItem10', item)
# #
item = gtk.CheckMenuItem(' All Levels') item = gtk.CheckMenuItem(' All Levels')
item.ms = 10000
self.aggMenu.append(item) self.aggMenu.append(item)
item.connect("activate", self.set_aggregation) item.connect("activate", self.set_aggregation, 10000)
setattr(self, 'showStatsMenuItem6', item) setattr(self, 'aggBBmultItem10000', item)
# #
item = gtk.MenuItem('For Hero:') item = gtk.MenuItem('For Hero:')
self.aggMenu.append(item) self.aggMenu.append(item)
@ -203,12 +197,24 @@ class Hud:
self.aggMenu.append(item) self.aggMenu.append(item)
item.connect("activate", self.set_hud_style, 'HT') item.connect("activate", self.set_hud_style, 'HT')
setattr(self, 'HTStyleOption', item) setattr(self, 'HTStyleOption', item)
# set active on current options:
if self.hud_params['agg_bb_mult'] == 1:
getattr(self, 'aggBBmultItem1').set_active(True)
elif self.hud_params['agg_bb_mult'] == 2:
getattr(self, 'aggBBmultItem2').set_active(True)
elif self.hud_params['agg_bb_mult'] == 3:
getattr(self, 'aggBBmultItem3').set_active(True)
elif self.hud_params['agg_bb_mult'] == 10:
getattr(self, 'aggBBmultItem10').set_active(True)
elif self.hud_params['agg_bb_mult'] > 9000:
getattr(self, 'aggBBmultItemAll').set_active(True)
if self.hud_params['h_hud_style'] == 'A': if self.hud_params['h_hud_style'] == 'A':
item.set_active(True) getattr(self, 'HAStyleOption').set_active(True)
if self.hud_params['h_hud_style'] == 'S': elif self.hud_params['h_hud_style'] == 'S':
item.set_active(True) getattr(self, 'HSStyleOption').set_active(True)
if self.hud_params['h_hud_style'] == 'T': elif self.hud_params['h_hud_style'] == 'T':
item.set_active(True) getattr(self, 'HTStyleOption').set_active(True)
eventbox.connect_object("button-press-event", self.on_button_press, menu) eventbox.connect_object("button-press-event", self.on_button_press, menu)
@ -247,14 +253,21 @@ class Hud:
print "Exception:",str(e) print "Exception:",str(e)
pass pass
def set_aggregation(self, widget): def set_aggregation(self, widget, val):
# try setting these to true all the time, and set the multiplier to 1 to turn agg off: # try setting these to true all the time, and set the multiplier to 1 to turn agg off:
self.hud_params['aggregate_ring'] = True self.hud_params['aggregate_ring'] = True
self.hud_params['aggregate_tour'] = True self.hud_params['aggregate_tour'] = True
self.hud_params['h_aggregate_ring'] = True
self.hud_params['h_aggregate_tour'] = True
if self.hud_params['agg_bb_mult'] != widget.ms: if self.hud_params['agg_bb_mult'] != val \
print 'set_aggregation', widget.ms and getattr(self, 'aggBBmultItem'+str(val)).get_active():
self.hud_params['agg_bb_mult'] = widget.ms print 'set_aggregation', val
self.hud_params['agg_bb_mult'] = val
self.hud_params['h_agg_bb_mult'] = val
for mult in ('1', '2', '3', '10', '10000'):
if mult != str(val):
getattr(self, 'aggBBmultItem'+mult).set_active(False)
def set_hud_style(self, widget, val): def set_hud_style(self, widget, val):
# try setting these to true all the time, and set the multiplier to 1 to turn agg off: # try setting these to true all the time, and set the multiplier to 1 to turn agg off:

View File

@ -376,7 +376,7 @@ def clean_title(name):
"""Clean the little info strings from the table name.""" """Clean the little info strings from the table name."""
# these strings could go in a config file # these strings could go in a config file
for pattern in [' \(6 max\)', ' \(heads up\)', ' \(deep\)', for pattern in [' \(6 max\)', ' \(heads up\)', ' \(deep\)',
' \(deep hu\)', ' \(deep 6\)', ' \(2\)', ' \(deep hu\)', ' \(deep 6\)', '\(6 max, deep\)', ' \(2\)',
' \(edu\)', ' \(edu, 6 max\)', ' \(6\)', ' \(edu\)', ' \(edu, 6 max\)', ' \(6\)',
' \(speed\)', 'special', 'newVPP', ' \(speed\)', 'special', 'newVPP',
' no all-in', ' fast', ',', ' 50BB min', '50bb min', '\s+$']: ' no all-in', ' fast', ',', ' 50BB min', '50bb min', '\s+$']: