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

Conflicts:
	pyfpdb/HUD_main.pyw
This commit is contained in:
Eric Blade 2010-09-30 01:46:48 -04:00
commit 4de792a1eb
25 changed files with 14804 additions and 14719 deletions

View File

@ -126,6 +126,7 @@ class Database:
, {'tab':'Hands', 'col':'gametypeId', 'drop':0} # mct 22/3/09
#, {'tab':'Hands', 'col':'siteHandNo', 'drop':0} unique indexes not dropped
, {'tab':'HandsActions', 'col':'handsPlayerId', 'drop':0}
, {'tab':'HandsActions', 'col':'actionId', 'drop':1}
, {'tab':'HandsPlayers', 'col':'handId', 'drop':1}
, {'tab':'HandsPlayers', 'col':'playerId', 'drop':1}
, {'tab':'HandsPlayers', 'col':'tourneysPlayersId', 'drop':0}
@ -149,6 +150,8 @@ class Database:
, {'tab':'HandsPlayers', 'col':'handId', 'drop':0}
, {'tab':'HandsPlayers', 'col':'playerId', 'drop':0}
, {'tab':'HandsPlayers', 'col':'tourneysPlayersId', 'drop':0}
, {'tab':'HandsActions', 'col':'handsPlayerId', 'drop':0}
, {'tab':'HandsActions', 'col':'actionId', 'drop':1}
, {'tab':'HudCache', 'col':'gametypeId', 'drop':1}
, {'tab':'HudCache', 'col':'playerId', 'drop':0}
, {'tab':'HudCache', 'col':'tourneyTypeId', 'drop':0}
@ -172,6 +175,7 @@ class Database:
, {'fktab':'HandsPlayers', 'fkcol':'playerId', 'rtab':'Players', 'rcol':'id', 'drop':1}
, {'fktab':'HandsPlayers', 'fkcol':'tourneysPlayersId','rtab':'TourneysPlayers','rcol':'id', 'drop':1}
, {'fktab':'HandsActions', 'fkcol':'handsPlayerId', 'rtab':'HandsPlayers', 'rcol':'id', 'drop':1}
, {'fktab':'HandsActions', 'fkcol':'actionId', 'rtab':'Actions', 'rcol':'id', 'drop':1}
, {'fktab':'HudCache', 'fkcol':'gametypeId', 'rtab':'Gametypes', 'rcol':'id', 'drop':1}
, {'fktab':'HudCache', 'fkcol':'playerId', 'rtab':'Players', 'rcol':'id', 'drop':0}
, {'fktab':'HudCache', 'fkcol':'tourneyTypeId', 'rtab':'TourneyTypes', 'rcol':'id', 'drop':1}
@ -181,6 +185,7 @@ class Database:
, {'fktab':'HandsPlayers', 'fkcol':'handId', 'rtab':'Hands', 'rcol':'id', 'drop':1}
, {'fktab':'HandsPlayers', 'fkcol':'playerId', 'rtab':'Players', 'rcol':'id', 'drop':1}
, {'fktab':'HandsActions', 'fkcol':'handsPlayerId', 'rtab':'HandsPlayers', 'rcol':'id', 'drop':1}
, {'fktab':'HandsActions', 'fkcol':'actionId', 'rtab':'Actions', 'rcol':'id', 'drop':1}
, {'fktab':'HudCache', 'fkcol':'gametypeId', 'rtab':'Gametypes', 'rcol':'id', 'drop':1}
, {'fktab':'HudCache', 'fkcol':'playerId', 'rtab':'Players', 'rcol':'id', 'drop':0}
, {'fktab':'HudCache', 'fkcol':'tourneyTypeId', 'rtab':'TourneyTypes', 'rcol':'id', 'drop':1}
@ -302,7 +307,7 @@ class Database:
tables=self.cursor.execute(self.sql.query['list_tables'])
tables=self.cursor.fetchall()
for table in (u'Autorates', u'Backings', u'Gametypes', u'Hands', u'HandsActions', u'HandsPlayers', u'HudCache', u'Players', u'RawHands', u'RawTourneys', u'Settings', u'Sites', u'TourneyTypes', u'Tourneys', u'TourneysPlayers'):
for table in (u'Actions', u'Autorates', u'Backings', u'Gametypes', u'Hands', u'HandsActions', u'HandsPlayers', u'HudCache', u'Players', u'RawHands', u'RawTourneys', u'Settings', u'Sites', u'TourneyTypes', u'Tourneys', u'TourneysPlayers'):
print "table:", table
result+="###################\nTable "+table+"\n###################\n"
rows=self.cursor.execute(self.sql.query['get'+table])
@ -1151,6 +1156,7 @@ class Database:
c.execute(self.sql.query['createSettingsTable'])
log.debug("Creating tables")
c.execute(self.sql.query['createActionsTable'])
c.execute(self.sql.query['createSitesTable'])
c.execute(self.sql.query['createGametypesTable'])
c.execute(self.sql.query['createPlayersTable'])
@ -1422,6 +1428,7 @@ class Database:
def fillDefaultData(self):
c = self.get_cursor()
c.execute("INSERT INTO Settings (version) VALUES (%s);" % (DB_VERSION))
#Fill Sites
c.execute("INSERT INTO Sites (name,code) VALUES ('Full Tilt Poker', 'FT')")
c.execute("INSERT INTO Sites (name,code) VALUES ('PokerStars', 'PS')")
c.execute("INSERT INTO Sites (name,code) VALUES ('Everleaf', 'EV')")
@ -1436,6 +1443,22 @@ class Database:
c.execute("INSERT INTO Sites (name,code) VALUES ('PKR', 'PK')")
c.execute("INSERT INTO Sites (name,code) VALUES ('iPoker', 'IP')")
c.execute("INSERT INTO Sites (name,code) VALUES ('Winamax', 'WM')")
#Fill Actions
c.execute("INSERT INTO Actions (name,code) VALUES ('ante', 'A')")
c.execute("INSERT INTO Actions (name,code) VALUES ('small blind', 'SB')")
c.execute("INSERT INTO Actions (name,code) VALUES ('secondsb', 'SSB')")
c.execute("INSERT INTO Actions (name,code) VALUES ('big blind', 'BB')")
c.execute("INSERT INTO Actions (name,code) VALUES ('both', 'SBBB')")
c.execute("INSERT INTO Actions (name,code) VALUES ('calls', 'C')")
c.execute("INSERT INTO Actions (name,code) VALUES ('raises', 'R')")
c.execute("INSERT INTO Actions (name,code) VALUES ('bets', 'B')")
c.execute("INSERT INTO Actions (name,code) VALUES ('stands pat', 'S')")
c.execute("INSERT INTO Actions (name,code) VALUES ('folds', 'F')")
c.execute("INSERT INTO Actions (name,code) VALUES ('checks', 'K')")
c.execute("INSERT INTO Actions (name,code) VALUES ('discards', 'D')")
c.execute("INSERT INTO Actions (name,code) VALUES ('bringin', 'I')")
c.execute("INSERT INTO Actions (name,code) VALUES ('completes', 'P')")
#end def fillDefaultData
def rebuild_indexes(self, start=None):
@ -1653,6 +1676,7 @@ class Database:
pp.pprint(pdata)
inserts = []
hpid = {}
for p in pdata:
inserts.append( (hid,
pids[p],
@ -1757,39 +1781,44 @@ class Database:
#print "DEBUG: inserts: %s" %inserts
#print "DEBUG: q: %s" % q
c = self.get_cursor()
if self.import_options['saveActions']:
for r in inserts:
c.execute(q, r)
hpid[(r[0], r[1])] = self.get_last_insert_id(c)
else:
c.executemany(q, inserts)
def storeHandsActions(self, hid, pids, adata, printdata = False):
return hpid
def storeHandsActions(self, hid, pids, hpid, adata, printdata = False):
#print "DEBUG: %s %s %s" %(hid, pids, adata)
if printdata:
import pprint
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(adata)
#inserts = []
#for p in pdata:
# inserts.append( (hid,
# pids[p],
# adata[p]['startCash'],
# adata[p]['seatNo'],
# adata[p]['sitout'],
# adata[p]['card1'],
#handsPlayerId BIGINT UNSIGNED NOT NULL, FOREIGN KEY (handsPlayerId) REFERENCES HandsPlayers(id),
#street SMALLINT NOT NULL,
#actionNo SMALLINT NOT NULL,
#action CHAR(5) NOT NULL,
#allIn BOOLEAN NOT NULL,
#amount INT NOT NULL,
inserts = []
for a in adata:
inserts.append( (hpid[(hid, pids[adata[a]['player']])],
#self.getHandsPlayerId(self.hid, pids[adata[a]['player']]),
adata[a]['street'],
adata[a]['actionNo'],
adata[a]['streetActionNo'],
adata[a]['actionId'],
adata[a]['amount'],
adata[a]['raiseTo'],
adata[a]['amountCalled'],
adata[a]['numDiscarded'],
adata[a]['cardsDiscarded'],
adata[a]['allIn']
) )
q = self.sql.query['store_hands_actions']
#q = q.replace('%s', self.sql.query['placeholder'])
q = q.replace('%s', self.sql.query['placeholder'])
#print "DEBUG: inserts: %s" %inserts
#print "DEBUG: q: %s" % q
#c = self.get_cursor()
#c.executemany(q, inserts)
c = self.get_cursor()
c.executemany(q, inserts)
def storeHudCache(self, gid, pids, starttime, pdata):
"""Update cached statistics. If update fails because no record exists, do an insert."""

View File

@ -23,13 +23,6 @@ import logging
# logging has been set up in fpdb.py or HUD_main.py, use their settings:
log = logging.getLogger("parser")
DEBUG = False
if DEBUG:
import pprint
pp = pprint.PrettyPrinter(indent=4)
class DerivedStats():
def __init__(self, hand):
self.hand = hand
@ -93,17 +86,9 @@ class DerivedStats():
self.assembleHands(self.hand)
self.assembleHandsPlayers(self.hand)
if DEBUG:
if self.hand.saveActions:
self.assembleHandsActions(self.hand)
if DEBUG:
#print "Hands:"
#pp.pprint(self.hands)
#print "HandsPlayers:"
#pp.pprint(self.handsplayers)
print "HandsActions:"
pp.pprint(self.handsactions)
def getHands(self):
return self.hands
@ -216,9 +201,35 @@ class DerivedStats():
# Squeeze, Ratchet?
def assembleHandsActions(self, hand):
print "DEBUG: hand.actions"
pp.pprint(hand.actions)
pass
k = 0
for i, street in enumerate(hand.actionStreets):
for j, act in enumerate(hand.actions[street]):
k += 1
self.handsactions[k] = {}
#default values
self.handsactions[k]['amount'] = 0
self.handsactions[k]['raiseTo'] = 0
self.handsactions[k]['amountCalled'] = 0
self.handsactions[k]['numDiscarded'] = 0
self.handsactions[k]['cardsDiscarded'] = None
self.handsactions[k]['allIn'] = False
#Insert values from hand.actions
self.handsactions[k]['player'] = act[0]
self.handsactions[k]['street'] = i-1
self.handsactions[k]['actionNo'] = k
self.handsactions[k]['streetActionNo'] = (j+1)
self.handsactions[k]['actionId'] = hand.ACTION[act[1]]
if act[1] not in ('discards') and len(act) > 2:
self.handsactions[k]['amount'] = int(100 * act[2])
if act[1] in ('raises', 'completes'):
self.handsactions[k]['raiseTo'] = int(100 * act[3])
self.handsactions[k]['amountCalled'] = int(100 * act[4])
if act[1] in ('discards'):
self.handsactions[k]['numDiscarded'] = int(act[2])
if act[1] in ('discards') and len(act) > 3:
self.handsactions[k]['cardsDiscarded'] = act[3]
if len(act) > 3 and act[1] not in ('discards'):
self.handsactions[k]['allIn'] = act[-1]
def setPositions(self, hand):
"""Sets the position for each player in HandsPlayers
@ -251,8 +262,8 @@ class DerivedStats():
else:
# set blinds first, then others from pfbao list, avoids problem if bb
# is missing from pfbao list or if there is no small blind
bb = [x[0] for x in hand.actions[hand.actionStreets[0]] if x[2] == 'big blind']
sb = [x[0] for x in hand.actions[hand.actionStreets[0]] if x[2] == 'small blind']
bb = [x[0] for x in hand.actions[hand.actionStreets[0]] if x[1] == 'big blind']
sb = [x[0] for x in hand.actions[hand.actionStreets[0]] if x[1] == 'small blind']
# if there are > 1 sb or bb only the first is used!
if bb:
self.handsplayers[bb[0]]['position'] = 'B'

View File

@ -49,11 +49,14 @@ class Hand(object):
LCS = {'H':'h', 'D':'d', 'C':'c', 'S':'s'}
SYMBOL = {'USD': '$', 'EUR': u'$', 'GBP': '$', 'T$': '', 'play': ''}
MS = {'horse' : 'HORSE', '8game' : '8-Game', 'hose' : 'HOSE', 'ha': 'HA'}
ACTION = {'ante': 1, 'small blind': 2, 'secondsb': 3, 'big blind': 4, 'both': 5, 'calls': 6, 'raises': 7,
'bets': 8, 'stands pat': 9, 'folds': 10, 'checks': 11, 'discards': 12, 'bringin': 13, 'completes': 14}
def __init__(self, config, sitename, gametype, handText, builtFrom = "HHC"):
#log.debug( _("Hand.init(): handText is ") + str(handText) )
self.config = config
self.saveActions = self.config.get_import_parameters().get('saveActions')
#log = Configuration.get_logger("logging.conf", "db", log_dir=self.config.dir_log)
self.sitename = sitename
self.siteId = self.config.get_site_id(sitename)
@ -65,6 +68,7 @@ class Hand(object):
self.cancelled = False
self.dbid_hands = 0
self.dbid_pids = None
self.dbid_hpid = None
self.dbid_gt = 0
self.tablename = ""
self.hero = ""
@ -262,10 +266,11 @@ db: a connected Database object"""
hh['seats'] = len(self.dbid_pids)
self.dbid_hands = db.storeHand(hh)
db.storeHandsPlayers(self.dbid_hands, self.dbid_pids, self.stats.getHandsPlayers(), printdata = printtest)
# TODO HandsActions - all actions for all players for all streets - self.actions
# HudCache data can be generated from HandsActions (HandsPlayers?)
#db.storeHandsActions(self.dbid_hands, self.dbid_pids, self.stats.getHandsActions(), printdata = printtest)
self.dbid_hpid = db.storeHandsPlayers(self.dbid_hands, self.dbid_pids,
self.stats.getHandsPlayers(), printdata = printtest)
if self.saveActions:
db.storeHandsActions(self.dbid_hands, self.dbid_pids, self.dbid_hpid,
self.stats.getHandsActions(), printdata = printtest)
else:
log.info(_("Hand.insert(): hid #: %s is a duplicate") % hh['siteHandNo'])
self.is_duplicate = True # i.e. don't update hudcache
@ -350,7 +355,7 @@ For sites (currently only Carbon Poker) which record "all in" as a special actio
ante = re.sub(u',', u'', ante) #some sites have commas
self.bets['BLINDSANTES'][player].append(Decimal(ante))
self.stacks[player] -= Decimal(ante)
act = (player, 'posts', "ante", ante, self.stacks[player]==0)
act = (player, 'ante', Decimal(ante), self.stacks[player]==0)
self.actions['BLINDSANTES'].append(act)
# self.pot.addMoney(player, Decimal(ante))
self.pot.addCommonMoney(player, Decimal(ante))
@ -369,7 +374,7 @@ For sites (currently only Carbon Poker) which record "all in" as a special actio
if player is not None:
amount = re.sub(u',', u'', amount) #some sites have commas
self.stacks[player] -= Decimal(amount)
act = (player, 'posts', blindtype, amount, self.stacks[player]==0)
act = (player, blindtype, Decimal(amount), self.stacks[player]==0)
self.actions['BLINDSANTES'].append(act)
if blindtype == 'both':
@ -402,7 +407,7 @@ For sites (currently only Carbon Poker) which record "all in" as a special actio
#self.lastBet[street] = Decimal(amount)
self.stacks[player] -= Decimal(amount)
#print "DEBUG %s calls %s, stack %s" % (player, amount, self.stacks[player])
act = (player, 'calls', amount, self.stacks[player]==0)
act = (player, 'calls', Decimal(amount), self.stacks[player]==0)
self.actions[street].append(act)
self.pot.addMoney(player, Decimal(amount))
@ -463,11 +468,11 @@ Add a raise on [street] by [player] to [amountTo]
Rb = Rt - C - Bc
self._addRaise(street, player, C, Rb, Rt)
def _addRaise(self, street, player, C, Rb, Rt):
def _addRaise(self, street, player, C, Rb, Rt, action = 'raises'):
log.debug(_("%s %s raise %s") %(street, player, Rt))
self.bets[street][player].append(C + Rb)
self.stacks[player] -= (C + Rb)
act = (player, 'raises', Rb, Rt, C, self.stacks[player]==0)
act = (player, action, Rb, Rt, C, self.stacks[player]==0)
self.actions[street].append(act)
self.lastBet[street] = Rt # TODO check this is correct
self.pot.addMoney(player, C+Rb)
@ -481,7 +486,7 @@ Add a raise on [street] by [player] to [amountTo]
self.bets[street][player].append(Decimal(amount))
self.stacks[player] -= Decimal(amount)
#print "DEBUG %s bets %s, stack %s" % (player, amount, self.stacks[player])
act = (player, 'bets', amount, self.stacks[player]==0)
act = (player, 'bets', Decimal(amount), self.stacks[player]==0)
self.actions[street].append(act)
self.lastBet[street] = Decimal(amount)
self.pot.addMoney(player, Decimal(amount))
@ -1020,7 +1025,7 @@ class DrawHand(Hand):
self.bets['DEAL'][player].append(Decimal(amount))
self.stacks[player] -= Decimal(amount)
#print "DEBUG %s posts, stack %s" % (player, self.stacks[player])
act = (player, 'posts', blindtype, amount, self.stacks[player]==0)
act = (player, blindtype, Decimal(amount), self.stacks[player]==0)
self.actions['BLINDSANTES'].append(act)
self.pot.addMoney(player, Decimal(amount))
if blindtype == 'big blind':
@ -1050,10 +1055,10 @@ class DrawHand(Hand):
def addDiscard(self, street, player, num, cards):
self.checkPlayerExists(player)
if cards:
act = (player, 'discards', num, cards)
act = (player, 'discards', Decimal(num), cards)
self.discardDrawHoleCards(cards, player, street)
else:
act = (player, 'discards', num)
act = (player, 'discards', Decimal(num))
self.actions[street].append(act)
def holecardsAsSet(self, street, player):
@ -1246,7 +1251,7 @@ Add a complete on [street] by [player] to [amountTo]
Rt = Decimal(amountTo)
C = Bp - Bc
Rb = Rt - C
self._addRaise(street, player, C, Rb, Rt)
self._addRaise(street, player, C, Rb, Rt, 'completes')
#~ self.bets[street][player].append(C + Rb)
#~ self.stacks[player] -= (C + Rb)
#~ act = (player, 'raises', Rb, Rt, C, self.stacks[player]==0)
@ -1259,7 +1264,7 @@ Add a complete on [street] by [player] to [amountTo]
log.debug(_("Bringin: %s, %s") % (player , bringin))
self.bets['THIRD'][player].append(Decimal(bringin))
self.stacks[player] -= Decimal(bringin)
act = (player, 'bringin', bringin, self.stacks[player]==0)
act = (player, 'bringin', Decimal(bringin), self.stacks[player]==0)
self.actions['THIRD'].append(act)
self.lastBet['THIRD'] = Decimal(bringin)
self.pot.addMoney(player, Decimal(bringin))

View File

@ -52,7 +52,7 @@ class PartyPoker(HandHistoryConverter):
re_GameInfoRing = re.compile("""
(?P<CURRENCY>\$|)\s*(?P<RINGLIMIT>[.,0-9]+)([.,0-9/$]+)?\s*(?:USD)?\s*
(?P<LIMIT>(NL|PL|))\s*
(?P<GAME>(Texas\ Hold\'em|Omaha))
(?P<GAME>(Texas\ Hold\'em|Omaha|7 Card Stud Hi-Lo))
\s*\-\s*
(?P<DATETIME>.+)
""", re.VERBOSE)
@ -202,6 +202,7 @@ class PartyPoker(HandHistoryConverter):
games = { # base, category
"Texas Hold'em" : ('hold','holdem'),
'Omaha' : ('hold','omahahi'),
"7 Card Stud Hi-Lo" : ('stud','studhi'),
}
currencies = { '$':'USD', '':'T$' }
@ -348,19 +349,19 @@ class PartyPoker(HandHistoryConverter):
def readPlayerStacks(self, hand):
log.debug("readPlayerStacks")
m = self.re_PlayerInfo.finditer(hand.handText)
players = []
maxKnownStack = 0
zeroStackPlayers = []
for a in m:
hand.addPlayer(int(a.group('SEAT')), a.group('PNAME'),
clearMoneyString(a.group('CASH')))
# detecting new active players without a seat
# and new active players with zero stack
if a.group('CASH') > '0':
#record max known stack for use with players with unknown stack
maxKnownStack = max(a.group('CASH'),maxKnownStack)
hand.addPlayer(int(a.group('SEAT')), a.group('PNAME'), clearMoneyString(a.group('CASH')))
else:
#zero stacked players are added later
zeroStackPlayers.append([int(a.group('SEAT')), a.group('PNAME'), clearMoneyString(a.group('CASH'))])
if hand.gametype['type'] == 'ring':
re_JoiningPlayers = re.compile(r"(?P<PLAYERNAME>.*) has joined the table")
re_BBPostingPlayers = re.compile(r"(?P<PLAYERNAME>.*) posts big blind")
seatedPlayers = list([(f[1]) for f in hand.players])
#finds first vacant seat after an exact seat
def findFirstEmptySeat(startSeat):
while startSeat in occupiedSeats:
if startSeat >= hand.maxseats:
@ -368,14 +369,25 @@ class PartyPoker(HandHistoryConverter):
startSeat += 1
return startSeat
re_JoiningPlayers = re.compile(r"(?P<PLAYERNAME>.*) has joined the table")
re_BBPostingPlayers = re.compile(r"(?P<PLAYERNAME>.*) posts big blind")
match_JoiningPlayers = re_JoiningPlayers.findall(hand.handText)
match_BBPostingPlayers = re_BBPostingPlayers.findall(hand.handText)
ringLimit = self.re_GameInfoRing.search(hand.handText).groupdict()['RINGLIMIT']
unseatedActivePlayers = list(set(match_BBPostingPlayers) - set(seatedPlayers))
for player in seatedPlayers:
if hand.stacks[player] == 0 and player in match_BBPostingPlayers:
hand.stacks[player] = Decimal(ringLimit)
#add every player with zero stack, but:
#if a zero stacked player is just joined the table in this very hand then set his stack to maxKnownStack
for p in zeroStackPlayers:
if p[1] in match_JoiningPlayers:
p[2] = clearMoneyString(maxKnownStack)
hand.addPlayer(p[0],p[1],p[2])
seatedPlayers = list([(f[1]) for f in hand.players])
#it works for all known cases as of 2010-09-28
#should be refined with using match_ActivePlayers instead of match_BBPostingPlayers
#as a leaving and rejoining player could be active without posting a BB (sample HH needed)
unseatedActivePlayers = list(set(match_BBPostingPlayers) - set(seatedPlayers))
if unseatedActivePlayers:
for player in unseatedActivePlayers:
@ -384,7 +396,7 @@ class PartyPoker(HandHistoryConverter):
occupiedSeats = list([(f[0]) for f in hand.players])
occupiedSeats.sort()
newPlayerSeat = findFirstEmptySeat(previousBBPosterSeat)
hand.addPlayer(newPlayerSeat,player,clearMoneyString(ringLimit))
hand.addPlayer(newPlayerSeat,player,clearMoneyString(maxKnownStack))
def markStreets(self, hand):
m = re.search(

View File

@ -154,6 +154,27 @@ class Sql:
rawTourney TEXT NOT NULL,
complain BOOLEAN NOT NULL DEFAULT FALSE)"""
################################
# Create Actions
################################
if db_server == 'mysql':
self.query['createActionsTable'] = """CREATE TABLE Actions (
id SMALLINT UNSIGNED AUTO_INCREMENT NOT NULL, PRIMARY KEY (id),
name varchar(32) NOT NULL,
code char(2) NOT NULL)
ENGINE=INNODB"""
elif db_server == 'postgresql':
self.query['createActionsTable'] = """CREATE TABLE Actions (
id SERIAL, PRIMARY KEY (id),
name varchar(32),
code char(2))"""
elif db_server == 'sqlite':
self.query['createActionsTable'] = """CREATE TABLE Actions (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
code TEXT NOT NULL)"""
################################
# Create Sites
################################
@ -989,11 +1010,14 @@ class Sql:
handsPlayerId BIGINT UNSIGNED NOT NULL, FOREIGN KEY (handsPlayerId) REFERENCES HandsPlayers(id),
street SMALLINT NOT NULL,
actionNo SMALLINT NOT NULL,
action CHAR(5) NOT NULL,
allIn BOOLEAN NOT NULL,
streetActionNo SMALLINT NOT NULL,
actionId SMALLINT NOT NULL, FOREIGN KEY (actionId) REFERENCES Actions(id),
amount INT NOT NULL,
comment TEXT,
commentTs DATETIME)
raiseTo INT NOT NULL,
amountCalled INT NOT NULL,
numDiscarded SMALLINT NOT NULL,
cardsDiscarded varchar(14),
allIn BOOLEAN NOT NULL)
ENGINE=INNODB"""
elif db_server == 'postgresql':
self.query['createHandsActionsTable'] = """CREATE TABLE HandsActions (
@ -1001,23 +1025,30 @@ class Sql:
handsPlayerId BIGINT, FOREIGN KEY (handsPlayerId) REFERENCES HandsPlayers(id),
street SMALLINT,
actionNo SMALLINT,
action CHAR(5),
allIn BOOLEAN,
streetActionNo SMALLINT,
actionId SMALLINT, FOREIGN KEY (actionId) REFERENCES Actions(id),
amount INT,
comment TEXT,
commentTs timestamp without time zone)"""
raiseTo INT,
amountCalled INT,
numDiscarded SMALLINT,
cardsDiscarded varchar(14),
allIn BOOLEAN)"""
elif db_server == 'sqlite':
self.query['createHandsActionsTable'] = """CREATE TABLE HandsActions (
id INTEGER PRIMARY KEY,
handsPlayerId BIGINT,
street SMALLINT,
actionNo SMALLINT,
action CHAR(5),
allIn INT,
streetActionNo SMALLINT,
actionId SMALLINT,
amount INT,
comment TEXT,
commentTs timestamp without time zone,
FOREIGN KEY (handsPlayerId) REFERENCES HandsPlayers(id)
raiseTo INT,
amountCalled INT,
numDiscarded SMALLINT,
cardsDiscarded TEXT,
allIn BOOLEAN,
FOREIGN KEY (handsPlayerId) REFERENCES HandsPlayers(id),
FOREIGN KEY (actionId) REFERENCES Actions(id) ON DELETE CASCADE
)"""
@ -4251,11 +4282,17 @@ class Sql:
handsPlayerId,
street,
actionNo,
action,
allIn,
amount
streetActionNo,
actionId,
amount,
raiseTo,
amountCalled,
numDiscarded,
cardsDiscarded,
allIn
)
VALUES (
%s, %s, %s, %s, %s,
%s, %s, %s, %s, %s,
%s
)"""

View File

@ -18,6 +18,9 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
########################################################################
import L10n
_ = L10n.get_translation()
import sys
import exceptions
@ -28,18 +31,6 @@ import Configuration
from HandHistoryConverter import *
from decimal import Decimal
import time
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
# Winamax HH Format
@ -58,7 +49,7 @@ class Winamax(HandHistoryConverter):
siteName = "Winamax"
filetype = "text"
codepage = ("utf8", "cp1252")
siteId = 5 # Needs to match id entry in Sites database
siteId = 14 # Needs to match id entry in Sites database
mixes = { } # Legal mixed games
sym = {'USD': "\$", 'CAD': "\$", 'T$': "", "EUR": "\xe2\x82\xac", "GBP": "\xa3"} # ADD Euro, Sterling, etc HERE

View File

@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 0.20.905 plus git\n"
"POT-Creation-Date: 2010-09-22 20:10+CEST\n"
"PO-Revision-Date: 2010-09-23 11:36+0200\n"
"PO-Revision-Date: 2010-09-28 15:55+0200\n"
"Last-Translator: Ferenc Erki <erkiferenc@gmail.com>\n"
"Language-Team: Hungarian <erkiferenc@gmail.com>\n"
"Language: hu\n"
@ -1449,7 +1449,7 @@ msgstr "Sessionök"
#: GuiTourneyGraphViewer.py:185
msgid "Tournaments"
msgstr "Verseny3k"
msgstr "Versenyek"
#: GuiTourneyGraphViewer.py:212 GuiTourneyGraphViewer.py:225
msgid ""