Merge branch 'master' of git://git.assembla.com/fpdboz.git

This commit is contained in:
Eric Blade 2011-03-03 02:09:37 -05:00
commit b7a7b455c2
20 changed files with 348 additions and 316 deletions

View File

@ -464,6 +464,7 @@ class Database:
log.warning(_("Some database functions will not work without NumPy support")) log.warning(_("Some database functions will not work without NumPy support"))
self.cursor = self.connection.cursor() self.cursor = self.connection.cursor()
self.cursor.execute('PRAGMA temp_store=2') # use memory for temp tables/indexes self.cursor.execute('PRAGMA temp_store=2') # use memory for temp tables/indexes
self.cursor.execute('PRAGMA journal_mode=WAL') # use memory for temp tables/indexes
self.cursor.execute('PRAGMA synchronous=0') # don't wait for file writes to finish self.cursor.execute('PRAGMA synchronous=0') # don't wait for file writes to finish
else: else:
raise FpdbError("sqlite database "+database+" does not exist") raise FpdbError("sqlite database "+database+" does not exist")

View File

@ -160,7 +160,6 @@ class Filters(threading.Thread):
self.types = {} # list of all ring/tour values self.types = {} # list of all ring/tour values
self.num_limit_types = 0 self.num_limit_types = 0
self.num_limit_types = 0
self.fillLimitsFrame(vbox, self.display) self.fillLimitsFrame(vbox, self.display)
limitsFrame.add(vbox) limitsFrame.add(vbox)

View File

