Merge branch 'master' of git://git.assembla.com/fpdb
This commit is contained in:
commit
de5a406f68
2
Makefile
2
Makefile
|
@ -1,4 +1,4 @@
|
|||
#Copyright 2009-2010 Carl Gherardi
|
||||
#Copyright 2009-2011 Carl Gherardi
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -4,4 +4,4 @@ Upstream authors: ...
|
|||
|
||||
License: AGPL3; partially GPL2 or higher
|
||||
|
||||
Copyright (C) 2008-2010 The FPDB developers
|
||||
Copyright (C) 2008-2011 The FPDB developers
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright 1999-2010 Gentoo Foundation
|
||||
# Copyright 1999-2011 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# created by Steffen Schaumburg, steffen@schaumburger.info
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
# Copyright 1999-2010 Gentoo Foundation
|
||||
# Copyright 1999-2011 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: $
|
||||
|
||||
#TODO: Header, add cdecimal
|
||||
|
||||
EAPI="2"
|
||||
|
||||
inherit eutils games
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
# Copyright 1999-2010 Gentoo Foundation
|
||||
# Copyright 1999-2011 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: $
|
||||
|
||||
#TODO: Header, add cdecimal
|
||||
|
||||
EAPI="2"
|
||||
|
||||
inherit eutils games
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
# Copyright 1999-2010 Gentoo Foundation
|
||||
# Copyright 1999-2011 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: $
|
||||
|
||||
#TODO: Header, add cdecimal
|
||||
|
||||
EAPI="2"
|
||||
|
||||
inherit eutils games git
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; Copyright 2008-2010 Michael
|
||||
; Copyright 2008-2011 Michael
|
||||
; This program is free software: you can redistribute it and/or modify
|
||||
; it under the terms of the GNU Affero General Public License as published by
|
||||
; the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
Py2exe script for fpdb.
|
||||
"""
|
||||
# Copyright 2009-2010, Ray E. Barker
|
||||
# Copyright 2009-2011, Ray E. Barker
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright 2008-2010, Carl Gherardi
|
||||
# Copyright 2008-2011, Carl Gherardi
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -136,7 +136,7 @@ class Absolute(HandHistoryConverter):
|
|||
m = self.re_GameInfo.search(handText)
|
||||
if not m:
|
||||
tmp = handText[0:100]
|
||||
log.error(_("determineGameType: Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("determineGameType: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
|
||||
|
@ -201,12 +201,12 @@ class Absolute(HandHistoryConverter):
|
|||
if m is None or fname_info is None:
|
||||
if m is None:
|
||||
tmp = hand.handText[0:100]
|
||||
logging.error(_("readHandInfo: Didn't match: '%s'") % tmp)
|
||||
raise FpdbParseError(_("Absolute: Didn't match re_HandInfo: '%s'") % tmp)
|
||||
logging.error(_("Didn't match re_HandInfo: '%s'") % tmp)
|
||||
raise FpdbParseError("Absolute: " + _("Didn't match re_HandInfo: '%s'") % tmp)
|
||||
elif fname_info is None:
|
||||
logging.error(_("readHandInfo: File name didn't match re_*InfoFromFilename"))
|
||||
logging.error(_("File name: %s") % self.in_path)
|
||||
raise FpdbParseError(_("Absolute: Didn't match re_*InfoFromFilename: '%s'") % self.in_path)
|
||||
raise FpdbParseError("Absolute: " + _("Didn't match re_*InfoFromFilename: '%s'") % self.in_path)
|
||||
|
||||
logging.debug("HID %s, Table %s" % (m.group('HID'), m.group('TABLE')))
|
||||
hand.handid = m.group('HID')
|
||||
|
@ -284,7 +284,7 @@ class Absolute(HandHistoryConverter):
|
|||
def readBringIn(self, hand):
|
||||
m = self.re_BringIn.search(hand.handText,re.DOTALL)
|
||||
if m:
|
||||
logging.debug(_("Player bringing in: %s for %s" %(m.group('PNAME'), m.group('BRINGIN'))))
|
||||
logging.debug(_("Player bringing in: %s for %s") % (m.group('PNAME'), m.group('BRINGIN')))
|
||||
hand.addBringIn(m.group('PNAME'), m.group('BRINGIN'))
|
||||
else:
|
||||
logging.warning(_("No bringin found."))
|
||||
|
@ -348,7 +348,7 @@ class Absolute(HandHistoryConverter):
|
|||
bet = action.group('BET').replace(',', '')
|
||||
hand.addComplete( street, action.group('PNAME'), bet)
|
||||
else:
|
||||
logging.debug(_("Unimplemented readAction: %s %s" %(action.group('PNAME'),action.group('ATYPE'),)))
|
||||
logging.debug(_("Unimplemented readAction: %s %s") % (action.group('PNAME'),action.group('ATYPE')))
|
||||
|
||||
|
||||
def readShowdownActions(self, hand):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2009-2010 Grigorij Indigirkin
|
||||
#Copyright 2009-2011 Grigorij Indigirkin
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2009-2010 Grigorij Indigirkin
|
||||
#Copyright 2009-2011 Grigorij Indigirkin
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2009-2010 Grigorij Indigirkin
|
||||
#Copyright 2009-2011 Grigorij Indigirkin
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2009-2010 Carl Gherardi
|
||||
#Copyright 2009-2011 Carl Gherardi
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -52,7 +52,7 @@ else:
|
|||
m = hhc.re_PlayerInfo.finditer(filecontents)
|
||||
|
||||
outfile = options.filename+".anon"
|
||||
print _("Output being written to"), outfile
|
||||
print (_("Output being written to %s") % outfile)
|
||||
|
||||
savestdout = sys.stdout
|
||||
fsock = open(outfile,"w")
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
Mucked cards display for FreePokerTools HUD.
|
||||
"""
|
||||
# Copyright 2008-2010, Ray E. Barker
|
||||
# Copyright 2008-2011, Ray E. Barker
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright 2008-2010, Carl Gherardi
|
||||
# Copyright 2008-2011, Carl Gherardi
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -73,7 +73,7 @@ class Betfair(HandHistoryConverter):
|
|||
m = self.re_GameInfo.search(handText)
|
||||
if not m:
|
||||
tmp = handText[0:100]
|
||||
log.error(_("determineGameType: Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("determineGameType: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
|
||||
|
@ -105,7 +105,7 @@ class Betfair(HandHistoryConverter):
|
|||
def readHandInfo(self, hand):
|
||||
m = self.re_HandInfo.search(hand.handText)
|
||||
if(m == None):
|
||||
log.error(_("Didn't match re_HandInfo"))
|
||||
log.error(_("No match in readHandInfo."))
|
||||
raise FpdbParseError(_("No match in readHandInfo."))
|
||||
logging.debug("HID %s, Table %s" % (m.group('HID'), m.group('TABLE')))
|
||||
hand.handid = m.group('HID')
|
||||
|
@ -157,7 +157,7 @@ class Betfair(HandHistoryConverter):
|
|||
def readBringIn(self, hand):
|
||||
m = self.re_BringIn.search(hand.handText,re.DOTALL)
|
||||
if m:
|
||||
logging.debug(_("Player bringing in: %s for %s" %(m.group('PNAME'), m.group('BRINGIN'))))
|
||||
logging.debug(_("Player bringing in: %s for %s") % (m.group('PNAME'), m.group('BRINGIN')))
|
||||
hand.addBringIn(m.group('PNAME'), m.group('BRINGIN'))
|
||||
else:
|
||||
logging.warning(_("No bringin found"))
|
||||
|
@ -196,7 +196,7 @@ class Betfair(HandHistoryConverter):
|
|||
elif action.group('ATYPE') == 'checks':
|
||||
hand.addCheck( street, action.group('PNAME'))
|
||||
else:
|
||||
sys.stderr.write( _("DEBUG: unimplemented readAction: '%s' '%s'") %(action.group('PNAME'),action.group('ATYPE'),))
|
||||
sys.stderr.write(_("DEBUG: ") + _("Unimplemented readAction: '%s' '%s'") % (action.group('PNAME'),action.group('ATYPE')))
|
||||
|
||||
|
||||
def readShowdownActions(self, hand):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright 2010, Matthew Boss
|
||||
# Copyright 2010-2011, Matthew Boss
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -127,7 +127,7 @@ or None if we fail to get the info """
|
|||
return self.info
|
||||
except AttributeError:
|
||||
tmp = handText[0:100]
|
||||
log.error(_("determineGameType: Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("determineGameType: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
|
||||
|
@ -160,7 +160,7 @@ or None if we fail to get the info """
|
|||
def readHandInfo(self, hand):
|
||||
m = self.re_HandInfo.search(hand.handText)
|
||||
if m is None:
|
||||
logging.info(_("Didn't match re_HandInfo"))
|
||||
logging.info(_("No match in readHandInfo."))
|
||||
logging.info(hand.handText)
|
||||
raise FpdbParseError(_("No match in readHandInfo."))
|
||||
logging.debug("HID %s-%s, Table %s" % (m.group('HID1'),
|
||||
|
@ -264,8 +264,8 @@ or None if we fail to get the info """
|
|||
elif action.group('ATYPE') == 'ALL_IN':
|
||||
hand.addAllIn(street, player, action.group('BET'))
|
||||
else:
|
||||
logging.debug(_("Unimplemented readAction: %s %s"
|
||||
% (action.group('PSEAT'),action.group('ATYPE'),)))
|
||||
logging.debug(_("Unimplemented readAction: %s %s")
|
||||
% (action.group('PSEAT'),action.group('ATYPE')))
|
||||
|
||||
def readShowdownActions(self, hand):
|
||||
for shows in self.re_ShowdownAction.finditer(hand.handText):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Carl Gherardi
|
||||
#Copyright 2008-2011 Carl Gherardi
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2010 Mika Bostrom
|
||||
#Copyright 2010-2011 Mika Bostrom
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Configuration.py
|
||||
|
||||
Handles HUD configuration files.
|
||||
Handles fpdb/fpdb-hud configuration files.
|
||||
"""
|
||||
# Copyright 2008-2010, Ray E. Barker
|
||||
# Copyright 2008-2011, Ray E. Barker
|
||||
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
Create and manage the database objects.
|
||||
"""
|
||||
# Copyright 2008-2010, Ray E. Barker
|
||||
# Copyright 2008-2011, Ray E. Barker
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -1116,7 +1116,7 @@ class Database:
|
|||
self.connection.set_isolation_level(1) # go back to normal isolation level
|
||||
self.commit() # seems to clear up errors if there were any in postgres
|
||||
ptime = time() - stime
|
||||
print _("prepare import took %s seconds" % ptime)
|
||||
print (_("prepare import took %s seconds") % ptime)
|
||||
#end def prepareBulkImport
|
||||
|
||||
def afterBulkImport(self):
|
||||
|
@ -1191,7 +1191,7 @@ class Database:
|
|||
self.connection.set_isolation_level(1) # go back to normal isolation level
|
||||
self.commit() # seems to clear up errors if there were any in postgres
|
||||
atime = time() - stime
|
||||
print (_("After import took %s seconds" % atime))
|
||||
print (_("After import took %s seconds") % atime)
|
||||
#end def afterBulkImport
|
||||
|
||||
def drop_referential_integrity(self):
|
||||
|
@ -2360,8 +2360,9 @@ class Database:
|
|||
|
||||
def createOrUpdateTourney(self, hand, source):#note: this method is used on Hand and TourneySummary objects
|
||||
cursor = self.get_cursor()
|
||||
cursor.execute (self.sql.query['getTourneyByTourneyNo'].replace('%s', self.sql.query['placeholder']),
|
||||
(hand.siteId, hand.tourNo))
|
||||
q = self.sql.query['getTourneyByTourneyNo'].replace('%s', self.sql.query['placeholder'])
|
||||
cursor.execute(q, (hand.siteId, hand.tourNo))
|
||||
|
||||
columnNames=[desc[0] for desc in cursor.description]
|
||||
result=cursor.fetchone()
|
||||
|
||||
|
@ -2386,9 +2387,12 @@ class Database:
|
|||
# if (resultDict[ev] < hand.startTime):
|
||||
# hand.startTime=resultDict[ev]
|
||||
if updateDb:
|
||||
cursor.execute (self.sql.query['updateTourney'].replace('%s', self.sql.query['placeholder']),
|
||||
(hand.entries, hand.prizepool, hand.startTime, hand.endTime, hand.tourneyName,
|
||||
hand.matrixIdProcessed, hand.totalRebuyCount, hand.totalAddOnCount, hand.comment, hand.commentTs, tourneyId))
|
||||
q = self.sql.query['updateTourney'].replace('%s', self.sql.query['placeholder'])
|
||||
row = (hand.entries, hand.prizepool, hand.startTime, hand.endTime, hand.tourneyName,
|
||||
hand.matrixIdProcessed, hand.totalRebuyCount, hand.totalAddOnCount, hand.comment,
|
||||
hand.commentTs, tourneyId
|
||||
)
|
||||
cursor.execute(q, row)
|
||||
else:
|
||||
if source=="HHC":
|
||||
cursor.execute (self.sql.query['insertTourney'].replace('%s', self.sql.query['placeholder']),
|
||||
|
@ -2437,9 +2441,19 @@ class Database:
|
|||
elif getattr(hand, handAttribute)[player]!=None and resultDict[ev]==None:#object has this value but DB doesnt, so update DB
|
||||
updateDb=True
|
||||
if updateDb:
|
||||
cursor.execute (self.sql.query['updateTourneysPlayer'].replace('%s', self.sql.query['placeholder']),
|
||||
(hand.ranks[player], hand.winnings[player], hand.winningsCurrency[player],
|
||||
hand.rebuyCounts[player], hand.addOnCounts[player], hand.koCounts[player], tourneysPlayersIds[player[1]]))
|
||||
q = self.sql.query['updateTourneysPlayer'].replace('%s', self.sql.query['placeholder'])
|
||||
inputs = (hand.ranks[player],
|
||||
hand.winnings[player],
|
||||
hand.winningsCurrency[player],
|
||||
hand.rebuyCounts[player],
|
||||
hand.addOnCounts[player],
|
||||
hand.koCounts[player],
|
||||
tourneysPlayersIds[player[1]]
|
||||
)
|
||||
#print q
|
||||
#pp = pprint.PrettyPrinter(indent=4)
|
||||
#pp.pprint(inputs)
|
||||
cursor.execute(q, inputs)
|
||||
else:
|
||||
if source=="HHC":
|
||||
cursor.execute (self.sql.query['insertTourneysPlayer'].replace('%s', self.sql.query['placeholder']),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Carl Gherardi
|
||||
#Copyright 2008-2011 Carl Gherardi
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright 2011, Carl Gherardi
|
||||
# Copyright 2010-2011, Carl Gherardi
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -98,12 +98,13 @@ class Everest(HandHistoryConverter):
|
|||
return self.info
|
||||
except AttributeError:
|
||||
tmp = handText[0:100]
|
||||
log.error(_("determineGameType: Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("determineGameType: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
|
||||
if not m2:
|
||||
tmp = handText[0:100]
|
||||
log.error(_("determineGameType: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("Unable to recognise handinfo from: '%s'") % tmp)
|
||||
|
||||
self.info = {}
|
||||
|
@ -141,7 +142,7 @@ class Everest(HandHistoryConverter):
|
|||
def readHandInfo(self, hand):
|
||||
m = self.re_HandInfo.search(hand.handText)
|
||||
if m is None:
|
||||
logging.info(_("Didn't match re_HandInfo"))
|
||||
logging.info(_("No match in readHandInfo."))
|
||||
logging.info(hand.handText)
|
||||
raise FpdbParseError(_("No match in readHandInfo."))
|
||||
hand.handid = m.group('HID')
|
||||
|
@ -230,9 +231,9 @@ class Everest(HandHistoryConverter):
|
|||
elif action.group('ATYPE') in ('FOLD', 'SIT_OUT'):
|
||||
hand.addFold(street, player)
|
||||
else:
|
||||
print (_("Unimplemented readAction: %s %s" % (action.group('PSEAT'),action.group('ATYPE'),)))
|
||||
logging.debug(_("Unimplemented readAction: %s %s"
|
||||
% (action.group('PSEAT'),action.group('ATYPE'),)))
|
||||
print (_("Unimplemented readAction: %s %s") % (action.group('PSEAT'),action.group('ATYPE')))
|
||||
logging.debug(_("Unimplemented readAction: %s %s")
|
||||
% (action.group('PSEAT'),action.group('ATYPE')))
|
||||
|
||||
def readShowdownActions(self, hand):
|
||||
for shows in self.re_ShowdownAction.finditer(hand.handText):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright 2008-2010, Carl Gherardi
|
||||
# Copyright 2008-2011, Carl Gherardi
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -107,7 +107,7 @@ or None if we fail to get the info """
|
|||
m = self.re_GameInfo.search(handText)
|
||||
if not m:
|
||||
tmp = handText[0:100]
|
||||
log.error(_("determineGameType: Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("determineGameType: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
|
||||
|
@ -285,7 +285,7 @@ or None if we fail to get the info """
|
|||
elif action.group('ATYPE') == ' complete to':
|
||||
hand.addComplete( street, action.group('PNAME'), action.group('BET'))
|
||||
else:
|
||||
logging.debug(_("Unimplemented readAction: %s %s" %(action.group('PNAME'),action.group('ATYPE'),)))
|
||||
logging.debug(_("Unimplemented readAction: %s %s") % (action.group('PNAME'),action.group('ATYPE')))
|
||||
|
||||
|
||||
def readShowdownActions(self, hand):
|
||||
|
@ -294,7 +294,7 @@ or None if we fail to get the info """
|
|||
for shows in self.re_ShowdownAction.finditer(hand.handText):
|
||||
cards = shows.group('CARDS')
|
||||
cards = cards.split(', ')
|
||||
logging.debug(_("readShowdownActions %s %s" %(cards, shows.group('PNAME'))))
|
||||
logging.debug(_("readShowdownActions %s %s") % (cards, shows.group('PNAME')))
|
||||
hand.addShownCards(cards, shows.group('PNAME'))
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2009-2010 Matt Turnbull
|
||||
#Copyright 2009-2011 Matt Turnbull
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Steffen Schaumburg
|
||||
#Copyright 2008-2011 Steffen Schaumburg
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -77,7 +77,7 @@ class Filters(threading.Thread):
|
|||
self.mainVBox = gtk.VBox(False, 0)
|
||||
self.sw.add_with_viewport(self.mainVBox)
|
||||
self.sw.show()
|
||||
print _("DEBUG: New packing box created!")
|
||||
print(_("DEBUG: ") + _("New packing box created!"))
|
||||
|
||||
self.found = {'nl':False, 'fl':False, 'pl':False, 'cn':False, 'ring':False, 'tour':False}
|
||||
self.label = {}
|
||||
|
@ -630,7 +630,7 @@ class Filters(threading.Thread):
|
|||
lbl_title = gtk.Label(self.filterText['playerstitle'])
|
||||
lbl_title.set_alignment(xalign=0.0, yalign=0.5)
|
||||
top_hbox.pack_start(lbl_title, expand=True, padding=3)
|
||||
showb = gtk.Button(label="refresh", stock=None, use_underline=True)
|
||||
showb = gtk.Button(label=_("Refresh"), stock=None, use_underline=True)
|
||||
showb.set_alignment(xalign=1.0, yalign=0.5)
|
||||
showb.connect('clicked', self.__refresh, 'players')
|
||||
|
||||
|
@ -676,7 +676,7 @@ class Filters(threading.Thread):
|
|||
lbl_title.set_alignment(xalign=0.0, yalign=0.5)
|
||||
top_hbox.pack_start(lbl_title, expand=True, padding=3)
|
||||
|
||||
showb = gtk.Button(label="hide", stock=None, use_underline=True)
|
||||
showb = gtk.Button(label=_("hide"), stock=None, use_underline=True)
|
||||
showb.set_alignment(xalign=1.0, yalign=0.5)
|
||||
showb.connect('clicked', self.__toggle_box, 'sites')
|
||||
showb.show()
|
||||
|
@ -705,7 +705,7 @@ class Filters(threading.Thread):
|
|||
lbl_title = gtk.Label(self.filterText['tourneyTypesTitle'])
|
||||
lbl_title.set_alignment(xalign=0.0, yalign=0.5)
|
||||
top_hbox.pack_start(lbl_title, expand=True, padding=3)
|
||||
showb = gtk.Button(label="hide", stock=None, use_underline=True)
|
||||
showb = gtk.Button(label=_("hide"), stock=None, use_underline=True)
|
||||
showb.set_alignment(xalign=1.0, yalign=0.5)
|
||||
showb.connect('clicked', self.__toggle_box, 'tourneyTypes')
|
||||
top_hbox.pack_start(showb, expand=False, padding=1)
|
||||
|
@ -731,7 +731,7 @@ class Filters(threading.Thread):
|
|||
lbl_title = gtk.Label(self.filterText['gamestitle'])
|
||||
lbl_title.set_alignment(xalign=0.0, yalign=0.5)
|
||||
top_hbox.pack_start(lbl_title, expand=True, padding=3)
|
||||
showb = gtk.Button(label="hide", stock=None, use_underline=True)
|
||||
showb = gtk.Button(label=_("hide"), stock=None, use_underline=True)
|
||||
showb.set_alignment(xalign=1.0, yalign=0.5)
|
||||
showb.connect('clicked', self.__toggle_box, 'games')
|
||||
top_hbox.pack_start(showb, expand=False, padding=1)
|
||||
|
@ -758,7 +758,7 @@ class Filters(threading.Thread):
|
|||
lbl_title = gtk.Label(self.filterText['limitstitle'])
|
||||
lbl_title.set_alignment(xalign=0.0, yalign=0.5)
|
||||
top_hbox.pack_start(lbl_title, expand=True, padding=3)
|
||||
showb = gtk.Button(label="hide", stock=None, use_underline=True)
|
||||
showb = gtk.Button(label=_("hide"), stock=None, use_underline=True)
|
||||
showb.set_alignment(xalign=1.0, yalign=0.5)
|
||||
showb.connect('clicked', self.__toggle_box, 'limits')
|
||||
top_hbox.pack_start(showb, expand=False, padding=1)
|
||||
|
@ -872,7 +872,7 @@ class Filters(threading.Thread):
|
|||
title = gtk.Label(_("Graphing Options:"))
|
||||
title.set_alignment(xalign=0.0, yalign=0.5)
|
||||
top_hbox.pack_start(title, expand=True, padding=3)
|
||||
showb = gtk.Button(label="hide", stock=None, use_underline=True)
|
||||
showb = gtk.Button(label=_("hide"), stock=None, use_underline=True)
|
||||
showb.set_alignment(xalign=1.0, yalign=0.5)
|
||||
showb.connect('clicked', self.__toggle_box, 'graphops')
|
||||
top_hbox.pack_start(showb, expand=False, padding=1)
|
||||
|
@ -923,7 +923,7 @@ class Filters(threading.Thread):
|
|||
lbl_title = gtk.Label(self.filterText['seatstitle'])
|
||||
lbl_title.set_alignment(xalign=0.0, yalign=0.5)
|
||||
hbox.pack_start(lbl_title, expand=True, padding=3)
|
||||
showb = gtk.Button(label="hide", stock=None, use_underline=True)
|
||||
showb = gtk.Button(label=_("hide"), stock=None, use_underline=True)
|
||||
showb.set_alignment(xalign=1.0, yalign=0.5)
|
||||
showb.connect('clicked', self.__toggle_box, 'seats')
|
||||
hbox.pack_start(showb, expand=False, padding=1)
|
||||
|
@ -957,7 +957,7 @@ class Filters(threading.Thread):
|
|||
lbl_title = gtk.Label(self.filterText['groupstitle'])
|
||||
lbl_title.set_alignment(xalign=0.0, yalign=0.5)
|
||||
hbox.pack_start(lbl_title, expand=True, padding=3)
|
||||
showb = gtk.Button(label="hide", stock=None, use_underline=True)
|
||||
showb = gtk.Button(label=_("hide"), stock=None, use_underline=True)
|
||||
showb.set_alignment(xalign=1.0, yalign=0.5)
|
||||
showb.connect('clicked', self.__toggle_box, 'groups')
|
||||
hbox.pack_start(showb, expand=False, padding=1)
|
||||
|
@ -1015,7 +1015,7 @@ class Filters(threading.Thread):
|
|||
lbl_title = gtk.Label(self.filterText['datestitle'])
|
||||
lbl_title.set_alignment(xalign=0.0, yalign=0.5)
|
||||
top_hbox.pack_start(lbl_title, expand=True, padding=3)
|
||||
showb = gtk.Button(label="hide", stock=None, use_underline=True)
|
||||
showb = gtk.Button(label=_("hide"), stock=None, use_underline=True)
|
||||
showb.set_alignment(xalign=1.0, yalign=0.5)
|
||||
showb.connect('clicked', self.__toggle_box, 'dates')
|
||||
top_hbox.pack_start(showb, expand=False, padding=1)
|
||||
|
@ -1065,10 +1065,10 @@ class Filters(threading.Thread):
|
|||
def __toggle_box(self, widget, entry):
|
||||
if self.boxes[entry].props.visible:
|
||||
self.boxes[entry].hide()
|
||||
widget.set_label("show")
|
||||
widget.set_label(_("show"))
|
||||
else:
|
||||
self.boxes[entry].show()
|
||||
widget.set_label("hide")
|
||||
widget.set_label(_("hide"))
|
||||
#end def __toggle_box
|
||||
|
||||
def __calendar_dialog(self, widget, entry):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Steffen Schaumburg
|
||||
#Copyright 2008-2011 Steffen Schaumburg
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright 2008-2010, Carl Gherardi
|
||||
# Copyright 2008-2011, Carl Gherardi
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -74,7 +74,7 @@ class Fulltilt(HandHistoryConverter):
|
|||
(Ante\s\$?(?P<ANTE>[%(NUM)s]+)\s)?-\s
|
||||
[%(LS)s]?(?P<CAP>[%(NUM)s]+\sCap\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)
|
||||
re_SplitHands = re.compile(r"\n\n\n+")
|
||||
re_TailSplitHands = re.compile(r"(\n\n+)")
|
||||
|
@ -114,7 +114,7 @@ class Fulltilt(HandHistoryConverter):
|
|||
(\((?P<TURBO1>Turbo)\)\s)?
|
||||
\((?P<TOURNO>\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<LIMIT>(No\sLimit|Pot\sLimit|Limit))?
|
||||
''' % substitutions, re.VERBOSE)
|
||||
|
@ -208,8 +208,8 @@ class Fulltilt(HandHistoryConverter):
|
|||
m = self.re_GameInfo.search(handText)
|
||||
if not m:
|
||||
tmp = handText[0:100]
|
||||
log.error(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("determineGameType: Raising FpdbParseError for file '%s'") % self.in_path)
|
||||
log.error(_("determineGameType: Unable to recognise gametype from: '%s'") % tmp)
|
||||
raise FpdbParseError(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
mg = m.groupdict()
|
||||
|
||||
|
@ -218,6 +218,7 @@ class Fulltilt(HandHistoryConverter):
|
|||
games = { # base, category
|
||||
"Hold'em" : ('hold','holdem'),
|
||||
'Omaha Hi' : ('hold','omahahi'),
|
||||
'Omaha' : ('hold','omahahi'),
|
||||
'Omaha H/L' : ('hold','omahahilo'),
|
||||
'Razz' : ('stud','razz'),
|
||||
'Stud Hi' : ('stud','studhi'),
|
||||
|
@ -247,7 +248,7 @@ class Fulltilt(HandHistoryConverter):
|
|||
info['sb'] = self.Lim_Blinds[mg['BB']][0]
|
||||
info['bb'] = self.Lim_Blinds[mg['BB']][1]
|
||||
except KeyError:
|
||||
log.error(_("determineGameType: Lim_Blinds has no lookup for '%s'" % mg['BB']))
|
||||
log.error(_("Lim_Blinds has no lookup for '%s'") % mg['BB'])
|
||||
log.error(_("determineGameType: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("Lim_Blinds has no lookup for '%s'") % mg['BB'])
|
||||
|
||||
|
@ -262,8 +263,9 @@ class Fulltilt(HandHistoryConverter):
|
|||
m = self.re_HandInfo.search(hand.handText)
|
||||
if m is None:
|
||||
tmp = hand.handText[0:100]
|
||||
log.error(_("readHandInfo: Unable to recognise handinfo from: '%s'") % tmp)
|
||||
raise FpdbParseError(_("No match in readHandInfo."))
|
||||
log.error(_("Unable to recognise handinfo from: '%s'") % tmp)
|
||||
log.error(_("readHandInfo: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("Unable to recognise handinfo from: '%s'"))
|
||||
|
||||
#print "DEBUG: m.groupdict: %s" % m.groupdict()
|
||||
hand.handid = m.group('HID')
|
||||
|
@ -362,6 +364,10 @@ class Fulltilt(HandHistoryConverter):
|
|||
seat, stack = plist[a]
|
||||
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):
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Steffen Schaumburg
|
||||
#Copyright 2008-2011 Steffen Schaumburg
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -200,7 +200,7 @@ class GuiAutoImport (threading.Thread):
|
|||
for site in the_sites:
|
||||
params = self.config.get_site_parameters(site)
|
||||
if params['enabled'] == True:
|
||||
print "DEBUG: Detecting hh directory for site: '%s'" % site
|
||||
print (_("DEBUG: ") + _("Detecting hh directory for site: '%s'") % site)
|
||||
if os.name == 'posix':
|
||||
if self.posix_detect_hh_dirs(site):
|
||||
#data[1].set_text(dia_chooser.get_filename())
|
||||
|
@ -313,7 +313,7 @@ class GuiAutoImport (threading.Thread):
|
|||
#enabling and disabling sites from this interface not possible
|
||||
#expects a box to layout the line horizontally
|
||||
def createSiteLine(self, hbox1, hbox2, site, iconpath, hhpath, filter_name, active = True):
|
||||
label = gtk.Label("%s auto-import:" % site)
|
||||
label = gtk.Label(_("%s auto-import:") % site)
|
||||
hbox1.pack_start(label, False, False, 3)
|
||||
label.show()
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Steffen Schaumburg
|
||||
#Copyright 2008-2011 Steffen Schaumburg
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -203,7 +203,7 @@ class GuiBulkImport():
|
|||
if not self.allowThreads:
|
||||
self.spin_threads.set_sensitive(False)
|
||||
|
||||
# checkbox - fail on error?
|
||||
# checkbox - archive file?
|
||||
self.is_archive = gtk.CheckButton(_('Archive File'))
|
||||
self.table.attach(self.is_archive, 0, 1, 1, 2, xpadding=10, ypadding=0, yoptions=gtk.SHRINK)
|
||||
self.is_archive.show()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Carl Gherardi
|
||||
#Copyright 2008-2011 Carl Gherardi
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -478,7 +478,7 @@ class AddDB(gtk.Dialog):
|
|||
|
||||
def run(self):
|
||||
response = super(AddDB,self).run()
|
||||
log.debug(_("addDB.run: response is %s accept is %s" % (str(response), str(int(gtk.RESPONSE_ACCEPT)))))
|
||||
log.debug(_("addDB.run: response is %s accept is %s") % (str(response), str(int(gtk.RESPONSE_ACCEPT))))
|
||||
|
||||
ok,retry = False,True
|
||||
while response == gtk.RESPONSE_ACCEPT:
|
||||
|
@ -579,7 +579,7 @@ class AddDB(gtk.Dialog):
|
|||
dia.vbox.add(l)
|
||||
dia.show_all()
|
||||
ret = dia.run()
|
||||
log.debug(_("check_fields: ret is %s cancel is %s" % (str(ret), str(int(gtk.RESPONSE_CANCEL)))))
|
||||
log.debug(_("check_fields: ret is %s cancel is %s") % (str(ret), str(int(gtk.RESPONSE_CANCEL))))
|
||||
if ret == gtk.RESPONSE_YES:
|
||||
try_again = True
|
||||
log.debug(_("check_fields: destroy dialog"))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Steffen Schaumburg
|
||||
#Copyright 2008-2011 Steffen Schaumburg
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -228,7 +228,7 @@ class GuiGraphViewer (threading.Thread):
|
|||
#TODO: Do something useful like alert user
|
||||
#print "No hands returned by graph query"
|
||||
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
|
||||
self.ax.plot(green, color='green', label=_('Hands: %d\nProfit (%s): %.2f') %(len(green),graphops['dspin'], green[-1]))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2010 Steffen Schaumburg
|
||||
#Copyright 2010-2011 Steffen Schaumburg
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Carl Gherardi
|
||||
#Copyright 2008-2011 Carl Gherardi
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -35,10 +35,10 @@ log = logging.getLogger("logview")
|
|||
|
||||
MAX_LINES = 100000 # max lines to display in window
|
||||
EST_CHARS_PER_LINE = 150 # used to guesstimate number of lines in log file
|
||||
LOGFILES = [ [ 'Fpdb Errors', 'fpdb-errors.txt', False ] # label, filename, start value
|
||||
, [ 'Fpdb Log', 'fpdb-log.txt', True ]
|
||||
, [ 'HUD Errors', 'HUD-errors.txt', False ]
|
||||
, [ 'HUD Log', 'HUD-log.txt', False ]
|
||||
LOGFILES = [ [ _('Fpdb Errors'), 'fpdb-errors.txt', False ] # label, filename, start value
|
||||
, [ _('Fpdb Log'), 'fpdb-log.txt', True ]
|
||||
, [ _('HUD Errors'), 'HUD-errors.txt', False ]
|
||||
, [ _('HUD Log'), 'HUD-log.txt', False ]
|
||||
]
|
||||
|
||||
class GuiLogView:
|
||||
|
@ -95,10 +95,10 @@ class GuiLogView:
|
|||
self.vbox.show()
|
||||
self.dia.set_focus(self.listview)
|
||||
|
||||
col = self.addColumn("Date/Time", 0)
|
||||
col = self.addColumn("Module", 1)
|
||||
col = self.addColumn("Level", 2)
|
||||
col = self.addColumn("Text", 3)
|
||||
col = self.addColumn(_("Date/Time"), 0)
|
||||
col = self.addColumn(_("Module"), 1)
|
||||
col = self.addColumn(_("Level"), 2)
|
||||
col = self.addColumn(_("Text"), 3)
|
||||
|
||||
self.loadLog()
|
||||
self.vbox.show_all()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2010 Steffen Schaumburg
|
||||
#Copyright 2010-2011 Steffen Schaumburg
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Steffen Schaumburg
|
||||
#Copyright 2008-2011 Steffen Schaumburg
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -60,7 +60,7 @@ class GuiPositionalStats (threading.Thread):
|
|||
}
|
||||
|
||||
self.filters = Filters.Filters(self.db, self.conf, self.sql, display = filters_display)
|
||||
self.filters.registerButton1Name("Refresh")
|
||||
self.filters.registerButton1Name(_("Refresh"))
|
||||
self.filters.registerButton1Callback(self.refreshStats)
|
||||
|
||||
# ToDo: store in config
|
||||
|
@ -134,7 +134,7 @@ class GuiPositionalStats (threading.Thread):
|
|||
def toggleCallback(self, widget, data=None):
|
||||
# print "%s was toggled %s" % (data, ("OFF", "ON")[widget.get_active()])
|
||||
self.activesite = data
|
||||
print _("DEBUG: activesite set to %s") %(self.activesite)
|
||||
print (_("DEBUG: ") + _("activesite set to %s") % (self.activesite))
|
||||
|
||||
def refreshStats(self, widget, data):
|
||||
try: self.stats_vbox.destroy()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Carl Gherardi
|
||||
#Copyright 2008-2011 Carl Gherardi
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -28,18 +28,18 @@ import gobject
|
|||
|
||||
import Configuration
|
||||
|
||||
rewrite = { 'general' : 'General', 'supported_databases' : 'Databases'
|
||||
, 'import' : 'Import', 'hud_ui' : 'HUD'
|
||||
, 'supported_sites' : 'Sites', 'supported_games' : 'Games'
|
||||
, 'popup_windows' : 'Popup Windows', 'pu' : 'Window'
|
||||
, 'pu_name' : 'Popup Name', 'pu_stat' : 'Stat'
|
||||
, 'pu_stat_name' : 'Stat Name'
|
||||
, 'aux_windows' : 'Auxiliary Windows', 'aw stud_mucked' : 'stud_mucked'
|
||||
, 'aw mucked' : 'mucked', 'hhcs' : 'Hand History Converters'
|
||||
, 'gui_cash_stats' : 'Ring Player Stats', 'field_type' : 'Field Type'
|
||||
, 'col_title' : 'Column Heading', 'xalignment' : 'Left/Right Align'
|
||||
, 'disp_all' : 'Show in Summaries', 'disp_posn' : 'Show in Position Stats'
|
||||
, 'col_name' : 'Stat Name', 'field_format' : 'Format'
|
||||
rewrite = { 'general' : _('General'), 'supported_databases' : _('Databases')
|
||||
, 'import' : _('Import'), 'hud_ui' : _('HUD')
|
||||
, 'supported_sites' : _('Sites'), 'supported_games' : _('Games')
|
||||
, 'popup_windows' : _('Popup Windows'), 'pu' : _('Window')
|
||||
, 'pu_name' : _('Popup Name'), 'pu_stat' : _('Stat')
|
||||
, 'pu_stat_name' : _('Stat Name')
|
||||
, 'aux_windows' : _('Auxiliary Windows'), 'aw stud_mucked' : _('stud_mucked')
|
||||
, 'aw mucked' : _('mucked'), 'hhcs' : _('Hand History Converters')
|
||||
, 'gui_cash_stats' : _('Ring Player Stats'), 'field_type' : _('Field Type')
|
||||
, 'col_title' : _('Column Heading'), 'xalignment' : _('Left/Right Align')
|
||||
, 'disp_all' : _('Show in Summaries'), 'disp_posn' : _('Show in Position Stats')
|
||||
, 'col_name' : _('Stat Name'), 'field_format' : _('Format')
|
||||
}
|
||||
|
||||
class GuiPrefs:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2010 Maxime Grandchamp
|
||||
#Copyright 2010-2011 Maxime Grandchamp
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Steffen Schaumburg
|
||||
#Copyright 2008-2011 Steffen Schaumburg
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -120,7 +120,7 @@ class GuiRingPlayerStats (GuiPlayerStats.GuiPlayerStats):
|
|||
settings.update(self.conf.get_default_paths())
|
||||
|
||||
# text used on screen stored here so that it can be configured
|
||||
self.filterText = {'handhead':'Hand Breakdown for all levels listed above'
|
||||
self.filterText = {'handhead':_('Hand Breakdown for all levels listed above')
|
||||
}
|
||||
|
||||
filters_display = { "Heroes" : True,
|
||||
|
@ -140,9 +140,9 @@ class GuiRingPlayerStats (GuiPlayerStats.GuiPlayerStats):
|
|||
}
|
||||
|
||||
self.filters = Filters.Filters(self.db, self.conf, self.sql, display = filters_display)
|
||||
self.filters.registerButton1Name("_Filters")
|
||||
self.filters.registerButton1Name(_("_Filters"))
|
||||
self.filters.registerButton1Callback(self.showDetailFilter)
|
||||
self.filters.registerButton2Name("_Refresh Stats")
|
||||
self.filters.registerButton2Name(_("_Refresh Stats"))
|
||||
self.filters.registerButton2Callback(self.refreshStats)
|
||||
|
||||
# ToDo: store in config
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Steffen Schaumburg
|
||||
#Copyright 2008-2011 Steffen Schaumburg
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Steffen Schaumburg
|
||||
#Copyright 2008-2011 Steffen Schaumburg
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -94,14 +94,14 @@ class GuiStove():
|
|||
return combobox
|
||||
|
||||
def createDrawTab(self):
|
||||
tab_title = "Draw"
|
||||
tab_title = _("Draw")
|
||||
label = gtk.Label(tab_title)
|
||||
|
||||
ddbox = gtk.VBox(False, 0)
|
||||
self.notebook.append_page(ddbox, label)
|
||||
|
||||
def createStudTab(self):
|
||||
tab_title = "Stud"
|
||||
tab_title = _("Stud")
|
||||
label = gtk.Label(tab_title)
|
||||
|
||||
ddbox = gtk.VBox(False, 0)
|
||||
|
@ -112,7 +112,7 @@ class GuiStove():
|
|||
# / gamehbox / in_frame / table /
|
||||
# / out_frame
|
||||
|
||||
tab_title = "Flop"
|
||||
tab_title = _("Flop")
|
||||
label = gtk.Label(tab_title)
|
||||
|
||||
ddbox = gtk.VBox(False, 0)
|
||||
|
@ -131,17 +131,17 @@ class GuiStove():
|
|||
flop_games_cb = self.create_combo_box(games)
|
||||
players_cb = self.create_combo_box(players)
|
||||
|
||||
label = gtk.Label("Gametype:")
|
||||
label = gtk.Label(_("Gametype:"))
|
||||
ddhbox.add(label)
|
||||
ddhbox.add(flop_games_cb)
|
||||
label = gtk.Label("Players:")
|
||||
label = gtk.Label(_("Players:"))
|
||||
ddhbox.add(label)
|
||||
ddhbox.add(players_cb)
|
||||
|
||||
# Frames for Stove input and output
|
||||
|
||||
in_frame = gtk.Frame("Input:")
|
||||
out_frame = gtk.Frame("Output:")
|
||||
in_frame = gtk.Frame(_("Input:"))
|
||||
out_frame = gtk.Frame(_("Output:"))
|
||||
|
||||
gamehbox.add(in_frame)
|
||||
gamehbox.add(out_frame)
|
||||
|
@ -167,7 +167,7 @@ Against the range: {
|
|||
|
||||
# Input Frame
|
||||
table = gtk.Table(4, 5, True)
|
||||
label = gtk.Label("Board:")
|
||||
label = gtk.Label(_("Board:"))
|
||||
board = gtk.Entry()
|
||||
board.connect("changed", self.set_board_flop, board)
|
||||
|
||||
|
@ -179,7 +179,7 @@ Against the range: {
|
|||
table.attach(btn1, 2, 3, 0, 1, xoptions=gtk.SHRINK, yoptions=gtk.SHRINK)
|
||||
|
||||
|
||||
label = gtk.Label("Player1:")
|
||||
label = gtk.Label(_("Player1:"))
|
||||
board = gtk.Entry()
|
||||
board.connect("changed", self.set_hero_cards_flop, board)
|
||||
btn2 = gtk.Button()
|
||||
|
@ -194,7 +194,7 @@ Against the range: {
|
|||
table.attach(btn3, 3, 4, 1, 2, xoptions=gtk.SHRINK, yoptions=gtk.SHRINK)
|
||||
|
||||
|
||||
label = gtk.Label("Player2:")
|
||||
label = gtk.Label(_("Player2:"))
|
||||
board = gtk.Entry()
|
||||
board.connect("changed", self.set_villain_cards_flop, board)
|
||||
btn4 = gtk.Button()
|
||||
|
@ -208,7 +208,7 @@ Against the range: {
|
|||
table.attach(btn4, 2, 3, 2, 3, xoptions=gtk.SHRINK, yoptions=gtk.SHRINK)
|
||||
table.attach(btn5, 3, 4, 2, 3, xoptions=gtk.SHRINK, yoptions=gtk.SHRINK)
|
||||
|
||||
btn6 = gtk.Button("Results")
|
||||
btn6 = gtk.Button(_("Results"))
|
||||
btn6.connect("pressed", self.update_flop_output_pane, btn6)
|
||||
table.attach(btn6, 0, 1, 3, 4, xoptions=gtk.SHRINK, yoptions=gtk.SHRINK)
|
||||
|
||||
|
@ -218,25 +218,25 @@ Against the range: {
|
|||
self.outputlabel.set_text(string)
|
||||
|
||||
def set_board_flop(self, caller, widget):
|
||||
print "DEBUG: called set_board_flop: '%s' '%s'" %(caller ,widget)
|
||||
print (_("DEBUG: ") + _("called set_board_flop: '%s' '%s'") % (caller ,widget))
|
||||
self.boardtext = widget.get_text()
|
||||
|
||||
def set_hero_cards_flop(self, caller, widget):
|
||||
print "DEBUG: called set_hero_cards_flop"
|
||||
print (_("DEBUG: ") + _("called set_hero_cards_flop"))
|
||||
self.herorange = widget.get_text()
|
||||
|
||||
def set_villain_cards_flop(self, caller, widget):
|
||||
print "DEBUG: called set_villain_cards_flop"
|
||||
print (_("DEBUG: ") + _("called set_villain_cards_flop"))
|
||||
self.villainrange = widget.get_text()
|
||||
|
||||
def update_flop_output_pane(self, caller, widget):
|
||||
print "DEBUG: called update_flop_output_pane"
|
||||
print (_("DEBUG: ") + _("called update_flop_output_pane"))
|
||||
self.stove.set_board_string(self.boardtext)
|
||||
self.stove.set_hero_cards_string(self.herorange)
|
||||
self.stove.set_villain_range_string(self.villainrange)
|
||||
print "DEBUG: odds_for_range"
|
||||
print (_("DEBUG: ") + ("odds_for_range"))
|
||||
self.ev = Stove.odds_for_range(self.stove)
|
||||
print "DEBUG: set_output_label"
|
||||
print (_("DEBUG: ") + ("set_output_label"))
|
||||
self.set_output_label(self.ev.output)
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Carl Gherardi
|
||||
#Copyright 2008-2011 Carl Gherardi
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Carl Gherardi
|
||||
#Copyright 2008-2011 Carl Gherardi
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2010 Steffen Schaumburg
|
||||
#Copyright 2010-2011 Steffen Schaumburg
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -70,7 +70,7 @@ class GuiTourneyPlayerStats (GuiPlayerStats.GuiPlayerStats):
|
|||
self.main_hbox = gtk.HPaned()
|
||||
|
||||
self.filters = TourneyFilters.TourneyFilters(self.db, self.conf, self.sql, display = filters_display)
|
||||
#self.filters.registerButton1Name("_Filters")
|
||||
#self.filters.registerButton1Name(_("_Filters"))
|
||||
#self.filters.registerButton1Callback(self.showDetailFilter)
|
||||
self.filters.registerButton2Name(_("_Refresh Stats"))
|
||||
self.filters.registerButton2Callback(self.refreshStats)
|
||||
|
@ -79,24 +79,24 @@ class GuiTourneyPlayerStats (GuiPlayerStats.GuiPlayerStats):
|
|||
# ToDo: create popup to adjust column config
|
||||
# columns to display, keys match column name returned by sql, values in tuple are:
|
||||
# is column displayed, column heading, xalignment, formatting, celltype
|
||||
self.columns = [ ["siteName", True, "Site", 0.0, "%s", "str"]
|
||||
#,["tourney", False, "Tourney", 0.0, "%s", "str"] # true not allowed for this line
|
||||
, ["category", True, "Cat.", 0.0, "%s", "str"]
|
||||
, ["limitType", True, "Limit", 0.0, "%s", "str"]
|
||||
, ["currency", True, "Curr.", 0.0, "%s", "str"]
|
||||
, ["buyIn", True, "BuyIn", 1.0, "%3.2f", "str"]
|
||||
, ["fee", True, "Fee", 1.0, "%3.2f", "str"]
|
||||
, ["playerName", False, "Name", 0.0, "%s", "str"] # true not allowed for this line (set in code)
|
||||
, ["tourneyCount", True, "#", 1.0, "%1.0f", "str"]
|
||||
, ["itm", True, "ITM%", 1.0, "%3.2f", "str"]
|
||||
, ["_1st", False, "1st", 1.0, "%1.0f", "str"]
|
||||
, ["_2nd", True, "2nd", 1.0, "%1.0f", "str"]
|
||||
, ["_3rd", True, "3rd", 1.0, "%1.0f", "str"]
|
||||
, ["unknownRank", True, "Rank?", 1.0, "%1.0f", "str"]
|
||||
, ["spent", True, "Spent", 1.0, "%3.2f", "str"]
|
||||
, ["won", True, "Won", 1.0, "%3.2f", "str"]
|
||||
, ["roi", True, "ROI%", 1.0, "%3.0f", "str"]
|
||||
, ["profitPerTourney", True,"$/Tour", 1.0, "%3.2f", "str"]]
|
||||
self.columns = [ ["siteName", True, _("Site"), 0.0, "%s", "str"]
|
||||
#,["tourney", False, _("Tourney"), 0.0, "%s", "str"] # true not allowed for this line
|
||||
, ["category", True, _("Cat."), 0.0, "%s", "str"]
|
||||
, ["limitType", True, _("Limit"), 0.0, "%s", "str"]
|
||||
, ["currency", True, _("Curr."), 0.0, "%s", "str"]
|
||||
, ["buyIn", True, _("BuyIn"), 1.0, "%3.2f", "str"]
|
||||
, ["fee", True, _("Fee"), 1.0, "%3.2f", "str"]
|
||||
, ["playerName", False, _("Name"), 0.0, "%s", "str"] # true not allowed for this line (set in code)
|
||||
, ["tourneyCount", True, _("#"), 1.0, "%1.0f", "str"]
|
||||
, ["itm", True, _("ITM%"), 1.0, "%3.2f", "str"]
|
||||
, ["_1st", False, _("1st"), 1.0, "%1.0f", "str"]
|
||||
, ["_2nd", True, _("2nd"), 1.0, "%1.0f", "str"]
|
||||
, ["_3rd", True, _("3rd"), 1.0, "%1.0f", "str"]
|
||||
, ["unknownRank", True, _("Rank?"), 1.0, "%1.0f", "str"]
|
||||
, ["spent", True, _("Spent"), 1.0, "%3.2f", "str"]
|
||||
, ["won", True, _("Won"), 1.0, "%3.2f", "str"]
|
||||
, ["roi", True, _("ROI%"), 1.0, "%3.0f", "str"]
|
||||
, ["profitPerTourney", True,_("$/Tour"), 1.0, "%3.2f", "str"]]
|
||||
|
||||
self.stats_frame = gtk.Frame()
|
||||
self.stats_frame.show()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2010 Steffen Schaumburg
|
||||
#Copyright 2010-2011 Steffen Schaumburg
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Carl Gherardi
|
||||
#Copyright 2008-2011 Carl Gherardi
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2008-2010, Ray E. Barker
|
||||
# Copyright 2008-2011, Ray E. Barker
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -52,6 +52,7 @@ if sys.platform == 'linux2':
|
|||
elif sys.platform == 'darwin':
|
||||
import OSXTables as Tables
|
||||
else: # This is bad--figure out the values for the various windows flavors
|
||||
is_windows = True
|
||||
import WinTables as Tables
|
||||
|
||||
# get config and set up logger
|
||||
|
@ -65,16 +66,16 @@ class HUD_main(object):
|
|||
def __init__(self, db_name='fpdb'):
|
||||
self.db_name = db_name
|
||||
self.config = c
|
||||
log.info("HUD_main starting: using db name = %s" % (db_name))
|
||||
log.info(_("HUD_main starting: using db name = %s") % (db_name))
|
||||
|
||||
try:
|
||||
if not options.errorsToConsole:
|
||||
fileName = os.path.join(self.config.dir_log, 'HUD-errors.txt')
|
||||
log.info("Note: error output is being diverted to:" + fileName)
|
||||
log.info("Any major error will be reported there _only_.")
|
||||
log.info(_("Note: error output is being diverted to:") + fileName)
|
||||
log.info(_("Any major error will be reported there _only_."))
|
||||
errorFile = open(fileName, 'w', 0)
|
||||
sys.stderr = errorFile
|
||||
sys.stderr.write("HUD_main: starting ...\n")
|
||||
log.info(_("HUD_main: starting ...\n"))
|
||||
|
||||
self.hud_dict = {}
|
||||
self.hud_params = self.config.get_hud_ui_parameters()
|
||||
|
@ -103,7 +104,7 @@ class HUD_main(object):
|
|||
self.main_window.connect("table_changed", self.table_changed)
|
||||
self.main_window.connect("destroy", self.destroy)
|
||||
self.vb = gtk.VBox()
|
||||
self.label = gtk.Label('Closing this window will exit from the HUD.')
|
||||
self.label = gtk.Label(_('Closing this window will exit from the HUD.'))
|
||||
self.vb.add(self.label)
|
||||
self.main_window.add(self.vb)
|
||||
self.main_window.set_title("HUD Main Window")
|
||||
|
@ -119,26 +120,28 @@ class HUD_main(object):
|
|||
gobject.timeout_add(800, self.check_tables)
|
||||
|
||||
except:
|
||||
log.exception("Error initializing main_window")
|
||||
log.exception(_("Error initializing main_window"))
|
||||
gtk.main_quit() # we're hosed, just terminate
|
||||
|
||||
def client_moved(self, widget, hud):
|
||||
hud.up_update_table_position()
|
||||
|
||||
def client_resized(self, widget, hud):
|
||||
gobject.idle_add(idle_resize, hud)
|
||||
#TODO Don't forget to get rid of this.
|
||||
if not is_windows:
|
||||
gigobject.idle_add(idle_resize, hud)
|
||||
|
||||
def client_destroyed(self, widget, hud): # call back for terminating the main eventloop
|
||||
self.kill_hud(None, hud.table.key)
|
||||
|
||||
def game_changed(self, widget, hud):
|
||||
print "hud_main: Game changed."
|
||||
print _("hud_main: Game changed.")
|
||||
|
||||
def table_changed(self, widget, hud):
|
||||
self.kill_hud(None, hud.table.key)
|
||||
|
||||
def destroy(self, *args): # call back for terminating the main eventloop
|
||||
log.info("Terminating normally.")
|
||||
log.info(_("Terminating normally."))
|
||||
gtk.main_quit()
|
||||
|
||||
def kill_hud(self, event, table):
|
||||
|
@ -199,7 +202,7 @@ class HUD_main(object):
|
|||
while 1: # wait for a new hand number on stdin
|
||||
new_hand_id = sys.stdin.readline()
|
||||
new_hand_id = string.rstrip(new_hand_id)
|
||||
log.debug("Received hand no %s" % new_hand_id)
|
||||
log.debug(_("Received hand no %s") % new_hand_id)
|
||||
if new_hand_id == "": # blank line means quit
|
||||
self.destroy()
|
||||
break # this thread is not always killed immediately with gtk.main_quit()
|
||||
|
@ -223,12 +226,12 @@ class HUD_main(object):
|
|||
|
||||
# get basic info about the new hand from the db
|
||||
# if there is a db error, complain, skip hand, and proceed
|
||||
log.info("HUD_main.read_stdin: hand processing starting ...")
|
||||
log.info(_("HUD_main.read_stdin: hand processing starting ..."))
|
||||
try:
|
||||
(table_name, max, poker_game, type, site_id, site_name, num_seats, tour_number, tab_number) = \
|
||||
self.db_connection.get_table_info(new_hand_id)
|
||||
except Exception:
|
||||
log.exception("db error: skipping %s" % new_hand_id)
|
||||
log.exception(_("db error: skipping %s") % new_hand_id)
|
||||
continue
|
||||
|
||||
if type == "tour": # hand is from a tournament
|
||||
|
@ -247,8 +250,8 @@ class HUD_main(object):
|
|||
try:
|
||||
self.hud_dict[temp_key].stat_dict = stat_dict
|
||||
except KeyError: # HUD instance has been killed off, key is stale
|
||||
log.error('hud_dict[%s] was not found\n' % temp_key)
|
||||
log.error('will not send hand\n')
|
||||
log.error(_('hud_dict[%s] was not found\n') % temp_key)
|
||||
log.error(_('will not send hand\n'))
|
||||
# Unlocks table, copied from end of function
|
||||
self.db_connection.connection.rollback()
|
||||
return
|
||||
|
@ -270,7 +273,7 @@ class HUD_main(object):
|
|||
# If no client window is found on the screen, complain and continue
|
||||
if type == "tour":
|
||||
table_name = "%s %s" % (tour_number, tab_number)
|
||||
log.error("HUD create: table name %s not found, skipping." % table_name)
|
||||
log.error(_("HUD create: table name %s not found, skipping.") % table_name)
|
||||
else:
|
||||
tablewindow.key = temp_key
|
||||
tablewindow.max = max
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2009-2010 Eric Blade
|
||||
#Copyright 2009-2011 Eric Blade
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Carl Gherardi
|
||||
#Copyright 2008-2011 Carl Gherardi
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -475,12 +475,12 @@ If a player has None chips he won't be added."""
|
|||
tmp = self.handText[0:100]
|
||||
log.error(_("markstreets didn't match - Assuming hand %s was cancelled") % self.handid)
|
||||
self.cancelled = True
|
||||
raise FpdbParseError(_("FpdbParseError: markStreets appeared to fail: First 100 chars: '%s'") % tmp)
|
||||
raise FpdbParseError(_("markStreets appeared to fail: First 100 chars: '%s'") % tmp)
|
||||
|
||||
def checkPlayerExists(self,player):
|
||||
if player not in [p[1] for p in self.players]:
|
||||
print (_("DEBUG: checkPlayerExists %s fail on hand number %s") % (player, self.handid))
|
||||
raise FpdbParseError(_("checkPlayerExists: '%s fail on hand number %s") % (player, self.handid))
|
||||
print (_("DEBUG: ") + _("checkPlayerExists: %s fail on hand number %s") % (player, self.handid))
|
||||
raise FpdbParseError(_("checkPlayerExists: %s fail on hand number %s") % (player, self.handid))
|
||||
|
||||
def setCommunityCards(self, street, cards):
|
||||
log.debug("setCommunityCards %s %s" %(street, cards))
|
||||
|
@ -1167,7 +1167,7 @@ class DrawHand(Hand):
|
|||
hhc.markStreets(self)
|
||||
# markStreets in Draw may match without dealing cards
|
||||
if self.streets['DEAL'] == None:
|
||||
raise FpdbParseError(_("DrawHand.__init__: street 'DEAL' is empty. Hand cancelled? HandID: '%s'" % self.handid))
|
||||
raise FpdbParseError(_("DrawHand.__init__: street 'DEAL' is empty. Hand cancelled? HandID: '%s'") % self.handid)
|
||||
hhc.readBlinds(self)
|
||||
hhc.readAntes(self)
|
||||
hhc.readButton(self)
|
||||
|
@ -1239,60 +1239,61 @@ class DrawHand(Hand):
|
|||
|
||||
def writeHand(self, fh=sys.__stdout__):
|
||||
# PokerStars format.
|
||||
# HH output should not be translated
|
||||
super(DrawHand, self).writeHand(fh)
|
||||
|
||||
players_who_act_ondeal = set(([x[0] for x in self.actions['DEAL']]+[x[0] for x in self.actions['BLINDSANTES']]))
|
||||
|
||||
for player in [x for x in self.players if x[1] in players_who_act_ondeal]:
|
||||
#Only print stacks of players who do something on deal
|
||||
print >>fh, _("Seat %s: %s (%s%s in chips) " %(player[0], player[1], self.sym, player[2]))
|
||||
print >>fh, (("Seat %s: %s (%s%s in chips) ") % (player[0], player[1], self.sym, player[2]))
|
||||
|
||||
if 'BLINDSANTES' in self.actions:
|
||||
for act in self.actions['BLINDSANTES']:
|
||||
print >>fh, _("%s: %s %s %s%s" %(act[0], act[1], act[2], self.sym, act[3]))
|
||||
print >>fh, ("%s: %s %s %s%s" % (act[0], act[1], act[2], self.sym, act[3]))
|
||||
|
||||
if 'DEAL' in self.actions:
|
||||
print >>fh, _("*** DEALING HANDS ***")
|
||||
print >>fh, ("*** DEALING HANDS ***")
|
||||
for player in [x[1] for x in self.players if x[1] in players_who_act_ondeal]:
|
||||
if 'DEAL' in self.holecards:
|
||||
if self.holecards['DEAL'].has_key(player):
|
||||
(nc,oc) = self.holecards['DEAL'][player]
|
||||
print >>fh, _("Dealt to %s: [%s]") % (player, " ".join(nc))
|
||||
print >>fh, ("Dealt to %s: [%s]") % (player, " ".join(nc))
|
||||
for act in self.actions['DEAL']:
|
||||
print >>fh, self.actionString(act, 'DEAL')
|
||||
|
||||
if 'DRAWONE' in self.actions:
|
||||
print >>fh, _("*** FIRST DRAW ***")
|
||||
print >>fh, ("*** FIRST DRAW ***")
|
||||
for act in self.actions['DRAWONE']:
|
||||
print >>fh, self.actionString(act, 'DRAWONE')
|
||||
if act[0] == self.hero and act[1] == 'discards':
|
||||
(nc,oc) = self.holecardsAsSet('DRAWONE', act[0])
|
||||
dc = self.discards['DRAWONE'][act[0]]
|
||||
kc = oc - dc
|
||||
print >>fh, _("Dealt to %s [%s] [%s]" % (act[0], " ".join(kc), " ".join(nc)))
|
||||
print >>fh, (("Dealt to %s [%s] [%s]") % (act[0], " ".join(kc), " ".join(nc)))
|
||||
|
||||
if 'DRAWTWO' in self.actions:
|
||||
print >>fh, _("*** SECOND DRAW ***")
|
||||
print >>fh, ("*** SECOND DRAW ***")
|
||||
for act in self.actions['DRAWTWO']:
|
||||
print >>fh, self.actionString(act, 'DRAWTWO')
|
||||
if act[0] == self.hero and act[1] == 'discards':
|
||||
(nc,oc) = self.holecardsAsSet('DRAWONE', act[0])
|
||||
dc = self.discards['DRAWTWO'][act[0]]
|
||||
kc = oc - dc
|
||||
print >>fh, _("Dealt to %s [%s] [%s]" % (act[0], " ".join(kc), " ".join(nc)))
|
||||
print >>fh, (("Dealt to %s [%s] [%s]") % (act[0], " ".join(kc), " ".join(nc)))
|
||||
|
||||
if 'DRAWTHREE' in self.actions:
|
||||
print >>fh, _("*** THIRD DRAW ***")
|
||||
print >>fh, ("*** THIRD DRAW ***")
|
||||
for act in self.actions['DRAWTHREE']:
|
||||
print >>fh, self.actionString(act, 'DRAWTHREE')
|
||||
if act[0] == self.hero and act[1] == 'discards':
|
||||
(nc,oc) = self.holecardsAsSet('DRAWONE', act[0])
|
||||
dc = self.discards['DRAWTHREE'][act[0]]
|
||||
kc = oc - dc
|
||||
print >>fh, _("Dealt to %s [%s] [%s]" % (act[0], " ".join(kc), " ".join(nc)))
|
||||
print >>fh, (("Dealt to %s [%s] [%s]") % (act[0], " ".join(kc), " ".join(nc)))
|
||||
|
||||
if 'SHOWDOWN' in self.actions:
|
||||
print >>fh, _("*** SHOW DOWN ***")
|
||||
print >>fh, ("*** SHOW DOWN ***")
|
||||
#TODO: Complete SHOWDOWN
|
||||
|
||||
# Current PS format has the lines:
|
||||
|
@ -1303,11 +1304,11 @@ class DrawHand(Hand):
|
|||
# Immediately before the summary.
|
||||
# The current importer uses those lines for importing winning rather than the summary
|
||||
for name in self.pot.returned:
|
||||
print >>fh, _("Uncalled bet (%s%s) returned to %s" %(self.sym, self.pot.returned[name],name))
|
||||
print >>fh, ("Uncalled bet (%s%s) returned to %s" % (self.sym, self.pot.returned[name],name))
|
||||
for entry in self.collected:
|
||||
print >>fh, _("%s collected %s%s from x pot" %(entry[0], self.sym, entry[1]))
|
||||
print >>fh, ("%s collected %s%s from x pot" % (entry[0], self.sym, entry[1]))
|
||||
|
||||
print >>fh, _("*** SUMMARY ***")
|
||||
print >>fh, ("*** SUMMARY ***")
|
||||
print >>fh, "%s | Rake %s%.2f" % (self.pot, self.sym, self.rake)
|
||||
print >>fh, "\n\n"
|
||||
|
||||
|
@ -1432,29 +1433,29 @@ Add a complete on [street] by [player] to [amountTo]
|
|||
|
||||
def writeHand(self, fh=sys.__stdout__):
|
||||
# PokerStars format.
|
||||
|
||||
# HH output should not be translated
|
||||
super(StudHand, self).writeHand(fh)
|
||||
|
||||
players_who_post_antes = set([x[0] for x in self.actions['BLINDSANTES']])
|
||||
|
||||
for player in [x for x in self.players if x[1] in players_who_post_antes]:
|
||||
#Only print stacks of players who do something preflop
|
||||
print >>fh, _("Seat %s: %s (%s%s in chips)" %(player[0], player[1], self.sym, player[2]))
|
||||
print >>fh, ("Seat %s: %s (%s%s in chips)" %(player[0], player[1], self.sym, player[2]))
|
||||
|
||||
if 'BLINDSANTES' in self.actions:
|
||||
for act in self.actions['BLINDSANTES']:
|
||||
print >>fh, _("%s: posts the ante %s%s" %(act[0], self.sym, act[3]))
|
||||
print >>fh, ("%s: posts the ante %s%s" %(act[0], self.sym, act[3]))
|
||||
|
||||
if 'THIRD' in self.actions:
|
||||
dealt = 0
|
||||
#~ print >>fh, _("*** 3RD STREET ***")
|
||||
#~ print >>fh, ("*** 3RD STREET ***")
|
||||
for player in [x[1] for x in self.players if x[1] in players_who_post_antes]:
|
||||
if self.holecards['THIRD'].has_key(player):
|
||||
(open, closed) = self.holecards['THIRD'][player]
|
||||
dealt+=1
|
||||
if dealt==1:
|
||||
print >>fh, _("*** 3RD STREET ***")
|
||||
# print >>fh, _("Dealt to %s:%s%s") % (player, " [" + " ".join(closed) + "] " if closed else " ", "[" + " ".join(open) + "]" if open else "")
|
||||
print >>fh, ("*** 3RD STREET ***")
|
||||
# print >>fh, ("Dealt to %s:%s%s") % (player, " [" + " ".join(closed) + "] " if closed else " ", "[" + " ".join(open) + "]" if open else "")
|
||||
print >>fh, self.writeHoleCards('THIRD', player)
|
||||
for act in self.actions['THIRD']:
|
||||
#FIXME: Need some logic here for bringin vs completes
|
||||
|
@ -1462,36 +1463,36 @@ Add a complete on [street] by [player] to [amountTo]
|
|||
|
||||
if 'FOURTH' in self.actions:
|
||||
dealt = 0
|
||||
#~ print >>fh, _("*** 4TH STREET ***")
|
||||
#~ print >>fh, ("*** 4TH STREET ***")
|
||||
for player in [x[1] for x in self.players if x[1] in players_who_post_antes]:
|
||||
if player in self.holecards['FOURTH']:
|
||||
dealt+=1
|
||||
if dealt==1:
|
||||
print >>fh, _("*** 4TH STREET ***")
|
||||
print >>fh, ("*** 4TH STREET ***")
|
||||
print >>fh, self.writeHoleCards('FOURTH', player)
|
||||
for act in self.actions['FOURTH']:
|
||||
print >>fh, self.actionString(act)
|
||||
|
||||
if 'FIFTH' in self.actions:
|
||||
dealt = 0
|
||||
#~ print >>fh, _("*** 5TH STREET ***")
|
||||
#~ print >>fh, ("*** 5TH STREET ***")
|
||||
for player in [x[1] for x in self.players if x[1] in players_who_post_antes]:
|
||||
if self.holecards['FIFTH'].has_key(player):
|
||||
dealt+=1
|
||||
if dealt==1:
|
||||
print >>fh, _("*** 5TH STREET ***")
|
||||
print >>fh, ("*** 5TH STREET ***")
|
||||
print >>fh, self.writeHoleCards('FIFTH', player)
|
||||
for act in self.actions['FIFTH']:
|
||||
print >>fh, self.actionString(act)
|
||||
|
||||
if 'SIXTH' in self.actions:
|
||||
dealt = 0
|
||||
#~ print >>fh, _("*** 6TH STREET ***")
|
||||
#~ print >>fh, ("*** 6TH STREET ***")
|
||||
for player in [x[1] for x in self.players if x[1] in players_who_post_antes]:
|
||||
if self.holecards['SIXTH'].has_key(player):
|
||||
dealt += 1
|
||||
if dealt == 1:
|
||||
print >>fh, _("*** 6TH STREET ***")
|
||||
print >>fh, ("*** 6TH STREET ***")
|
||||
print >>fh, self.writeHoleCards('SIXTH', player)
|
||||
for act in self.actions['SIXTH']:
|
||||
print >>fh, self.actionString(act)
|
||||
|
@ -1501,7 +1502,7 @@ Add a complete on [street] by [player] to [amountTo]
|
|||
# Then we have no 'dealt to' lines, no action lines, but still 7th street should appear.
|
||||
# The only way I can see to know whether to print this line is by knowing the state of the hand
|
||||
# i.e. are all but one players folded; is there an allin showdown; and all that.
|
||||
print >>fh, _("*** RIVER ***")
|
||||
print >>fh, ("*** RIVER ***")
|
||||
for player in [x[1] for x in self.players if x[1] in players_who_post_antes]:
|
||||
if self.holecards['SEVENTH'].has_key(player):
|
||||
if self.writeHoleCards('SEVENTH', player):
|
||||
|
@ -1513,7 +1514,7 @@ Add a complete on [street] by [player] to [amountTo]
|
|||
# The logic for a showdown is: at the end of river action there are at least two players in the hand
|
||||
# we probably don't need a showdown section in pseudo stars format for our filtering purposes
|
||||
if 'SHOWDOWN' in self.actions:
|
||||
print >>fh, _("*** SHOW DOWN ***")
|
||||
print >>fh, ("*** SHOW DOWN ***")
|
||||
# TODO: print showdown lines.
|
||||
|
||||
# Current PS format has the lines:
|
||||
|
@ -1524,11 +1525,11 @@ Add a complete on [street] by [player] to [amountTo]
|
|||
# Immediately before the summary.
|
||||
# The current importer uses those lines for importing winning rather than the summary
|
||||
for name in self.pot.returned:
|
||||
print >>fh, _("Uncalled bet (%s%s) returned to %s" %(self.sym, self.pot.returned[name],name))
|
||||
print >>fh, ("Uncalled bet (%s%s) returned to %s" %(self.sym, self.pot.returned[name],name))
|
||||
for entry in self.collected:
|
||||
print >>fh, _("%s collected %s%s from x pot" %(entry[0], self.sym, entry[1]))
|
||||
print >>fh, ("%s collected %s%s from x pot" %(entry[0], self.sym, entry[1]))
|
||||
|
||||
print >>fh, _("*** SUMMARY ***")
|
||||
print >>fh, ("*** SUMMARY ***")
|
||||
print >>fh, "%s | Rake %s%.2f" % (self.pot, self.sym, self.rake)
|
||||
# TODO: side pots
|
||||
|
||||
|
@ -1536,23 +1537,23 @@ Add a complete on [street] by [player] to [amountTo]
|
|||
for s in self.board.values():
|
||||
board += s
|
||||
if board: # sometimes hand ends preflop without a board
|
||||
print >>fh, _("Board [%s]" % (" ".join(board)))
|
||||
print >>fh, ("Board [%s]" % (" ".join(board)))
|
||||
|
||||
for player in [x for x in self.players if x[1] in players_who_post_antes]:
|
||||
seatnum = player[0]
|
||||
name = player[1]
|
||||
if name in self.collectees and name in self.shown:
|
||||
print >>fh, _("Seat %d: %s showed [%s] and won (%s%s)" % (seatnum, name, self.join_holecards(name), self.sym, self.collectees[name]))
|
||||
print >>fh, ("Seat %d: %s showed [%s] and won (%s%s)" % (seatnum, name, self.join_holecards(name), self.sym, self.collectees[name]))
|
||||
elif name in self.collectees:
|
||||
print >>fh, _("Seat %d: %s collected (%s%s)" % (seatnum, name, self.sym, self.collectees[name]))
|
||||
print >>fh, ("Seat %d: %s collected (%s%s)" % (seatnum, name, self.sym, self.collectees[name]))
|
||||
elif name in self.shown:
|
||||
print >>fh, _("Seat %d: %s showed [%s]" % (seatnum, name, self.join_holecards(name)))
|
||||
print >>fh, ("Seat %d: %s showed [%s]" % (seatnum, name, self.join_holecards(name)))
|
||||
elif name in self.mucked:
|
||||
print >>fh, _("Seat %d: %s mucked [%s]" % (seatnum, name, self.join_holecards(name)))
|
||||
print >>fh, ("Seat %d: %s mucked [%s]" % (seatnum, name, self.join_holecards(name)))
|
||||
elif name in self.folded:
|
||||
print >>fh, _("Seat %d: %s folded" % (seatnum, name))
|
||||
print >>fh, ("Seat %d: %s folded" % (seatnum, name))
|
||||
else:
|
||||
print >>fh, _("Seat %d: %s mucked" % (seatnum, name))
|
||||
print >>fh, ("Seat %d: %s mucked" % (seatnum, name))
|
||||
|
||||
print >>fh, "\n\n"
|
||||
|
||||
|
@ -1672,8 +1673,8 @@ class Pot(object):
|
|||
self.pots += [sum([min(v,v1) for (v,k) in commitsall])]
|
||||
commitsall = [((v-v1),k) for (v,k) in commitsall if v-v1 >0]
|
||||
except IndexError, e:
|
||||
log.error(_("Pot.end(): Major failure while calculating pot: '%s'" % e))
|
||||
raise FpdbParseError(_("Pot.end(): Major failure while calculating pot: '%s'" % e))
|
||||
log.error(_("Pot.end(): Major failure while calculating pot: '%s'") % e)
|
||||
raise FpdbParseError(_("Pot.end(): Major failure while calculating pot: '%s'") % e)
|
||||
|
||||
# TODO: I think rake gets taken out of the pots.
|
||||
# so it goes:
|
||||
|
@ -1686,9 +1687,9 @@ class Pot(object):
|
|||
if self.sym is None:
|
||||
self.sym = "C"
|
||||
if self.total is None:
|
||||
print _("DEBUG: call Pot.end() before printing pot total")
|
||||
print (_("DEBUG: ") + _("call Pot.end() before printing pot total"))
|
||||
# NB if I'm sure end() is idempotent, call it here.
|
||||
raise FpdbParseError(_("FpdbError in printing Hand object"))
|
||||
raise FpdbParseError(_("Error in printing Hand object"))
|
||||
|
||||
ret = "Total pot %s%.2f" % (self.sym, self.total)
|
||||
if len(self.pots) < 2:
|
||||
|
@ -1696,5 +1697,3 @@ class Pot(object):
|
|||
ret += " Main pot %s%.2f" % (self.sym, self.pots[0])
|
||||
|
||||
return ret + ''.join([ (" Side pot %s%.2f." % (self.sym, self.pots[x]) ) for x in xrange(1, len(self.pots)) ])
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
Parses HandHistory xml files and returns requested objects.
|
||||
"""
|
||||
# Copyright 2008-2010, Ray E. Barker
|
||||
# Copyright 2008-2011, Ray E. Barker
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Carl Gherardi
|
||||
#Copyright 2008-2011 Carl Gherardi
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -304,14 +304,14 @@ which it expects to find at self.re_TailSplitHands -- see for e.g. Everleaf.py.
|
|||
elif gametype['base'] == 'draw':
|
||||
hand = Hand.DrawHand(self.config, self, self.sitename, gametype, handText)
|
||||
else:
|
||||
log.error(_("Unsupported game type: %s" % gametype))
|
||||
raise FpdbParseError(_("Unsupported game type: %s" % gametype))
|
||||
log.error(_("Unsupported game type: %s") % gametype)
|
||||
raise FpdbParseError(_("Unsupported game type: %s") % gametype)
|
||||
|
||||
if hand:
|
||||
#hand.writeHand(self.out_fh)
|
||||
return hand
|
||||
else:
|
||||
log.error(_("Unsupported game type: %s" % gametype))
|
||||
log.error(_("Unsupported game type: %s") % gametype)
|
||||
# TODO: pity we don't know the HID at this stage. Log the entire hand?
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
Hello World demostration for Aux_Window.
|
||||
"""
|
||||
# Copyright 2009-2010, Ray E. Barker
|
||||
# Copyright 2009-2011, Ray E. Barker
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
Create and manage the hud overlays.
|
||||
"""
|
||||
# Copyright 2008-2010 Ray E. Barker
|
||||
# Copyright 2008-2011 Ray E. Barker
|
||||
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2010 Chaz Littlejohn
|
||||
#Copyright 2010-2011 Chaz Littlejohn
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2010 Steffen Schaumburg
|
||||
#Copyright 2010-2011 Steffen Schaumburg
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -41,7 +41,7 @@ def splitPokerStarsSummaries(summaryText): #TODO: this needs to go to PSS.py
|
|||
splitSummaries = re.split(re_SplitTourneys, summaryText)
|
||||
|
||||
if len(splitSummaries) <= 1:
|
||||
print _("DEBUG: re_SplitTourneys isn't matching")
|
||||
print (_("DEBUG: ") + _("re_SplitTourneys isn't matching"))
|
||||
|
||||
return splitSummaries
|
||||
|
||||
|
@ -50,7 +50,7 @@ def splitFullTiltSummaries(summaryText):#TODO: this needs to go to FTPS.py
|
|||
splitSummaries = re.split(re_SplitTourneys, summaryText)
|
||||
|
||||
if len(splitSummaries) <= 1:
|
||||
print _("DEBUG: re_SplitTourneys isn't matching")
|
||||
print(_("DEBUG: ") + _("re_SplitTourneys isn't matching"))
|
||||
|
||||
return splitSummaries
|
||||
|
||||
|
@ -64,7 +64,7 @@ def run(config, db):
|
|||
else:
|
||||
server = IMAP4(config.host)
|
||||
response = server.login(config.username, config.password) #TODO catch authentication error
|
||||
print _("response to logging in:"),response
|
||||
print(_("response to logging in: "), response)
|
||||
#print "server.list():",server.list() #prints list of folders
|
||||
|
||||
response = server.select(config.folder)
|
||||
|
@ -108,7 +108,7 @@ def run(config, db):
|
|||
else:
|
||||
print _("No Tournament summaries found.")
|
||||
|
||||
print _("Errors: %s" % errors)
|
||||
print (_("Errors: %s") % errors)
|
||||
|
||||
def readFile(filename, options):
|
||||
codepage = ["utf8"]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2010 Steffen Schaumburg
|
||||
#Copyright 2010-2011 Steffen Schaumburg
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
Mucked cards display for FreePokerTools HUD.
|
||||
"""
|
||||
# Copyright 2008-2010, Ray E. Barker
|
||||
# Copyright 2008-2011, Ray E. Barker
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""XWindows specific methods for TableWindows Class.
|
||||
"""
|
||||
# Copyright 2008 - 2010, Ray E. Barker
|
||||
# Copyright 2008 - 2011, Ray E. Barker
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2008-2010, Carl Gherardi
|
||||
# Copyright 2008-2011, Carl Gherardi
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -156,7 +156,7 @@ class OnGame(HandHistoryConverter):
|
|||
m = self.re_HandInfo.search(handText)
|
||||
if not m:
|
||||
tmp = handText[0:100]
|
||||
log.error(_("determineGameType: Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("determineGameType: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
|
||||
|
@ -172,7 +172,7 @@ class OnGame(HandHistoryConverter):
|
|||
info['limitType'] = self.limits[mg['LIMIT']]
|
||||
else:
|
||||
tmp = handText[0:100]
|
||||
log.error(_("determineGameType: limit not found in self.limits(%s). hand: '%s'") % (str(mg),tmp))
|
||||
log.error(_("limit not found in self.limits(%s). hand: '%s'") % (str(mg),tmp))
|
||||
log.error(_("determineGameType: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("limit not found in self.limits(%s). hand: '%s'") % (str(mg),tmp))
|
||||
if 'GAME' in mg:
|
||||
|
@ -206,8 +206,8 @@ class OnGame(HandHistoryConverter):
|
|||
tzoffset = a.group('OFFSET')
|
||||
else:
|
||||
datetimestr = "2010/Jan/01 01:01:01"
|
||||
log.error(_("readHandInfo: DATETIME not matched: '%s'" % info[key]))
|
||||
print "DEBUG: readHandInfo: DATETIME not matched: '%s'" % info[key]
|
||||
log.error(_("readHandInfo: DATETIME not matched: '%s'") % info[key])
|
||||
print (_("DEBUG: ") + _("readHandInfo: DATETIME not matched: '%s'") % info[key])
|
||||
# TODO: Manually adjust time against OFFSET
|
||||
hand.startTime = datetime.datetime.strptime(datetimestr, "%Y/%b/%d %H:%M:%S") # also timezone at end, e.g. " ET"
|
||||
hand.startTime = HandHistoryConverter.changeTimezone(hand.startTime, tzoffset, "UTC")
|
||||
|
@ -334,7 +334,7 @@ class OnGame(HandHistoryConverter):
|
|||
elif action.group('ATYPE') == ' stands pat':
|
||||
hand.addStandsPat( street, action.group('PNAME'))
|
||||
else:
|
||||
print _("DEBUG: unimplemented readAction: '%s' '%s'") %(action.group('PNAME'),action.group('ATYPE'),)
|
||||
print (_("DEBUG: ") + _("Unimplemented readAction: '%s' '%s'") % (action.group('PNAME'), action.group('ATYPE')))
|
||||
|
||||
def readShowdownActions(self, hand):
|
||||
for shows in self.re_ShowdownAction.finditer(hand.handText):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Ray E. Barker
|
||||
#Copyright 2008-2011 Ray E. Barker
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -107,7 +107,7 @@ def site_alias(alias):
|
|||
tmp = aliases[alias]
|
||||
except KeyError, e:
|
||||
tmp = False
|
||||
print _("Alias '%s' unknown" % alias)
|
||||
print (_("Alias '%s' unknown") % alias)
|
||||
|
||||
return tmp
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright 2009-2010, Grigorij Indigirkin
|
||||
# Copyright 2009-2011, Grigorij Indigirkin
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -194,10 +194,9 @@ class PartyPoker(HandHistoryConverter):
|
|||
m_20BBmin = self.re_20BBmin.search(handText)
|
||||
if m is None:
|
||||
tmp = handText[0:100]
|
||||
log.error(_("determineGameType: Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("determineGameType: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
return None
|
||||
|
||||
mg = m.groupdict()
|
||||
# translations from captured groups to fpdb info strings
|
||||
|
@ -253,7 +252,7 @@ class PartyPoker(HandHistoryConverter):
|
|||
try:
|
||||
info.update(self.re_Hid.search(hand.handText).groupdict())
|
||||
except AttributeError, e:
|
||||
raise FpdbParseError(_("Cannot read HID for current hand: %s" % e))
|
||||
raise FpdbParseError(_("Cannot read HID for current hand: %s") % e)
|
||||
|
||||
try:
|
||||
info.update(self.re_HandInfo.search(hand.handText,re.DOTALL).groupdict())
|
||||
|
@ -336,7 +335,7 @@ class PartyPoker(HandHistoryConverter):
|
|||
hand.fee = 0
|
||||
hand.buyinCurrency = "FREE"
|
||||
hand.isKO = False
|
||||
if hand.tourNo != None:
|
||||
elif hand.tourNo != None:
|
||||
hand.buyin = 0
|
||||
hand.fee = 0
|
||||
hand.buyinCurrency = "FREE"
|
||||
|
@ -346,7 +345,7 @@ class PartyPoker(HandHistoryConverter):
|
|||
elif info[key].find(u"€")!=-1:
|
||||
hand.buyinCurrency="EUR"
|
||||
else:
|
||||
raise FpdbParseError(_("Failed to detect currency. HID: %s: '%s'" % (hand.handid, info[key])))
|
||||
raise FpdbParseError(_("Failed to detect currency. HID: %s: '%s'") % (hand.handid, info[key]))
|
||||
info[key] = info[key].strip(u'$€')
|
||||
hand.buyin = int(100*Decimal(info[key]))
|
||||
if key == 'LEVEL':
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright 2010, Carl Gherardi
|
||||
# Copyright 2010-2011, Carl Gherardi
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -125,7 +125,7 @@ class Pkr(HandHistoryConverter):
|
|||
m = self.re_GameInfo.search(handText)
|
||||
if not m:
|
||||
tmp = handText[0:100]
|
||||
log.error(_("determineGameType: Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("determineGameType: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
|
||||
|
@ -150,7 +150,7 @@ class Pkr(HandHistoryConverter):
|
|||
info['sb'] = self.Lim_Blinds[mg['BB']][0]
|
||||
info['bb'] = self.Lim_Blinds[mg['BB']][1]
|
||||
except KeyError:
|
||||
log.error(_("determineGameType: Lim_Blinds has no lookup for '%s'" % mg['BB']))
|
||||
log.error(_("Lim_Blinds has no lookup for '%s'") % mg['BB'])
|
||||
log.error(_("determineGameType: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("Lim_Blinds has no lookup for '%s'") % mg['BB'])
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Steffen Schaumburg
|
||||
#Copyright 2008-2011 Steffen Schaumburg
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright 2008-2010, Carl Gherardi
|
||||
# Copyright 2008-2011, Carl Gherardi
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -182,7 +182,7 @@ class PokerStars(HandHistoryConverter):
|
|||
m = self.re_GameInfo.search(handText)
|
||||
if not m:
|
||||
tmp = handText[0:100]
|
||||
log.error(_("determineGameType: Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("determineGameType: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
|
||||
|
@ -208,7 +208,7 @@ class PokerStars(HandHistoryConverter):
|
|||
info['sb'] = self.Lim_Blinds[mg['BB']][0]
|
||||
info['bb'] = self.Lim_Blinds[mg['BB']][1]
|
||||
except KeyError:
|
||||
log.error(_("determineGameType: Lim_Blinds has no lookup for '%s'" % mg['BB']))
|
||||
log.error(_("Lim_Blinds has no lookup for '%s'") % mg['BB'])
|
||||
log.error(_("determineGameType: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("Lim_Blinds has no lookup for '%s'") % mg['BB'])
|
||||
|
||||
|
@ -261,8 +261,8 @@ class PokerStars(HandHistoryConverter):
|
|||
elif info[key].find("FPP")!=-1:
|
||||
hand.buyinCurrency="PSFP"
|
||||
else:
|
||||
#FIXME: handle other currencies, FPP, play money
|
||||
raise FpdbParseError(_("Failed to detect currency: '%s'" % info[key]))
|
||||
#FIXME: handle other currencies, play money
|
||||
raise FpdbParseError(_("Failed to detect currency: '%s'") % info[key])
|
||||
|
||||
info['BIAMT'] = info['BIAMT'].strip(u'$€FPP')
|
||||
|
||||
|
@ -436,7 +436,7 @@ class PokerStars(HandHistoryConverter):
|
|||
elif action.group('ATYPE') == ' stands pat':
|
||||
hand.addStandsPat( street, action.group('PNAME'))
|
||||
else:
|
||||
print _("DEBUG: unimplemented readAction: '%s' '%s'") %(action.group('PNAME'),action.group('ATYPE'),)
|
||||
print (_("DEBUG: ") + _("Unimplemented readAction: '%s' '%s'") % (action.group('PNAME'),action.group('ATYPE')))
|
||||
|
||||
|
||||
def readShowdownActions(self, hand):
|
||||
|
|
|
@ -9,7 +9,7 @@ This will allow a rudimentary "HUD" in rush games
|
|||
|
||||
The existing notes file will be altered by this function
|
||||
"""
|
||||
# Copyright 2010, "Gimick" of the FPDB project fpdb.sourceforge.net
|
||||
# Copyright 2010-2011, "Gimick" of the FPDB project fpdb.sourceforge.net
|
||||
#
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
|
|
|
@ -13,7 +13,7 @@ The generated file can then replace heroname.xml (if all is well).
|
|||
|
||||
|
||||
"""
|
||||
# Copyright 2010, "Gimick" of the FPDB project fpdb.sourceforge.net
|
||||
# Copyright 2010-2011, "Gimick" of the FPDB project fpdb.sourceforge.net
|
||||
#
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Returns a dict of SQL statements used in fpdb.
|
||||
"""
|
||||
# Copyright 2008-2010, Ray E. Barker
|
||||
# Copyright 2008-2011, Ray E. Barker
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Steffen Schaumburg
|
||||
#Copyright 2008-2011 Steffen Schaumburg
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -15,7 +15,7 @@
|
|||
#along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#In the "official" distribution you can find the license in agpl-3.0.txt.
|
||||
|
||||
"""A site template for tounrey summary parsing"""
|
||||
"""A site template for tourney summary parsing"""
|
||||
|
||||
import L10n
|
||||
_ = L10n.get_translation()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2010 Chaz Littlejohn
|
||||
#Copyright 2010-2011 Chaz Littlejohn
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -73,7 +73,7 @@ class SplitHandHistory:
|
|||
try:
|
||||
infile = codecs.open(self.in_path, 'r', kodec)
|
||||
except IOError:
|
||||
print _('File not found')
|
||||
print (_('File not found'))
|
||||
sys.exit(2)
|
||||
|
||||
#Split with do_hands_per_file if archive and paragraphs if a regular hh
|
||||
|
@ -83,7 +83,7 @@ class SplitHandHistory:
|
|||
nn += 1
|
||||
check = self.do_hands_per_file(infile, nn)
|
||||
if check is None:
|
||||
print _('%s processed' % self.in_path)
|
||||
print (_('%s processed') % self.in_path)
|
||||
break
|
||||
else:
|
||||
filenum = 0
|
||||
|
@ -102,11 +102,11 @@ class SplitHandHistory:
|
|||
|
||||
def new_file(self, fileno=-1):
|
||||
if fileno < 1:
|
||||
print _('Nope, will not work (fileno=%d)' % fileno)
|
||||
print (_('Nope, will not work (fileno=%d)') % fileno)
|
||||
sys.exit(2)
|
||||
basename = os.path.splitext(os.path.basename(self.in_path))[0]
|
||||
name = os.path.join(self.out_path, basename+'-%06d.txt' % fileno)
|
||||
print '-> %s' % name
|
||||
print ('-> %s' % name)
|
||||
newfile = file(name, 'w')
|
||||
return newfile
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
"""Manage collecting and formatting of stats and tooltips.
|
||||
"""
|
||||
# Copyright 2008-2010, Ray E. Barker
|
||||
# Copyright 2008-2011, Ray E. Barker
|
||||
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# stove.py
|
||||
# Simple Hold'em equity calculator
|
||||
# Copyright (C) 2007-2008 Mika Boström <bostik@iki.fi>
|
||||
# Copyright (C) 2007-2011 Mika Boström <bostik@iki.fi>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Steffen Schaumburg
|
||||
#Copyright 2008-2011 Steffen Schaumburg
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -47,7 +47,7 @@ for messageNumber in searchData[0].split(" "):
|
|||
if response!="OK":
|
||||
raise error #TODO: show error message
|
||||
if headerData[1].find("Subject: PokerStars Tournament History Request - Last x")!=1:
|
||||
neededMessages.append((messageNumber, "PS")
|
||||
neededMessages.append(messageNumber, "PS")
|
||||
|
||||
tourneys=[]
|
||||
if len(neededMessages)==0:
|
||||
|
@ -57,7 +57,7 @@ for messageData in neededMessages:
|
|||
if response!="OK":
|
||||
raise error #TODO: show error message
|
||||
if messageData[0]=="PS":
|
||||
tourneys.append(PokerStarsSummaries.PokerStarsSummaries(bodyData)
|
||||
tourneys.append(PokerStarsSummaries.PokerStarsSummaries(bodyData))
|
||||
|
||||
for tourney in tourneys:
|
||||
print "tourney:",tourney
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (c) 2009-2010 Eric Blade, and the FPDB team.
|
||||
# Copyright (c) 2009-2011 Eric Blade, and the FPDB team.
|
||||
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
|
|
|
@ -8,7 +8,7 @@ The class queries the poker client window for data of interest, such as
|
|||
size and location. It also controls the signals to alert the HUD when the
|
||||
client has been resized, destroyed, etc.
|
||||
"""
|
||||
# Copyright 2008 - 2010, Ray E. Barker
|
||||
# Copyright 2008 - 2011, Ray E. Barker
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
Main program module to test/demo the Tables subclasses.
|
||||
"""
|
||||
# Copyright 2008-2010, Ray E. Barker
|
||||
# Copyright 2008-2011, Ray E. Barker
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
2
pyfpdb/TestHandsPlayers.py
Normal file → Executable file
2
pyfpdb/TestHandsPlayers.py
Normal file → Executable file
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright 2010, Carl Gherardi
|
||||
# Copyright 2010-2011, Carl Gherardi
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright 2010, Carl Gherardi
|
||||
# Copyright 2010-2011, Carl Gherardi
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"""TourneyTracker.py
|
||||
Based on HUD_main .. who knows if we want to actually use this or not
|
||||
"""
|
||||
# Copyright (c) 2009-2010 Eric Blade, and the FPDB team.
|
||||
# Copyright (c) 2009-2011 Eric Blade, and the FPDB team.
|
||||
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2010 Steffen Schaumburg
|
||||
#Copyright 2010-2011 Steffen Schaumburg
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -15,6 +15,8 @@
|
|||
#along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#In the "official" distribution you can find the license in agpl-3.0.txt.
|
||||
|
||||
#TODO: migrate all of this into Filters.py
|
||||
|
||||
import L10n
|
||||
_ = L10n.get_translation()
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2009-2010 Stephane Alessio
|
||||
#Copyright 2009-2011 Stephane Alessio
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
@ -245,13 +245,13 @@ class TourneySummary(object):
|
|||
Adds a player to the tourney, and initialises data structures indexed by player.
|
||||
rank (int) indicating the finishing rank (can be -1 if unknown)
|
||||
name (string) player name
|
||||
winnings (decimal) the money the player ended the tourney with (can be 0, or -1 if unknown)
|
||||
winnings (int) the money the player ended the tourney with (can be 0, or -1 if unknown)
|
||||
"""
|
||||
log.debug(_("addPlayer: rank:%s - name : '%s' - Winnings (%s)") % (rank, name, winnings))
|
||||
self.players.append(name)
|
||||
if rank:
|
||||
self.ranks.update( { name : Decimal(rank) } )
|
||||
self.winnings.update( { name : Decimal(winnings) } )
|
||||
self.ranks.update( { name : rank } )
|
||||
self.winnings.update( { name : winnings } )
|
||||
self.winningsCurrency.update( { name : winningsCurrency } )
|
||||
else:
|
||||
self.ranks.update( { name : None } )
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright 2008-2010, Carl Gherardi
|
||||
# Copyright 2008-2011, Carl Gherardi
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -92,7 +92,7 @@ class Win2day(HandHistoryConverter):
|
|||
m = self.re_GameInfo.search(handText)
|
||||
if not m:
|
||||
tmp = handText[0:100]
|
||||
log.error(_("determineGameType: Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("determineGameType: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
|
||||
|
@ -338,7 +338,7 @@ class Win2day(HandHistoryConverter):
|
|||
elif action.group('ATYPE') == 'ACTION_STAND':
|
||||
hand.addStandsPat( street, action.group('PNAME'))
|
||||
else:
|
||||
print _("DEBUG: unimplemented readAction: '%s' '%s'" %(action.group('PNAME'),action.group('ATYPE'),))
|
||||
print (_("DEBUG: ") + _("unimplemented readAction: '%s' '%s'") % (action.group('PNAME'), action.group('ATYPE')))
|
||||
|
||||
|
||||
def readShowdownActions(self, hand):
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Routines for detecting and handling poker client windows for MS Windows.
|
||||
"""
|
||||
# Copyright 2008 - 2010, Ray E. Barker
|
||||
# Copyright 2008 - 2011, Ray E. Barker
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -62,12 +62,23 @@ class Table(Table_Window):
|
|||
if re.search(self.search_string, titles[hwnd], re.I):
|
||||
if self.check_bad_words(titles[hwnd]):
|
||||
continue
|
||||
if not win32gui.IsWindowVisible(hwnd): # if window not visible, probably not a table
|
||||
continue
|
||||
if win32gui.GetParent(hwnd) != 0: # if window is a child of another window, probably not a table
|
||||
continue
|
||||
HasNoOwner = win32gui.GetWindow(hwnd, win32con.GW_OWNER) == 0
|
||||
WindowStyle = win32gui.GetWindowLong(hwnd, win32con.GWL_EXSTYLE)
|
||||
if HasNoOwner and WindowStyle & win32con.WS_EX_TOOLWINDOW != 0:
|
||||
continue
|
||||
if not HasNoOwner and WindowStyle & win32con.WS_EX_APPWINDOW == 0:
|
||||
continue
|
||||
|
||||
self.window = hwnd
|
||||
break
|
||||
|
||||
try:
|
||||
if self.window == None:
|
||||
log.error(_("Window %s not found. Skipping." % self.search_string))
|
||||
log.error(_("Window %s not found. Skipping.") % self.search_string)
|
||||
return None
|
||||
except AttributeError:
|
||||
log.error(_("self.window doesn't exist? why?"))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2008-2010, Carl Gherardi
|
||||
# Copyright 2008-2011, Carl Gherardi
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -169,7 +169,7 @@ class Winamax(HandHistoryConverter):
|
|||
m = self.re_HandInfo.search(handText)
|
||||
if not m:
|
||||
tmp = handText[0:100]
|
||||
log.error(_("determineGameType: Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("determineGameType: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
|
||||
|
@ -187,7 +187,7 @@ class Winamax(HandHistoryConverter):
|
|||
info['limitType'] = self.limits[mg['LIMIT']]
|
||||
else:
|
||||
tmp = handText[0:100]
|
||||
log.error(_("determineGameType: limit not found in self.limits(%s). hand: '%s'") % (str(mg),tmp))
|
||||
log.error(_("limit not found in self.limits(%s). hand: '%s'") % (str(mg),tmp))
|
||||
log.error(_("determineGameType: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("limit not found in self.limits(%s). hand: '%s'") % (str(mg),tmp))
|
||||
if 'GAME' in mg:
|
||||
|
@ -214,7 +214,7 @@ class Winamax(HandHistoryConverter):
|
|||
datetimestr = "%s/%s/%s %s:%s:%s" % (a.group('Y'),a.group('M'), a.group('D'), a.group('H'),a.group('MIN'),a.group('S'))
|
||||
else:
|
||||
datetimestr = "2010/Jan/01 01:01:01"
|
||||
log.error(_("readHandInfo: DATETIME not matched: '%s'" % info[key]))
|
||||
log.error(_("readHandInfo: DATETIME not matched: '%s'") % info[key])
|
||||
#print "DEBUG: readHandInfo: DATETIME not matched: '%s'" % info[key]
|
||||
hand.startTime = datetime.datetime.strptime(datetimestr, "%Y/%m/%d %H:%M:%S")
|
||||
hand.startTime = HandHistoryConverter.changeTimezone(hand.startTime, "CET", "UTC")
|
||||
|
@ -297,7 +297,7 @@ class Winamax(HandHistoryConverter):
|
|||
hand.mixed = None
|
||||
|
||||
def readPlayerStacks(self, hand):
|
||||
log.debug(_("readplayerstacks: re is '%s'" % self.re_PlayerInfo))
|
||||
log.debug(_("readplayerstacks: re is '%s'") % self.re_PlayerInfo)
|
||||
m = self.re_PlayerInfo.finditer(hand.handText)
|
||||
for a in m:
|
||||
hand.addPlayer(int(a.group('SEAT')), a.group('PNAME'), a.group('CASH'))
|
||||
|
@ -324,7 +324,7 @@ class Winamax(HandHistoryConverter):
|
|||
m = self.re_Button.search(hand.handText)
|
||||
if m:
|
||||
hand.buttonpos = int(m.group('BUTTON'))
|
||||
log.debug(_('readButton: button on pos %d'%hand.buttonpos))
|
||||
log.debug(_('readButton: button on pos %d') % hand.buttonpos)
|
||||
else:
|
||||
log.warning(_('readButton: not found'))
|
||||
|
||||
|
@ -376,13 +376,13 @@ class Winamax(HandHistoryConverter):
|
|||
if street in hand.streets.keys():
|
||||
m = self.re_HeroCards.finditer(hand.streets[street])
|
||||
if m == []:
|
||||
log.debug(_("No hole cards found for %s"%street))
|
||||
log.debug(_("No hole cards found for %s") % street)
|
||||
for found in m:
|
||||
hand.hero = found.group('PNAME')
|
||||
newcards = found.group('CARDS').split(' ')
|
||||
# print "DEBUG: addHoleCards(%s, %s, %s)" %(street, hand.hero, newcards)
|
||||
hand.addHoleCards(street, hand.hero, closed=newcards, shown=False, mucked=False, dealt=True)
|
||||
log.debug(_("Hero cards %s: %s"%(hand.hero, newcards)))
|
||||
log.debug(_("Hero cards %s: %s") % (hand.hero, newcards))
|
||||
|
||||
def readAction(self, hand, street):
|
||||
m = self.re_Action.finditer(hand.streets[street])
|
||||
|
@ -403,13 +403,13 @@ class Winamax(HandHistoryConverter):
|
|||
elif action.group('ATYPE') == ' stands pat':
|
||||
hand.addStandsPat( street, action.group('PNAME'))
|
||||
else:
|
||||
log.fatal(_("DEBUG: unimplemented readAction: '%s' '%s'")) %(action.group('PNAME'),action.group('ATYPE'),)
|
||||
log.fatal(_("DEBUG: ") + _("unimplemented readAction: '%s' '%s'") % (action.group('PNAME'),action.group('ATYPE')))
|
||||
# print "Processed %s"%acts
|
||||
# print "committed=",hand.pot.committed
|
||||
|
||||
def readShowdownActions(self, hand):
|
||||
for shows in self.re_ShowdownAction.finditer(hand.handText):
|
||||
log.debug(_("add show actions %s"%shows))
|
||||
log.debug(_("add show actions %s") % shows)
|
||||
cards = shows.group('CARDS')
|
||||
cards = cards.split(' ')
|
||||
# print "DEBUG: addShownCards(%s, %s)" %(cards, shows.group('PNAME'))
|
||||
|
@ -466,7 +466,7 @@ class Winamax(HandHistoryConverter):
|
|||
|
||||
def readShownCards(self,hand):
|
||||
for m in self.re_ShownCards.finditer(hand.handText):
|
||||
log.debug(_("Read shown cards: %s"%m.group(0)))
|
||||
log.debug(_("Read shown cards: %s") % m.group(0))
|
||||
cards = m.group('CARDS')
|
||||
cards = cards.split(' ') # needs to be a list, not a set--stud needs the order
|
||||
(shown, mucked) = (False, False)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""XWindows specific methods for TableWindows Class.
|
||||
"""
|
||||
# Copyright 2008 - 2010, Ray E. Barker
|
||||
# Copyright 2008 - 2011, Ray E. Barker
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -362,7 +362,9 @@ class fpdb:
|
|||
(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT,
|
||||
gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT))
|
||||
|
||||
label=gtk.Label(_("Please select the game category for which you want to configure HUD stats:"))
|
||||
label=gtk.Label(_("Note that this dialogue will overwrite an existing config if one has been made already. ") +
|
||||
_("Abort now if you don't want that.") + "\n" +
|
||||
_("Please select the game category for which you want to configure HUD stats and the number of rows and columns:"))
|
||||
diaSelections.vbox.add(label)
|
||||
label.show()
|
||||
|
||||
|
@ -379,7 +381,7 @@ class fpdb:
|
|||
comboRows.connect("changed", self.hudConfiguratorComboSelection)
|
||||
diaSelections.vbox.add(comboRows)
|
||||
for i in range(1,8):
|
||||
comboRows.append_text(str(i)+" rows")
|
||||
comboRows.append_text(_("%d rows") % i)
|
||||
comboRows.set_active(0)
|
||||
comboRows.show()
|
||||
|
||||
|
@ -387,7 +389,7 @@ class fpdb:
|
|||
comboColumns.connect("changed", self.hudConfiguratorComboSelection)
|
||||
diaSelections.vbox.add(comboColumns)
|
||||
for i in range(1,8):
|
||||
comboColumns.append_text(str(i)+" columns")
|
||||
comboColumns.append_text("%d columns" % i)
|
||||
comboColumns.set_active(0)
|
||||
comboColumns.show()
|
||||
|
||||
|
@ -445,7 +447,7 @@ class fpdb:
|
|||
if attr.startswith('__'): continue
|
||||
if attr in ("Charset", "Configuration", "Database", "GInitiallyUnowned", "gtk", "pygtk",
|
||||
"player", "c", "db_connection", "do_stat", "do_tip", "stat_dict",
|
||||
"h", "re", "re_Percent", "re_Places", ): continue
|
||||
"h", "re", "re_Percent", "re_Places", "L10n", "log", "encoder", "codecs", "_", "sys", "logging"): continue
|
||||
statDict[attr]=eval("Stats.%s.__doc__" % (attr))
|
||||
|
||||
for rowNumber in range(self.hudConfiguratorRows+1):
|
||||
|
@ -455,11 +457,11 @@ class fpdb:
|
|||
if columnNumber==0:
|
||||
pass
|
||||
else:
|
||||
label=gtk.Label("column "+str(columnNumber))
|
||||
label=gtk.Label(_("column %d") % columnNumber)
|
||||
table.attach(child=label, left_attach=columnNumber, right_attach=columnNumber+1, top_attach=rowNumber, bottom_attach=rowNumber+1)
|
||||
label.show()
|
||||
elif columnNumber==0:
|
||||
label=gtk.Label("row "+str(rowNumber))
|
||||
label=gtk.Label(_("row %d") % rowNumber)
|
||||
table.attach(child=label, left_attach=columnNumber, right_attach=columnNumber+1, top_attach=rowNumber, bottom_attach=rowNumber+1)
|
||||
label.show()
|
||||
else:
|
||||
|
@ -573,7 +575,7 @@ class fpdb:
|
|||
|
||||
def dia_recreate_hudcache(self, widget, data=None):
|
||||
if self.obtain_global_lock("dia_recreate_hudcache"):
|
||||
self.dia_confirm = gtk.MessageDialog(parent=self.window, flags=gtk.DIALOG_DESTROY_WITH_PARENT, type=gtk.MESSAGE_WARNING, buttons=(gtk.BUTTONS_YES_NO), message_format="Confirm recreating HUD cache")
|
||||
self.dia_confirm = gtk.MessageDialog(parent=self.window, flags=gtk.DIALOG_DESTROY_WITH_PARENT, type=gtk.MESSAGE_WARNING, buttons=(gtk.BUTTONS_YES_NO), message_format=_("Confirm recreating HUD cache"))
|
||||
diastring = _("Please confirm that you want to re-create the HUD cache.")
|
||||
self.dia_confirm.format_secondary_text(diastring)
|
||||
# disable windowclose, do not want the the underlying processing interrupted mid-process
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2008-2010 Steffen Schaumburg
|
||||
#Copyright 2008-2011 Steffen Schaumburg
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU Affero General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright 2010, Carl Gherardi
|
||||
# Copyright 2010-2011, Carl Gherardi
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -119,7 +119,7 @@ or None if we fail to get the info """
|
|||
return self.info
|
||||
except AttributeError:
|
||||
tmp = handText[0:100]
|
||||
log.error(_("determineGameType: Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("determineGameType: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
|
||||
|
@ -258,7 +258,7 @@ or None if we fail to get the info """
|
|||
#print "DEBUG: addBringIn(%s, %s)" %(action.group('PNAME'), action.group('BET'))
|
||||
hand.addBringIn(action.group('PNAME'), action.group('BET'))
|
||||
else:
|
||||
logging.error(_("Unimplemented readAction: %s" % (ag)))
|
||||
logging.error(_("Unimplemented readAction: %s") % (ag))
|
||||
|
||||
def readShowdownActions(self, hand):
|
||||
for shows in self.re_ShowdownAction.finditer(hand.handText):
|
||||
|
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
4178
pyfpdb/locale/fpdb-pl_PL.po
Normal file
4178
pyfpdb/locale/fpdb-pl_PL.po
Normal file
File diff suppressed because it is too large
Load Diff
4159
pyfpdb/locale/fpdb-ru_RU.po
Normal file
4159
pyfpdb/locale/fpdb-ru_RU.po
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -9,11 +9,15 @@ msgmerge --update locale/fpdb-de_DE.po locale/fpdb-en_GB.pot
|
|||
msgmerge --update locale/fpdb-es_ES.po locale/fpdb-en_GB.pot
|
||||
msgmerge --update locale/fpdb-fr_FR.po locale/fpdb-en_GB.pot
|
||||
msgmerge --update locale/fpdb-hu_HU.po locale/fpdb-en_GB.pot
|
||||
msgmerge --update locale/fpdb-pl_PL.po locale/fpdb-en_GB.pot
|
||||
msgmerge --update locale/fpdb-ru_RU.po locale/fpdb-en_GB.pot
|
||||
|
||||
echo "compiling mo files"
|
||||
python /usr/share/doc/python-2.*/examples/Tools/i18n/msgfmt.py --output-file=locale/de/LC_MESSAGES/fpdb.mo locale/fpdb-de_DE.po
|
||||
python /usr/share/doc/python-2.*/examples/Tools/i18n/msgfmt.py --output-file=locale/es/LC_MESSAGES/fpdb.mo locale/fpdb-es_ES.po
|
||||
python /usr/share/doc/python-2.*/examples/Tools/i18n/msgfmt.py --output-file=locale/fr/LC_MESSAGES/fpdb.mo locale/fpdb-fr_FR.po
|
||||
python /usr/share/doc/python-2.*/examples/Tools/i18n/msgfmt.py --output-file=locale/hu/LC_MESSAGES/fpdb.mo locale/fpdb-hu_HU.po
|
||||
python /usr/share/doc/python-2.*/examples/Tools/i18n/msgfmt.py --output-file=locale/pl/LC_MESSAGES/fpdb.mo locale/fpdb-pl_PL.po
|
||||
python /usr/share/doc/python-2.*/examples/Tools/i18n/msgfmt.py --output-file=locale/ru/LC_MESSAGES/fpdb.mo locale/fpdb-ru_RU.po
|
||||
|
||||
pocount locale/*.po
|
||||
|
|
BIN
pyfpdb/locale/pl/LC_MESSAGES/fpdb.mo
Normal file
BIN
pyfpdb/locale/pl/LC_MESSAGES/fpdb.mo
Normal file
Binary file not shown.
BIN
pyfpdb/locale/ru/LC_MESSAGES/fpdb.mo
Normal file
BIN
pyfpdb/locale/ru/LC_MESSAGES/fpdb.mo
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user