@ -74,7 +74,7 @@ class Fulltilt(HandHistoryConverter):
(Ante\s\$?(?P<ANTE>[%(NUM)s]+)\s)?-\s (Ante\s\$?(?P<ANTE>[%(NUM)s]+)\s)?-\s
[%(LS)s]?(?P<CAP>[%(NUM)s]+\sCap\s)? [%(LS)s]?(?P<CAP>[%(NUM)s]+\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|2-7\sTriple\sDraw|5\sCard\sDraw|Badugi)) (?P<GAME>(Hold\'em|Omaha\sHi|Omaha\sH/L|Omaha|7\sCard\sStud|Stud\sH/L|Razz|Stud\sHi|2-7\sTriple\sDraw|5\sCard\sDraw|Badugi))
''' % substitutions, re.VERBOSE) ''' % substitutions, re.VERBOSE)
re_SplitHands = re.compile(r"\n\n\n+") re_SplitHands = re.compile(r"\n\n\n+")
re_TailSplitHands = re.compile(r"(\n\n+)") re_TailSplitHands = re.compile(r"(\n\n+)")
@ -114,7 +114,7 @@ class Fulltilt(HandHistoryConverter):
(\((?P<TURBO1>Turbo)\)\s)? (\((?P<TURBO1>Turbo)\)\s)?
\((?P<TOURNO>\d+)\)\s \((?P<TOURNO>\d+)\)\s
((?P<MATCHNO>Match\s\d)\s)? ((?P<MATCHNO>Match\s\d)\s)?
(?P<GAME>(Hold\'em|Omaha\sHi|Omaha\sH/L|7\sCard\sStud|Stud\sH/L|Razz|Stud\sHi))\s (?P<GAME>(Hold\'em|Omaha\sHi|Omaha\sH/L|Omaha|7\sCard\sStud|Stud\sH/L|Razz|Stud\sHi))\s
(\((?P<TURBO2>Turbo)\)\s)? (\((?P<TURBO2>Turbo)\)\s)?
(?P<LIMIT>(No\sLimit|Pot\sLimit|Limit))? (?P<LIMIT>(No\sLimit|Pot\sLimit|Limit))?
''' % substitutions, re.VERBOSE) ''' % substitutions, re.VERBOSE)
@ -218,6 +218,7 @@ class Fulltilt(HandHistoryConverter):
games = { # base, category games = { # base, category
"Hold'em" : ('hold','holdem'), "Hold'em" : ('hold','holdem'),
'Omaha Hi' : ('hold','omahahi'), 'Omaha Hi' : ('hold','omahahi'),
'Omaha' : ('hold','omahahi'),
'Omaha H/L' : ('hold','omahahilo'), 'Omaha H/L' : ('hold','omahahilo'),
'Razz' : ('stud','razz'), 'Razz' : ('stud','razz'),
'Stud Hi' : ('stud','studhi'), 'Stud Hi' : ('stud','studhi'),
@ -362,6 +363,10 @@ class Fulltilt(HandHistoryConverter):
seat, stack = plist[a] seat, stack = plist[a]
hand.addPlayer(seat, a, stack) hand.addPlayer(seat, a, stack)
if plist == {}:
#No players! The hand is either missing stacks or everyone is sitting out
raise FpdbParseError(_("FTP: readPlayerStacks: No players detected (hand #%s)") % hand.handid)
def markStreets(self, hand): def markStreets(self, hand):

View File

@ -228,7 +228,7 @@ class GuiGraphViewer (threading.Thread):
#TODO: Do something useful like alert user #TODO: Do something useful like alert user
#print "No hands returned by graph query" #print "No hands returned by graph query"
else: else:
self.ax.set_title(_("Profit graph for ring games"+names),fontsize=12) self.ax.set_title((_("Profit graph for ring games")+names),fontsize=12)
#Draw plot #Draw plot
self.ax.plot(green, color='green', label=_('Hands: %d\nProfit (%s): %.2f') %(len(green),graphops['dspin'], green[-1])) self.ax.plot(green, color='green', label=_('Hands: %d\nProfit (%s): %.2f') %(len(green),graphops['dspin'], green[-1]))

View File

@ -266,7 +266,7 @@ class HUD_main(object):
cards = self.get_cards(new_hand_id) cards = self.get_cards(new_hand_id)
table_kwargs = dict(table_name=table_name, tournament=tour_number, table_number=tab_number) table_kwargs = dict(table_name=table_name, tournament=tour_number, table_number=tab_number)
tablewindow = Tables.Table(self.config, site_name, **table_kwargs) tablewindow = Tables.Table(self.config, site_name, **table_kwargs)
if tablewindow is None: if tablewindow.number is None:
# If no client window is found on the screen, complain and continue # If no client window is found on the screen, complain and continue
if type == "tour": if type == "tour":
table_name = "%s %s" % (tour_number, tab_number) table_name = "%s %s" % (tour_number, tab_number)

View File

@ -359,11 +359,17 @@ db: a connected Database object"""
# NOTE: This relies on row_factory = sqlite3.Row (set in connect() params) # NOTE: This relies on row_factory = sqlite3.Row (set in connect() params)
# Need to find MySQL and Postgres equivalents # Need to find MySQL and Postgres equivalents
# MySQL maybe: cursorclass=MySQLdb.cursors.DictCursor # MySQL maybe: cursorclass=MySQLdb.cursors.DictCursor
res = c.fetchone() #res = c.fetchone()
# Using row_factory is global, and affects the rest of fpdb. The following 2 line achieves
# a similar result
res = [dict(line) for line in [zip([ column[0] for column in c.description], row) for row in c.fetchall()]]
res = res[0]
#res['tourneyId'] #res['seats'] #res['rush'] #res['tourneyId'] #res['seats'] #res['rush']
self.tablename = res['tableName'] self.tablename = res['tableName']
self.handid = res['siteHandNo'] self.handid = res['siteHandNo']
#print "DBEUG: res['startTime']: %s" % res['startTime']
self.startTime = datetime.datetime.strptime(res['startTime'], "%Y-%m-%d %H:%M:%S+00:00") self.startTime = datetime.datetime.strptime(res['startTime'], "%Y-%m-%d %H:%M:%S+00:00")
self.maxseats = res['maxSeats'] self.maxseats = res['maxSeats']
@ -396,16 +402,19 @@ db: a connected Database object"""
Players as p, Players as p,
Hands as h Hands as h
WHERE WHERE
h.id = %s h.id = %s
and ha.handsPlayerId = hp.id AND ha.handId = h.id
and hp.playerId = p.id AND ha.playerId = hp.playerid
AND hp.playerId = p.id
AND h.id = hp.handId AND h.id = hp.handId
ORDER BY ORDER BY
ha.id ASC ha.id ASC
; """ """
q = q.replace('%s', db.sql.query['placeholder']) q = q.replace('%s', db.sql.query['placeholder'])
c.execute(q, (handId,)) c.execute(q, (handId,))
for row in c.fetchall(): res = [dict(line) for line in [zip([ column[0] for column in c.description], row) for row in c.fetchall()]]
for row in res:
name = row['name'] name = row['name']
street = row['street'] street = row['street']
act = row['actionId'] act = row['actionId']
@ -414,7 +423,6 @@ db: a connected Database object"""
street = self.allStreets[int(street)+1] street = self.allStreets[int(street)+1]
#print "DEBUG: name: '%s' street: '%s' act: '%s' bet: '%s'" %(name, street, act, bet) #print "DEBUG: name: '%s' street: '%s' act: '%s' bet: '%s'" %(name, street, act, bet)
if act == 2: # Small Blind if act == 2: # Small Blind
print "DEBUG: addBlind(%s, 'small blind', %s" %(name, str(bet))
self.addBlind(name, 'small blind', str(bet)) self.addBlind(name, 'small blind', str(bet))
elif act == 4: # Big Blind elif act == 4: # Big Blind
self.addBlind(name, 'big blind', str(bet)) self.addBlind(name, 'big blind', str(bet))
@ -426,6 +434,8 @@ db: a connected Database object"""
self.addFold(street, name) self.addFold(street, name)
elif act == 11: # Check elif act == 11: # Check
self.addCheck(street, name) self.addCheck(street, name)
elif act == 7: # Raise
self.addRaiseBy(street, name, str(bet))
else: else:
print "DEBUG: unknown action: '%s'" % act print "DEBUG: unknown action: '%s'" % act

View File

@ -73,7 +73,7 @@ class OnGame(HandHistoryConverter):
re_HandInfo = re.compile(u""" re_HandInfo = re.compile(u"""
\*\*\*\*\*\sHistory\sfor\shand\s(?P<HID>[-A-Z\d]+).* \*\*\*\*\*\sHistory\sfor\shand\s(?P<HID>[-A-Z\d]+).*
Start\shand:\s(?P<DATETIME>.*) Start\shand:\s(?P<DATETIME>.*)
Table:\s(\[SPEED\]\s)?(?P<TABLE>[-\'\w\s]+)\s\[\d+\]\s\( Table:\s(\[SPEED\]\s)?(?P<TABLE>[-\'\w\s\.]+)\s\[\d+\]\s\(
( (
(?P<LIMIT>NO_LIMIT|Limit|LIMIT|Pot\sLimit|POT_LIMIT)\s (?P<LIMIT>NO_LIMIT|Limit|LIMIT|Pot\sLimit|POT_LIMIT)\s
(?P<GAME>TEXAS_HOLDEM|OMAHA_HI|SEVEN_CARD_STUD|SEVEN_CARD_STUD_HI_LO|RAZZ|FIVE_CARD_DRAW)\s (?P<GAME>TEXAS_HOLDEM|OMAHA_HI|SEVEN_CARD_STUD|SEVEN_CARD_STUD_HI_LO|RAZZ|FIVE_CARD_DRAW)\s

View File

@ -330,6 +330,12 @@ class PartyPoker(HandHistoryConverter):
# FIXME: there is no such property in Hand class # FIXME: there is no such property in Hand class
self.isSNG = True self.isSNG = True
if key == 'BUYIN': if key == 'BUYIN':
if info[key] == None:
# Freeroll tourney
hand.buyin = 0
hand.fee = 0
hand.buyinCurrency = "FREE"
hand.isKO = False
if hand.tourNo != None: if hand.tourNo != None:
hand.buyin = 0 hand.buyin = 0
hand.fee = 0 hand.fee = 0

View File

@ -34,9 +34,13 @@ import gtk
import gobject import gobject
# FreePokerTools modules # FreePokerTools modules
import Configuration
from HandHistoryConverter import getTableTitleRe from HandHistoryConverter import getTableTitleRe
from HandHistoryConverter import getTableNoRe from HandHistoryConverter import getTableNoRe
c = Configuration.Config()
log = Configuration.get_logger("logging.conf", "hud", log_dir=c.dir_log, log_file='HUD-log.txt')
# Global used for figuring out the current game being played from the title. # Global used for figuring out the current game being played from the title.
# The dict key is a tuple of (limit type, category) for the game. # The dict key is a tuple of (limit type, category) for the game.
# The list is the names for those games used by the supported poker sites # The list is the names for those games used by the supported poker sites

View File

@ -128,7 +128,7 @@ class Table(Table_Window):
des_re = 'No such window with id' des_re = 'No such window with id'
listing = os.popen("xwininfo -id %d -stats" % (self.number)).read() listing = os.popen("xwininfo -id %d -stats" % (self.number)).read()
if listing == "": return
mo = re.search(des_re, listing) mo = re.search(des_re, listing)
if mo is not None: if mo is not None:
return None # table has been destroyed return None # table has been destroyed

Binary file not shown.

Binary file not shown.

View File

@ -3,7 +3,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 0.20.905 plus git\n" "Project-Id-Version: 0.20.905 plus git\n"
"POT-Creation-Date: 2011-02-27 05:51+CET\n" "POT-Creation-Date: 2011-02-27 23:57+CET\n"
"PO-Revision-Date: 2010-08-30 00:57+0200\n" "PO-Revision-Date: 2010-08-30 00:57+0200\n"
"Last-Translator: Steffen Schaumburg <steffen@schaumburger.info>\n" "Last-Translator: Steffen Schaumburg <steffen@schaumburger.info>\n"
"Language-Team: Fpdb\n" "Language-Team: Fpdb\n"
@ -3099,7 +3099,7 @@ msgstr ""
#: fpdb.pyw:38 #: fpdb.pyw:38
msgid " - press return to continue\n" msgid " - press return to continue\n"
msgstr " - drücken Sie Enter um fortzufahren" msgstr " - drücken Sie Enter um fortzufahren\n"
#: fpdb.pyw:45 #: fpdb.pyw:45
msgid "" msgid ""
@ -3133,8 +3133,9 @@ msgid "GuiStove not found. If you want to use it please install pypoker-eval."
msgstr "" msgstr ""
#: fpdb.pyw:244 #: fpdb.pyw:244
#, fuzzy
msgid "" msgid ""
"Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, " "Copyright 2008-2011, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, "
"sqlcoder, Bostik, and others" "sqlcoder, Bostik, and others"
msgstr "" msgstr ""
"Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, " "Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, "

View File

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2011-02-27 05:51+CET\n" "POT-Creation-Date: 2011-02-27 23:57+CET\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -2990,7 +2990,7 @@ msgid "GuiStove not found. If you want to use it please install pypoker-eval."
msgstr "" msgstr ""
#: fpdb.pyw:244 #: fpdb.pyw:244
msgid "Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, sqlcoder, Bostik, and others" msgid "Copyright 2008-2011, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, sqlcoder, Bostik, and others"
msgstr "" msgstr ""
#: fpdb.pyw:245 #: fpdb.pyw:245

View File

@ -1,7 +1,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: fpdb\n" "Project-Id-Version: fpdb\n"
"POT-Creation-Date: 2011-02-27 05:51+CET\n" "POT-Creation-Date: 2011-02-27 23:57+CET\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: Javier Sánchez <donoban@gmail.com>\n" "Last-Translator: Javier Sánchez <donoban@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
@ -3042,7 +3042,7 @@ msgstr ""
#: fpdb.pyw:244 #: fpdb.pyw:244
msgid "" msgid ""
"Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, " "Copyright 2008-2011, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, "
"sqlcoder, Bostik, and others" "sqlcoder, Bostik, and others"
msgstr "" msgstr ""

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 0.20.905 plus git\n" "Project-Id-Version: 0.20.905 plus git\n"
"POT-Creation-Date: 2011-02-27 05:51+CET\n" "POT-Creation-Date: 2011-02-27 23:57+CET\n"
"PO-Revision-Date: 2011-02-27 18:23+0100\n" "PO-Revision-Date: 2011-02-27 18:23+0100\n"
"Last-Translator: Ferenc Erki <erkiferenc@gmail.com>\n" "Last-Translator: Ferenc Erki <erkiferenc@gmail.com>\n"
"Language-Team: Hungarian <erkiferenc@gmail.com>\n" "Language-Team: Hungarian <erkiferenc@gmail.com>\n"
@ -3183,8 +3183,9 @@ msgstr ""
"eval-t." "eval-t."
#: fpdb.pyw:244 #: fpdb.pyw:244
#, fuzzy
msgid "" msgid ""
"Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, " "Copyright 2008-2011, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, "
"sqlcoder, Bostik, and others" "sqlcoder, Bostik, and others"
msgstr "" msgstr ""
"Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, " "Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, "

Binary file not shown.

Binary file not shown.

View File

@ -160,7 +160,7 @@
'street0_FoldTo3BDone': False, 'street0_FoldTo3BDone': False,
'street0_FoldTo4BChance': False, 'street0_FoldTo4BChance': False,
'street0_FoldTo4BDone': False, 'street0_FoldTo4BDone': False,
'street0_SqueezeChance': False, 'street0_SqueezeChance': True,
'street0_SqueezeDone': False, 'street0_SqueezeDone': False,
'street1Aggr': True, 'street1Aggr': True,
'street1Bets': 1, 'street1Bets': 1,
@ -265,7 +265,7 @@
'street0_FoldTo3BDone': False, 'street0_FoldTo3BDone': False,
'street0_FoldTo4BChance': False, 'street0_FoldTo4BChance': False,
'street0_FoldTo4BDone': False, 'street0_FoldTo4BDone': False,
'street0_SqueezeChance': False, 'street0_SqueezeChance': True,
'street0_SqueezeDone': False, 'street0_SqueezeDone': False,
'street1Aggr': False, 'street1Aggr': False,
'street1Bets': 0, 'street1Bets': 0,
@ -790,7 +790,7 @@
'street0_FoldTo3BDone': False, 'street0_FoldTo3BDone': False,
'street0_FoldTo4BChance': False, 'street0_FoldTo4BChance': False,
'street0_FoldTo4BDone': False, 'street0_FoldTo4BDone': False,
'street0_SqueezeChance': False, 'street0_SqueezeChance': True,
'street0_SqueezeDone': False, 'street0_SqueezeDone': False,
'street1Aggr': False, 'street1Aggr': False,
'street1Bets': 0, 'street1Bets': 0,
@ -895,7 +895,7 @@
'street0_FoldTo3BDone': False, 'street0_FoldTo3BDone': False,
'street0_FoldTo4BChance': False, 'street0_FoldTo4BChance': False,
'street0_FoldTo4BDone': False, 'street0_FoldTo4BDone': False,
'street0_SqueezeChance': False, 'street0_SqueezeChance': True,
'street0_SqueezeDone': False, 'street0_SqueezeDone': False,
'street1Aggr': False, 'street1Aggr': False,
'street1Bets': 0, 'street1Bets': 0,