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

This commit is contained in:
Worros 2010-08-18 13:25:45 +08:00
commit 37d1a10d73
21 changed files with 2083 additions and 822 deletions

View File

@ -1,3 +1,21 @@
free-poker-tools (0.20.904-2) unstable; urgency=low
* On fpdb start, copy example HUD_config.xml in place if none is present
-- Mika Bostrom <bostik@iki.fi> Tue, 17 Aug 2010 08:23:31 +0300
free-poker-tools (0.20.904-1) unstable; urgency=low
* .904 snapshot release
-- Mika Bostrom <bostik@iki.fi> Sat, 14 Aug 2010 09:24:25 +0300
free-poker-tools (0.20.903-1) unstable; urgency=low
* .903 snapshot release
-- Mika Bostrom <bostik@iki.fi> Tue, 03 Aug 2010 17:47:41 +0300
free-poker-tools (0.20.902-1) unstable; urgency=low
* New snapshot release; .901 was broken for FTP

View File

@ -27,7 +27,6 @@ install: build
cp pyfpdb/*.pyw debian/$(PACKAGE)/usr/lib/python2.6/site-packages/fpdb/
# Remove scripts that are only useful in win32
rm debian/$(PACKAGE)/usr/lib/python2.6/site-packages/fpdb//windows_make_bats.py
rm debian/$(PACKAGE)/usr/lib/python2.6/site-packages/fpdb/makeexe.py
rm debian/$(PACKAGE)/usr/lib/python2.6/site-packages/fpdb/py2exe_setup.py

View File

@ -0,0 +1,10 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# created by Steffen Schaumburg, steffen@schaumburger.info
*fpdb-0.20.1 fpdb-0.20.904 fpdb-9999 (17 Aug 2010)
17 Aug 2010; Steffen Schaumburg <steffen@schaumburger.info>
+fpdb-0.20.1.ebuild, +fpdb-0.20.904.ebuild, +fpdb-9999.ebuild, +metadata.xml:
Initial changelog for repoman.

View File

@ -0,0 +1,7 @@
DIST fpdb-0.20.1.tar.bz2 662807 RMD160 b5f22a684c605ddbba7d2154005a822b02a19490 SHA1 e4cc40de5849d3ae33a680d917b340ab37c6448b SHA256 46eff0625f300c070ce88c519ae6019f6e1c98a7725733c5e16b50a058247fe3
DIST fpdb-0.20.904.tar.bz2 632871 RMD160 6af83a9b30e8b3f394b011a4dc92937f130b9e15 SHA1 083c51f1627f901e24801bf6abebf1d07646bd89 SHA256 5e72055fe7ebb0c6048282f8edc972ee01be21063d6f8071abef22111f3e82f9
EBUILD fpdb-0.20.1.ebuild 1591 RMD160 56ccbca72353e56718a927178e58d148177f5846 SHA1 770df692b29b7314d70703010e1f6afac623c3f3 SHA256 e3f434df58d98760a118458166f9fdfcf3612712c78c704f089f6e8ec72bd224
EBUILD fpdb-0.20.904.ebuild 1595 RMD160 b5cbcdb8d2984b149c833db8b6aee362168e9c7d SHA1 7151fd3cef087c38060b44adb622843a84209f33 SHA256 41c6ed71aa0ff727d670c94cc72cf595bcd038f601121e51222532df727a6d01
EBUILD fpdb-9999.ebuild 1618 RMD160 843d309bbc2ccdd95dbb4b0eb08571d8e16d06ad SHA1 b1ebdbe0e40bd6c0d4ec417dd2b8a135884547a6 SHA256 72205c1f94bcf2c3f310d396928e357fabaee4861773044c1dac71f98f6596bf
MISC ChangeLog 395 RMD160 b195ccf198011356ca79b16071093c4d92e5927a SHA1 9aa56e5dc9c5d03b62fb60bc81069f3440b1f606 SHA256 b7ba8c180da0e6a405d939c4485f9c8e52fdcafb04207ef6de217a807015bd03
MISC metadata.xml 550 RMD160 a6fa8799f644c0882f832a12cc9e6a0f4f09ae7f SHA1 3a40c442cadb1f532e0299040c2da79e9721dd4f SHA256 b5a1c538de3786446a87479b1023cdb4f084085feb7290959619739969ce7d3b

View File

@ -1,11 +1,11 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# created by Steffen Schaumburg, steffen@schaumburger.info
# created by Steffen Schaumburg, steffen@schaumburger.info and Erki Ferenc, erkiferenc@gmail.com
EAPI="2"
inherit eutils
inherit games
EAPI="2"
NEED_PYTHON=2.5
DESCRIPTION="A free/open source tracker/HUD for use with online poker"
@ -19,42 +19,42 @@ KEYWORDS="~amd64 ~x86"
IUSE="graph mysql postgres sqlite"
RDEPEND="
mysql? ( virtual/mysql
dev-python/mysql-python )
postgres? ( dev-db/postgresql-server
dev-python/psycopg )
sqlite? ( dev-lang/python[sqlite]
dev-python/numpy )
>=x11-libs/gtk+-2.10
dev-python/pygtk
graph? ( dev-python/numpy
dev-python/matplotlib[gtk] )
dev-python/python-xlib
dev-python/pytz"
mysql? ( virtual/mysql
dev-python/mysql-python )
postgres? ( dev-db/postgresql-server
dev-python/psycopg )
sqlite? ( dev-lang/python[sqlite]
dev-python/numpy )
>=x11-libs/gtk+-2.10
dev-python/pygtk
graph? ( dev-python/numpy
dev-python/matplotlib[gtk] )
dev-python/python-xlib
dev-python/pytz"
DEPEND="${RDEPEND}"
src_install() {
insinto "${GAMES_DATADIR}"/${PN}
doins -r gfx
doins -r pyfpdb
doins readme.txt
insinto "${GAMES_DATADIR}"/${PN}
doins -r gfx
doins -r pyfpdb
doins readme.txt
exeinto "${GAMES_DATADIR}"/${PN}
doexe run_fpdb.py
exeinto "${GAMES_DATADIR}"/${PN}
doexe run_fpdb.py
dodir "${GAMES_BINDIR}"
dosym "${GAMES_DATADIR}"/${PN}/run_fpdb.py "${GAMES_BINDIR}"/${PN}
dodir "${GAMES_BINDIR}"
dosym "${GAMES_DATADIR}"/${PN}/run_fpdb.py "${GAMES_BINDIR}"/${PN}
newicon gfx/fpdb-icon.png ${PN}.png
make_desktop_entry ${PN}
newicon gfx/fpdb-icon.png ${PN}.png
make_desktop_entry ${PN}
chmod +x "${D}/${GAMES_DATADIR}"/${PN}/pyfpdb/*.pyw
prepgamesdirs
chmod +x "${D}/${GAMES_DATADIR}"/${PN}/pyfpdb/*.pyw
prepgamesdirs
}
pkg_postinst() {
games_pkg_postinst
elog "Note that if you really want to use mysql or postgresql you will have to create"
elog "the database and user yourself and enter it into the fpdb config."
elog "You can find the instructions on the project's website."
games_pkg_postinst
elog "Note that if you really want to use mysql or postgresql you will have to create"
elog "the database and user yourself and enter it into the fpdb config."
elog "You can find the instructions on the project's website."
}

View File

@ -1,11 +1,11 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# created by Steffen Schaumburg, steffen@schaumburger.info
# created by Steffen Schaumburg, steffen@schaumburger.info and Erki Ferenc, erkiferenc@gmail.com
EAPI="2"
inherit eutils
inherit games
EAPI="2"
NEED_PYTHON=2.5
DESCRIPTION="A free/open source tracker/HUD for use with online poker"
@ -19,42 +19,42 @@ KEYWORDS="~amd64 ~x86"
IUSE="graph mysql postgres sqlite"
RDEPEND="
mysql? ( virtual/mysql
dev-python/mysql-python )
postgres? ( dev-db/postgresql-server
dev-python/psycopg )
sqlite? ( dev-lang/python[sqlite]
dev-python/numpy )
>=x11-libs/gtk+-2.10
dev-python/pygtk
graph? ( dev-python/numpy
dev-python/matplotlib[gtk] )
dev-python/python-xlib
dev-python/pytz"
mysql? ( virtual/mysql
dev-python/mysql-python )
postgres? ( dev-db/postgresql-server
dev-python/psycopg )
sqlite? ( dev-lang/python[sqlite]
dev-python/numpy )
>=x11-libs/gtk+-2.10
dev-python/pygtk
graph? ( dev-python/numpy
dev-python/matplotlib[gtk] )
dev-python/python-xlib
dev-python/pytz"
DEPEND="${RDEPEND}"
src_install() {
insinto "${GAMES_DATADIR}"/${PN}
doins -r gfx
doins -r pyfpdb
doins readme.txt
insinto "${GAMES_DATADIR}"/${PN}
doins -r gfx
doins -r pyfpdb
doins readme.txt
exeinto "${GAMES_DATADIR}"/${PN}
doexe run_fpdb.py
exeinto "${GAMES_DATADIR}"/${PN}
doexe run_fpdb.py
dodir "${GAMES_BINDIR}"
dosym "${GAMES_DATADIR}"/${PN}/run_fpdb.py "${GAMES_BINDIR}"/${PN}
dodir "${GAMES_BINDIR}"
dosym "${GAMES_DATADIR}"/${PN}/run_fpdb.py "${GAMES_BINDIR}"/${PN}
newicon gfx/fpdb-icon.png ${PN}.png
make_desktop_entry ${PN}
newicon gfx/fpdb-icon.png ${PN}.png
make_desktop_entry ${PN}
chmod +x "${D}/${GAMES_DATADIR}"/${PN}/pyfpdb/*.pyw
prepgamesdirs
chmod +x "${D}/${GAMES_DATADIR}"/${PN}/pyfpdb/*.pyw
prepgamesdirs
}
pkg_postinst() {
games_pkg_postinst
elog "Note that if you really want to use mysql or postgresql you will have to create"
elog "the database and user yourself and enter it into the fpdb config."
elog "You can find the instructions on the project's website."
games_pkg_postinst
elog "Note that if you really want to use mysql or postgresql you will have to create"
elog "the database and user yourself and enter it into the fpdb config."
elog "You can find the instructions on the project's website."
}

View File

@ -0,0 +1,12 @@
Repoman currently gives the following errors for our ebuilds:
ebuild.allmasked: This error can be ignored, as all our packages are supposed to be masked
ebuild.badheader 3
games-util/fpdb/fpdb-0.20.1.ebuild: Malformed CVS Header on line: 3
games-util/fpdb/fpdb-0.20.904.ebuild: Malformed CVS Header on line: 3
games-util/fpdb/fpdb-9999.ebuild: Malformed CVS Header on line: 3
not sure what the correct header is for a sunrise ebuild so leaving as-is for now
Useful Links:
http://overlays.gentoo.org/proj/sunrise/wiki/SunriseFaq
http://www.linuxhowtos.org/manpages/1/repoman.htm
http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml The gentoo devrel handbook. Of particular relevance is the "Guides" section.

View File

@ -1,12 +1,12 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# created by Steffen Schaumburg, steffen@schaumburger.info
# created by Steffen Schaumburg, steffen@schaumburger.info and Erki Ferenc, erkiferenc@gmail.com
EAPI="2"
inherit eutils
inherit games
inherit git
EAPI="2"
NEED_PYTHON=2.5
DESCRIPTION="A free/open source tracker/HUD for use with online poker"
@ -15,51 +15,51 @@ EGIT_REPO_URI="git://git.assembla.com/fpdb.git"
LICENSE="AGPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
KEYWORDS=""
#note: this should work on other architectures too, please send me your experiences
IUSE="graph mysql postgres sqlite"
RDEPEND="
mysql? ( virtual/mysql
dev-python/mysql-python )
postgres? ( dev-db/postgresql-server
dev-python/psycopg )
sqlite? ( dev-lang/python[sqlite]
dev-python/numpy )
>=x11-libs/gtk+-2.10
dev-python/pygtk
graph? ( dev-python/numpy
dev-python/matplotlib[gtk] )
dev-python/python-xlib
dev-python/pytz"
mysql? ( virtual/mysql
dev-python/mysql-python )
postgres? ( dev-db/postgresql-server
dev-python/psycopg )
sqlite? ( dev-lang/python[sqlite]
dev-python/numpy )
>=x11-libs/gtk+-2.10
dev-python/pygtk
graph? ( dev-python/numpy
dev-python/matplotlib[gtk] )
dev-python/python-xlib
dev-python/pytz"
DEPEND="${RDEPEND}"
src_unpack() {
git_src_unpack
git_src_unpack
}
src_install() {
insinto "${GAMES_DATADIR}"/${PN}
doins -r gfx
doins -r pyfpdb
doins readme.txt
insinto "${GAMES_DATADIR}"/${PN}
doins -r gfx
doins -r pyfpdb
doins readme.txt
exeinto "${GAMES_DATADIR}"/${PN}
doexe run_fpdb.py
exeinto "${GAMES_DATADIR}"/${PN}
doexe run_fpdb.py
dodir "${GAMES_BINDIR}"
dosym "${GAMES_DATADIR}"/${PN}/run_fpdb.py "${GAMES_BINDIR}"/${PN}
dodir "${GAMES_BINDIR}"
dosym "${GAMES_DATADIR}"/${PN}/run_fpdb.py "${GAMES_BINDIR}"/${PN}
newicon gfx/fpdb-icon.png ${PN}.png
make_desktop_entry ${PN}
newicon gfx/fpdb-icon.png ${PN}.png
make_desktop_entry ${PN}
chmod +x "${D}/${GAMES_DATADIR}"/${PN}/pyfpdb/*.pyw
prepgamesdirs
chmod +x "${D}/${GAMES_DATADIR}"/${PN}/pyfpdb/*.pyw
prepgamesdirs
}
pkg_postinst() {
games_pkg_postinst
elog "Note that if you really want to use mysql or postgresql you will have to create"
elog "the database and user yourself and enter it into the fpdb config."
elog "You can find the instructions on the project's website."
games_pkg_postinst
elog "Note that if you really want to use mysql or postgresql you will have to create"
elog "the database and user yourself and enter it into the fpdb config."
elog "You can find the instructions on the project's website."
}

View File

@ -0,0 +1,11 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<longdescription>
FPDB (Free Poker Database) is a free/open source suite of steadily growing tools to track and analyse your poker game. FPDB is able to import the hand histories that poker sites write to your computer, store additional data from each hand in a database for use in later analysis.
</longdescription>
<use>
<flag name='graph'>Enable dependencies for making graphs</flag>
</use>
</pkgmetadata>

View File

@ -101,6 +101,21 @@ def get_config(file_name, fallback = True):
if not fallback:
return (False,False)
# Example configuration for debian package
if os.name == 'posix':
# If we're on linux, try to copy example from the place
# debian package puts it; get_default_config_path() creates
# the config directory for us so there's no need to check it
# again
example_path = '/usr/share/python-fpdb/' + file_name + '.example'
try:
shutil.copyfile(example_path, config_path)
msg = 'Configuration file created: %s\n' % config_path
logging.info(msg)
return (config_path,False)
except IOError:
pass
# OK, fall back to the .example file, should be in the start dir
if os.path.exists(file_name + ".example"):
try:

View File

@ -496,7 +496,7 @@ class Database:
for i in xrange(maxtimes):
try:
ret = self.connection.commit()
log.debug(_("commit finished ok, i = ")+str(i))
#log.debug(_("commit finished ok, i = ")+str(i))
ok = True
except:
log.debug(_("commit %s failed: info=%s value=%s") % (str(i), str(sys.exc_info()), str(sys.exc_value)))

View File

@ -23,8 +23,19 @@ pygtk.require('2.0')
import gtk
import gobject
import Configuration
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
import Configuration
rewrite = { 'general' : 'General', 'supported_databases' : 'Databases'
, 'import' : 'Import', 'hud_ui' : 'HUD'

View File

@ -42,6 +42,18 @@ if os.name == 'nt':
import win32con
import win32api
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
# FreePokerTools modules
import Tables # needed for testing only
import Configuration
@ -134,153 +146,153 @@ class Hud:
# A popup menu for the main window
menu = gtk.Menu()
killitem = gtk.MenuItem('Kill This HUD')
killitem = gtk.MenuItem(_('Kill This HUD'))
menu.append(killitem)
if self.parent is not None:
killitem.connect("activate", self.parent.kill_hud, self.table_name)
saveitem = gtk.MenuItem('Save HUD Layout')
saveitem = gtk.MenuItem(_('Save HUD Layout'))
menu.append(saveitem)
saveitem.connect("activate", self.save_layout)
repositem = gtk.MenuItem('Reposition StatWindows')
repositem = gtk.MenuItem(_('Reposition StatWindows'))
menu.append(repositem)
repositem.connect("activate", self.reposition_windows)
aggitem = gtk.MenuItem('Show Player Stats')
aggitem = gtk.MenuItem(_('Show Player Stats'))
menu.append(aggitem)
self.aggMenu = gtk.Menu()
aggitem.set_submenu(self.aggMenu)
# set agg_bb_mult to 1 to stop aggregation
item = gtk.CheckMenuItem('For This Blind Level Only')
item = gtk.CheckMenuItem(_('For This Blind Level Only'))
self.aggMenu.append(item)
item.connect("activate", self.set_aggregation, ('P',1))
setattr(self, 'h_aggBBmultItem1', item)
#
item = gtk.MenuItem('For Multiple Blind Levels:')
item = gtk.MenuItem(_('For Multiple Blind Levels:'))
self.aggMenu.append(item)
#
item = gtk.CheckMenuItem(' 0.5 to 2.0 x Current Blinds')
item = gtk.CheckMenuItem(_(' 0.5 to 2.0 x Current Blinds'))
self.aggMenu.append(item)
item.connect("activate", self.set_aggregation, ('P',2))
setattr(self, 'h_aggBBmultItem2', item)
#
item = gtk.CheckMenuItem(' 0.33 to 3.0 x Current Blinds')
item = gtk.CheckMenuItem(_(' 0.33 to 3.0 x Current Blinds'))
self.aggMenu.append(item)
item.connect("activate", self.set_aggregation, ('P',3))
setattr(self, 'h_aggBBmultItem3', item)
#
item = gtk.CheckMenuItem(' 0.1 to 10 x Current Blinds')
item = gtk.CheckMenuItem(_(' 0.1 to 10 x Current Blinds'))
self.aggMenu.append(item)
item.connect("activate", self.set_aggregation, ('P',10))
setattr(self, 'h_aggBBmultItem10', item)
#
item = gtk.CheckMenuItem(' All Levels')
item = gtk.CheckMenuItem(_(' All Levels'))
self.aggMenu.append(item)
item.connect("activate", self.set_aggregation, ('P',10000))
setattr(self, 'h_aggBBmultItem10000', item)
#
item = gtk.MenuItem('For #Seats:')
item = gtk.MenuItem(_('For #Seats:'))
self.aggMenu.append(item)
#
item = gtk.CheckMenuItem(' Any Number')
item = gtk.CheckMenuItem(_(' Any Number'))
self.aggMenu.append(item)
item.connect("activate", self.set_seats_style, ('P','A'))
setattr(self, 'h_seatsStyleOptionA', item)
#
item = gtk.CheckMenuItem(' Custom')
item = gtk.CheckMenuItem(_(' Custom'))
self.aggMenu.append(item)
item.connect("activate", self.set_seats_style, ('P','C'))
setattr(self, 'h_seatsStyleOptionC', item)
#
item = gtk.CheckMenuItem(' Exact')
item = gtk.CheckMenuItem(_(' Exact'))
self.aggMenu.append(item)
item.connect("activate", self.set_seats_style, ('P','E'))
setattr(self, 'h_seatsStyleOptionE', item)
#
item = gtk.MenuItem('Since:')
item = gtk.MenuItem(_('Since:'))
self.aggMenu.append(item)
#
item = gtk.CheckMenuItem(' All Time')
item = gtk.CheckMenuItem(_(' All Time'))
self.aggMenu.append(item)
item.connect("activate", self.set_hud_style, ('P','A'))
setattr(self, 'h_hudStyleOptionA', item)
#
item = gtk.CheckMenuItem(' Session')
item = gtk.CheckMenuItem(_(' Session'))
self.aggMenu.append(item)
item.connect("activate", self.set_hud_style, ('P','S'))
setattr(self, 'h_hudStyleOptionS', item)
#
item = gtk.CheckMenuItem(' %s Days' % (self.hud_params['h_hud_days']))
item = gtk.CheckMenuItem(_(' %s Days') % (self.hud_params['h_hud_days']))
self.aggMenu.append(item)
item.connect("activate", self.set_hud_style, ('P','T'))
setattr(self, 'h_hudStyleOptionT', item)
aggitem = gtk.MenuItem('Show Opponent Stats')
aggitem = gtk.MenuItem(_('Show Opponent Stats'))
menu.append(aggitem)
self.aggMenu = gtk.Menu()
aggitem.set_submenu(self.aggMenu)
# set agg_bb_mult to 1 to stop aggregation
item = gtk.CheckMenuItem('For This Blind Level Only')
item = gtk.CheckMenuItem(_('For This Blind Level Only'))
self.aggMenu.append(item)
item.connect("activate", self.set_aggregation, ('O',1))
setattr(self, 'aggBBmultItem1', item)
#
item = gtk.MenuItem('For Multiple Blind Levels:')
item = gtk.MenuItem(_('For Multiple Blind Levels:'))
self.aggMenu.append(item)
#
item = gtk.CheckMenuItem(' 0.5 to 2.0 x Current Blinds')
item = gtk.CheckMenuItem(_(' 0.5 to 2.0 x Current Blinds'))
self.aggMenu.append(item)
item.connect("activate", self.set_aggregation, ('O',2))
setattr(self, 'aggBBmultItem2', item)
#
item = gtk.CheckMenuItem(' 0.33 to 3.0 x Current Blinds')
item = gtk.CheckMenuItem(_(' 0.33 to 3.0 x Current Blinds'))
self.aggMenu.append(item)
item.connect("activate", self.set_aggregation, ('O',3))
setattr(self, 'aggBBmultItem3', item)
#
item = gtk.CheckMenuItem(' 0.1 to 10 x Current Blinds')
item = gtk.CheckMenuItem(_(' 0.1 to 10 x Current Blinds'))
self.aggMenu.append(item)
item.connect("activate", self.set_aggregation, ('O',10))
setattr(self, 'aggBBmultItem10', item)
#
item = gtk.CheckMenuItem(' All Levels')
item = gtk.CheckMenuItem(_(' All Levels'))
self.aggMenu.append(item)
item.connect("activate", self.set_aggregation, ('O',10000))
setattr(self, 'aggBBmultItem10000', item)
#
item = gtk.MenuItem('For #Seats:')
item = gtk.MenuItem(_('For #Seats:'))
self.aggMenu.append(item)
#
item = gtk.CheckMenuItem(' Any Number')
item = gtk.CheckMenuItem(_(' Any Number'))
self.aggMenu.append(item)
item.connect("activate", self.set_seats_style, ('O','A'))
setattr(self, 'seatsStyleOptionA', item)
#
item = gtk.CheckMenuItem(' Custom')
item = gtk.CheckMenuItem(_(' Custom'))
self.aggMenu.append(item)
item.connect("activate", self.set_seats_style, ('O','C'))
setattr(self, 'seatsStyleOptionC', item)
#
item = gtk.CheckMenuItem(' Exact')
item = gtk.CheckMenuItem(_(' Exact'))
self.aggMenu.append(item)
item.connect("activate", self.set_seats_style, ('O','E'))
setattr(self, 'seatsStyleOptionE', item)
#
item = gtk.MenuItem('Since:')
item = gtk.MenuItem(_('Since:'))
self.aggMenu.append(item)
#
item = gtk.CheckMenuItem(' All Time')
item = gtk.CheckMenuItem(_(' All Time'))
self.aggMenu.append(item)
item.connect("activate", self.set_hud_style, ('O','A'))
setattr(self, 'hudStyleOptionA', item)
#
item = gtk.CheckMenuItem(' Session')
item = gtk.CheckMenuItem(_(' Session'))
self.aggMenu.append(item)
item.connect("activate", self.set_hud_style, ('O','S'))
setattr(self, 'hudStyleOptionS', item)
#
item = gtk.CheckMenuItem(' %s Days' % (self.hud_params['h_hud_days']))
item = gtk.CheckMenuItem(_(' %s Days') % (self.hud_params['h_hud_days']))
self.aggMenu.append(item)
item.connect("activate", self.set_hud_style, ('O','T'))
setattr(self, 'hudStyleOptionT', item)
@ -296,7 +308,7 @@ class Hud:
getattr(self, 'h_aggBBmultItem10').set_active(True)
elif self.hud_params['h_agg_bb_mult'] > 9000:
getattr(self, 'h_aggBBmultItem10000').set_active(True)
#
if self.hud_params['agg_bb_mult'] == 1:
getattr(self, 'aggBBmultItem1').set_active(True)
elif self.hud_params['agg_bb_mult'] == 2:
@ -307,28 +319,28 @@ class Hud:
getattr(self, 'aggBBmultItem10').set_active(True)
elif self.hud_params['agg_bb_mult'] > 9000:
getattr(self, 'aggBBmultItem10000').set_active(True)
#
if self.hud_params['h_seats_style'] == 'A':
getattr(self, 'h_seatsStyleOptionA').set_active(True)
elif self.hud_params['h_seats_style'] == 'C':
getattr(self, 'h_seatsStyleOptionC').set_active(True)
elif self.hud_params['h_seats_style'] == 'E':
getattr(self, 'h_seatsStyleOptionE').set_active(True)
#
if self.hud_params['seats_style'] == 'A':
getattr(self, 'seatsStyleOptionA').set_active(True)
elif self.hud_params['seats_style'] == 'C':
getattr(self, 'seatsStyleOptionC').set_active(True)
elif self.hud_params['seats_style'] == 'E':
getattr(self, 'seatsStyleOptionE').set_active(True)
#
if self.hud_params['h_hud_style'] == 'A':
getattr(self, 'h_hudStyleOptionA').set_active(True)
elif self.hud_params['h_hud_style'] == 'S':
getattr(self, 'h_hudStyleOptionS').set_active(True)
elif self.hud_params['h_hud_style'] == 'T':
getattr(self, 'h_hudStyleOptionT').set_active(True)
#
if self.hud_params['hud_style'] == 'A':
getattr(self, 'hudStyleOptionA').set_active(True)
elif self.hud_params['hud_style'] == 'S':
@ -338,11 +350,11 @@ class Hud:
eventbox.connect_object("button-press-event", self.on_button_press, menu)
debugitem = gtk.MenuItem('Debug StatWindows')
debugitem = gtk.MenuItem(_('Debug StatWindows'))
menu.append(debugitem)
debugitem.connect("activate", self.debug_stat_windows)
item5 = gtk.MenuItem('Set max seats')
item5 = gtk.MenuItem(_('Set max seats'))
menu.append(item5)
maxSeatsMenu = gtk.Menu()
item5.set_submenu(maxSeatsMenu)
@ -525,7 +537,7 @@ class Hud:
# ask each aux to save its layout back to the config object
[aux.save_layout() for aux in self.aux_windows]
# save the config object back to the file
print "Updating config file"
print _("Updating config file")
self.config.save()
def adj_seats(self, hand, config):
@ -534,7 +546,7 @@ class Hud:
adj = range(0, self.max + 1) # default seat adjustments = no adjustment
# does the user have a fav_seat?
if self.max not in config.supported_sites[self.table.site].layout:
sys.stderr.write("No layout found for %d-max games for site %s\n" % (self.max, self.table.site) )
sys.stderr.write(_("No layout found for %d-max games for site %s\n") % (self.max, self.table.site) )
return adj
if self.table.site != None and int(config.supported_sites[self.table.site].layout[self.max].fav_seat) > 0:
try:
@ -548,15 +560,15 @@ class Hud:
if adj[j] > self.max:
adj[j] = adj[j] - self.max
except Exception, inst:
sys.stderr.write("exception in adj!!!\n\n")
sys.stderr.write("error is %s" % inst) # __str__ allows args to printed directly
sys.stderr.write(_("exception in Hud.adj_seats\n\n"))
sys.stderr.write(_("error is %s") % inst) # __str__ allows args to printed directly
return adj
def get_actual_seat(self, name):
for key in self.stat_dict:
if self.stat_dict[key]['screen_name'] == name:
return self.stat_dict[key]['seat']
sys.stderr.write("Error finding actual seat.\n")
sys.stderr.write(_("Error finding actual seat.\n"))
def create(self, hand, config, stat_dict, cards):
# update this hud, to the stats and players as of "hand"
@ -572,7 +584,7 @@ class Hud:
self.stat_dict = stat_dict
self.cards = cards
sys.stderr.write("------------------------------------------------------------\nCreating hud from hand %s\n" % hand)
sys.stderr.write(_("------------------------------------------------------------\nCreating hud from hand %s\n") % hand)
adj = self.adj_seats(hand, config)
loc = self.config.get_locations(self.table.site, self.max)
if loc is None and self.max != 10:
@ -621,8 +633,8 @@ class Hud:
try:
statd = self.stat_dict[s]
except KeyError:
log.error("KeyError at the start of the for loop in update in hud_main. How this can possibly happen is totally beyond my comprehension. Your HUD may be about to get really weird. -Eric")
log.error("(btw, the key was ", s, " and statd is...", statd)
log.error(_("KeyError at the start of the for loop in update in hud_main. How this can possibly happen is totally beyond my comprehension. Your HUD may be about to get really weird. -Eric"))
log.error(_("(btw, the key was %s and statd is %s") % (s, statd))
continue
try:
self.stat_windows[statd['seat']].player_id = statd['player_id']
@ -929,7 +941,7 @@ class Popup_window:
if __name__== "__main__":
main_window = gtk.Window()
main_window.connect("destroy", destroy)
label = gtk.Label('Fake main window, blah blah, blah\nblah, blah')
label = gtk.Label(_('Fake main window, blah blah, blah\nblah, blah'))
main_window.add(label)
main_window.show_all()
@ -937,7 +949,7 @@ if __name__== "__main__":
#tables = Tables.discover(c)
t = Tables.discover_table_by_name(c, "Corona")
if t is None:
print "Table not found."
print _("Table not found.")
db = Database.Database(c, 'fpdb', 'holdem')
stat_dict = db.get_stats_from_hand(1)

View File

@ -55,6 +55,18 @@ import pygtk
import gtk
import re
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
# FreePokerTools modules
import Configuration
import Database
@ -88,8 +100,8 @@ def do_stat(stat_dict, player = 24, stat = 'vpip'):
result = eval("%(stat)s(stat_dict, %(player)d)" % {'stat': base, 'player': player})
except:
pass #
log.info("exception getting stat "+base+" for player "+str(player)+str(sys.exc_info()))
log.debug("result = %s" % str(result) )
log.info(_("exception getting stat %s for player %s %s") % (base, str(player), str(sys.exc_info())))
log.debug(_("Stats.do_stat result = %s") % str(result) )
match = re_Percent.search(result[1])
try:
@ -98,7 +110,7 @@ def do_stat(stat_dict, player = 24, stat = 'vpip'):
else:
result = (result[0], "%.*f%%" % (places, 100*result[0]), result[2], result[3], result[4], result[5])
except:
log.info( "error: %s" % str(sys.exc_info()))
log.info(_("error: %s") % str(sys.exc_info()))
raise
return result
@ -117,8 +129,8 @@ def totalprofit(stat_dict, player):
""" Total Profit."""
if stat_dict[player]['net'] != 0:
stat = float(stat_dict[player]['net']) / 100
return (stat, '$%.2f' % stat, 'tp=$%.2f' % stat, 'totalprofit=$%.2f' % stat, str(stat), 'Total Profit')
return ('0', '$0.00', 'tp=0', 'totalprofit=0', '0', 'Total Profit')
return (stat, '$%.2f' % stat, 'tp=$%.2f' % stat, 'totalprofit=$%.2f' % stat, str(stat), _('Total Profit'))
return ('0', '$0.00', 'tp=0', 'totalprofit=0', '0', _('Total Profit'))
def playername(stat_dict, player):
""" Player Name."""
@ -139,14 +151,14 @@ def vpip(stat_dict, player):
'v=%3.1f' % (100*stat) + '%',
'vpip=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['vpip'], stat_dict[player]['n']),
'Voluntarily Put In Pot Pre-Flop%'
_('Voluntarily Put In Pot Pre-Flop%')
)
except: return (stat,
'%3.1f' % (0) + '%',
'v=%3.1f' % (0) + '%',
'vpip=%3.1f' % (0) + '%',
'(%d/%d)' % (0, 0),
'Voluntarily Put In Pot Pre-Flop%'
_('Voluntarily Put In Pot Pre-Flop%')
)
def pfr(stat_dict, player):
@ -159,7 +171,7 @@ def pfr(stat_dict, player):
'p=%3.1f' % (100*stat) + '%',
'pfr=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['pfr'], stat_dict[player]['n']),
'Pre-Flop Raise %'
_('Pre-Flop Raise %')
)
except:
return (stat,
@ -167,7 +179,7 @@ def pfr(stat_dict, player):
'p=%3.1f' % (0) + '%',
'pfr=%3.1f' % (0) + '%',
'(%d/%d)' % (0, 0),
'Pre-Flop Raise %'
_('Pre-Flop Raise %')
)
def wtsd(stat_dict, player):
@ -180,7 +192,7 @@ def wtsd(stat_dict, player):
'w=%3.1f' % (100*stat) + '%',
'wtsd=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['sd'], stat_dict[player]['saw_f']),
'% went to showdown'
_('% went to showdown')
)
except:
return (stat,
@ -188,7 +200,7 @@ def wtsd(stat_dict, player):
'w=%3.1f' % (0) + '%',
'wtsd=%3.1f' % (0) + '%',
'(%d/%d)' % (0, 0),
'% went to showdown'
_('% went to showdown')
)
def wmsd(stat_dict, player):
@ -201,7 +213,7 @@ def wmsd(stat_dict, player):
'w=%3.1f' % (100*stat) + '%',
'wmsd=%3.1f' % (100*stat) + '%',
'(%5.1f/%d)' % (float(stat_dict[player]['wmsd']), stat_dict[player]['sd']),
'% won money at showdown'
_('% won money at showdown')
)
except:
return (stat,
@ -209,7 +221,7 @@ def wmsd(stat_dict, player):
'w=%3.1f' % (0) + '%',
'wmsd=%3.1f' % (0) + '%',
'(%d/%d)' % (0, 0),
'% won money at showdown'
_('% won money at showdown')
)
def profit100(stat_dict, player):
@ -222,16 +234,16 @@ def profit100(stat_dict, player):
'p=%.0f' % (100.0*stat),
'p/100=%.0f' % (100.0*stat),
'%d/%d' % (stat_dict[player]['net'], stat_dict[player]['n']),
'profit/100hands'
_('profit/100hands')
)
except:
print "exception calcing p/100: 100 * %d / %d" % (stat_dict[player]['net'], stat_dict[player]['n'])
print _("exception calcing p/100: 100 * %d / %d") % (stat_dict[player]['net'], stat_dict[player]['n'])
return (stat,
'%.0f' % (0.0),
'p=%.0f' % (0.0),
'p/100=%.0f' % (0.0),
'(%d/%d)' % (0, 0),
'profit/100hands'
_('profit/100hands')
)
def bbper100(stat_dict, player):
@ -244,7 +256,7 @@ def bbper100(stat_dict, player):
'bb100=%5.3f' % (stat),
'bb100=%5.3f' % (stat),
'(%d,%d)' % (100*stat_dict[player]['net'],stat_dict[player]['bigblind']),
'big blinds/100 hands'
_('big blinds/100 hands')
)
except:
log.info("exception calcing bb/100: "+str(stat_dict[player]))
@ -253,7 +265,7 @@ def bbper100(stat_dict, player):
'bb100=%.0f' % (0),
'bb100=%.0f' % (0),
'(%f)' % (0),
'big blinds/100 hands'
_('big blinds/100 hands')
)
def BBper100(stat_dict, player):
@ -266,16 +278,16 @@ def BBper100(stat_dict, player):
'BB100=%5.3f' % (stat),
'BB100=%5.3f' % (stat),
'(%d,%d)' % (100*stat_dict[player]['net'],2*stat_dict[player]['bigblind']),
'Big Bets/100 hands'
_('Big Bets/100 hands')
)
except:
log.info("exception calcing BB/100: "+str(stat_dict[player]))
log.info(_("exception calcing BB/100: ")+str(stat_dict[player]))
return (stat,
'%.0f' % (0.0),
'BB100=%.0f' % (0.0),
'BB100=%.0f' % (0.0),
'(%f)' % (0.0),
'Big Bets/100 hands'
_('Big Bets/100 hands')
)
def saw_f(stat_dict, player):
@ -289,7 +301,7 @@ def saw_f(stat_dict, player):
'sf=%3.1f' % (100*stat) + '%',
'saw_f=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['saw_f'], stat_dict[player]['n']),
'Flop Seen %'
_('Flop Seen %')
)
except:
stat = 0.0
@ -300,7 +312,7 @@ def saw_f(stat_dict, player):
'sf=%3.1f' % (stat) + '%',
'saw_f=%3.1f' % (stat) + '%',
'(%d/%d)' % (num, den),
'Flop Seen %'
_('Flop Seen %')
)
def n(stat_dict, player):
@ -323,7 +335,7 @@ def n(stat_dict, player):
'n=%d' % (stat_dict[player]['n']),
'n=%d' % (stat_dict[player]['n']),
'(%d)' % (stat_dict[player]['n']),
'number hands seen'
_('number hands seen')
)
except:
return (0,
@ -331,7 +343,7 @@ def n(stat_dict, player):
'n=%d' % (0),
'n=%d' % (0),
'(%d)' % (0),
'number hands seen'
_('number hands seen')
)
def fold_f(stat_dict, player):
@ -344,7 +356,7 @@ def fold_f(stat_dict, player):
'ff=%3.1f' % (100*stat) + '%',
'fold_f=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['fold_2'], stat_dict[player]['saw_f']),
'folded flop/4th'
_('folded flop/4th')
)
except:
return (stat,
@ -352,7 +364,7 @@ def fold_f(stat_dict, player):
'ff=%3.1f' % (0) + '%',
'fold_f=%3.1f' % (0) + '%',
'(%d/%d)' % (0, 0),
'folded flop/4th'
_('folded flop/4th')
)
def steal(stat_dict, player):
@ -365,7 +377,7 @@ def steal(stat_dict, player):
'st=%3.1f' % (100*stat) + '%',
'steal=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['steal'], stat_dict[player]['steal_opp']),
'% steal attempted'
_('% steal attempted')
)
except:
return (stat, 'NA', 'st=NA', 'steal=NA', '(0/0)', '% steal attempted')
@ -380,15 +392,14 @@ def f_SB_steal(stat_dict, player):
'fSB=%3.1f' % (100*stat) + '%',
'fSB_s=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['sbnotdef'], stat_dict[player]['sbstolen']),
'% folded SB to steal'
)
_('% folded SB to steal'))
except:
return (stat,
'NA',
'fSB=NA',
'fSB_s=NA',
'(0/0)',
'% folded SB to steal')
_('% folded SB to steal'))
def f_BB_steal(stat_dict, player):
""" Folded BB to steal."""
@ -400,15 +411,14 @@ def f_BB_steal(stat_dict, player):
'fBB=%3.1f' % (100*stat) + '%',
'fBB_s=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['bbnotdef'], stat_dict[player]['bbstolen']),
'% folded BB to steal'
)
_('% folded BB to steal'))
except:
return (stat,
'NA',
'fBB=NA',
'fBB_s=NA',
'(0/0)',
'% folded BB to steal')
_('% folded BB to steal'))
def f_steal(stat_dict, player):
""" Folded blind to steal."""
@ -423,15 +433,14 @@ def f_steal(stat_dict, player):
'fB=%3.1f' % (100*stat) + '%',
'fB_s=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (folded_blind, blind_stolen),
'% folded blind to steal'
)
_('% folded blind to steal'))
except:
return (stat,
'NA',
'fB=NA',
'fB_s=NA',
'(0/0)',
'% folded blind to steal')
_('% folded blind to steal'))
def three_B(stat_dict, player):
""" Three bet preflop/3rd."""
@ -443,16 +452,14 @@ def three_B(stat_dict, player):
'3B=%3.1f' % (100*stat) + '%',
'3B_pf=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['tb_0'], stat_dict[player]['tb_opp_0']),
'% 3/4 Bet preflop/3rd'
)
_('% 3/4 Bet preflop/3rd'))
except:
return (stat,
'%3.1f' % (0) + '%',
'3B=%3.1f' % (0) + '%',
'3B_pf=%3.1f' % (0) + '%',
'(%d/%d)' % (0, 0),
'% 3/4 Bet preflop/3rd'
)
_('% 3/4 Bet preflop/3rd'))
def WMsF(stat_dict, player):
""" Won $ when saw flop/4th."""
@ -464,16 +471,14 @@ def WMsF(stat_dict, player):
'wf=%3.1f' % (100*stat) + '%',
'w_w_f=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['w_w_s_1'], stat_dict[player]['saw_f']),
'% won$/saw flop/4th'
)
_('% won$/saw flop/4th'))
except:
return (stat,
'%3.1f' % (0) + '%',
'wf=%3.1f' % (0) + '%',
'w_w_f=%3.1f' % (0) + '%',
'(%d/%d)' % (0, 0),
'% won$/saw flop/4th'
)
_('% won$/saw flop/4th'))
def a_freq1(stat_dict, player):
""" Flop/4th aggression frequency."""
@ -485,16 +490,14 @@ def a_freq1(stat_dict, player):
'a1=%3.1f' % (100*stat) + '%',
'a_fq_1=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['aggr_1'], stat_dict[player]['saw_f']),
'Aggression Freq flop/4th'
)
_('Aggression Freq flop/4th'))
except:
return (stat,
'%3.1f' % (0) + '%',
'a1=%3.1f' % (0) + '%',
'a_fq_1=%3.1f' % (0) + '%',
'(%d/%d)' % (0, 0),
'Aggression Freq flop/4th'
)
_('Aggression Freq flop/4th'))
def a_freq2(stat_dict, player):
""" Turn/5th aggression frequency."""
@ -506,16 +509,14 @@ def a_freq2(stat_dict, player):
'a2=%3.1f' % (100*stat) + '%',
'a_fq_2=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['aggr_2'], stat_dict[player]['saw_2']),
'Aggression Freq turn/5th'
)
_('Aggression Freq turn/5th'))
except:
return (stat,
'%3.1f' % (0) + '%',
'a2=%3.1f' % (0) + '%',
'a_fq_2=%3.1f' % (0) + '%',
'(%d/%d)' % (0, 0),
'Aggression Freq turn/5th'
)
_('Aggression Freq turn/5th'))
def a_freq3(stat_dict, player):
""" River/6th aggression frequency."""
@ -527,16 +528,14 @@ def a_freq3(stat_dict, player):
'a3=%3.1f' % (100*stat) + '%',
'a_fq_3=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['aggr_3'], stat_dict[player]['saw_3']),
'Aggression Freq river/6th'
)
_('Aggression Freq river/6th'))
except:
return (stat,
'%3.1f' % (0) + '%',
'a3=%3.1f' % (0) + '%',
'a_fq_3=%3.1f' % (0) + '%',
'(%d/%d)' % (0, 0),
'Aggression Freq river/6th'
)
_('Aggression Freq river/6th'))
def a_freq4(stat_dict, player):
""" 7th street aggression frequency."""
@ -548,16 +547,14 @@ def a_freq4(stat_dict, player):
'a4=%3.1f' % (100*stat) + '%',
'a_fq_4=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['aggr_4'], stat_dict[player]['saw_4']),
'Aggression Freq 7th'
)
_('Aggression Freq 7th'))
except:
return (stat,
'%3.1f' % (0) + '%',
'a4=%3.1f' % (0) + '%',
'a_fq_4=%3.1f' % (0) + '%',
'(%d/%d)' % (0, 0),
'Aggression Freq 7th'
)
_('Aggression Freq 7th'))
def a_freq_123(stat_dict, player):
""" Post-Flop aggression frequency."""
@ -576,16 +573,14 @@ def a_freq_123(stat_dict, player):
+ stat_dict[player]['saw_2']
+ stat_dict[player]['saw_3']
),
'Post-Flop Aggression Freq'
)
_('Post-Flop Aggression Freq'))
except:
return (stat,
'%2.0f' % (0) + '%',
'a3=%2.0f' % (0) + '%',
'a_fq_3=%2.0f' % (0) + '%',
'(%d/%d)' % (0, 0),
'Post-Flop Aggression Freq'
)
_('Post-Flop Aggression Freq'))
def agg_freq(stat_dict, player):
""" Post-Flop aggression frequency."""
@ -606,16 +601,14 @@ def agg_freq(stat_dict, player):
'afr=%3.1f' % (100*stat) + '%',
'agg_fr=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (bet_raise, (post_call + post_fold + bet_raise)),
'Aggression Freq'
)
_('Aggression Freq'))
except:
return (stat,
'%2.1f' % (0) + '%',
'af=%3.1f' % (0) + '%',
'agg_f=%3.1f' % (0) + '%',
'(%d/%d)' % (0, 0),
'Aggression Freq'
)
_('Aggression Freq'))
def agg_fact(stat_dict, player):
""" Post-Flop aggression frequency."""
@ -634,17 +627,14 @@ def agg_fact(stat_dict, player):
'afa=%2.2f' % (stat) ,
'agg_fa=%2.2f' % (stat) ,
'(%d/%d)' % (bet_raise, post_call),
'Aggression Factor'
)
_('Aggression Factor'))
except:
return (stat,
'%2.2f' % (0) ,
'afa=%2.2f' % (0) ,
'agg_fa=%2.2f' % (0),
'(%d/%d)' % (0, 0),
'Aggression Factor'
)
_('Aggression Factor'))
def cbet(stat_dict, player):
@ -661,16 +651,14 @@ def cbet(stat_dict, player):
'cbet=%3.1f' % (100*stat) + '%',
'cbet=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (cbets, oppt),
'% continuation bet '
)
_('% continuation bet '))
except:
return (stat,
'%3.1f' % (0) + '%',
'cbet=%3.1f' % (0) + '%',
'cbet=%3.1f' % (0) + '%',
'(%d/%d)' % (0, 0),
'% continuation bet '
)
_('% continuation bet '))
def cb1(stat_dict, player):
""" Flop continuation bet."""
@ -682,16 +670,14 @@ def cb1(stat_dict, player):
'cb1=%3.1f' % (100*stat) + '%',
'cb_1=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['cb_1'], stat_dict[player]['cb_opp_1']),
'% continuation bet flop/4th'
)
_('% continuation bet flop/4th'))
except:
return (stat,
'%3.1f' % (0) + '%',
'cb1=%3.1f' % (0) + '%',
'cb_1=%3.1f' % (0) + '%',
'(%d/%d)' % (0, 0),
'% continuation bet flop/4th'
)
_('% continuation bet flop/4th'))
def cb2(stat_dict, player):
""" Turn continuation bet."""
@ -703,16 +689,14 @@ def cb2(stat_dict, player):
'cb2=%3.1f' % (100*stat) + '%',
'cb_2=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['cb_2'], stat_dict[player]['cb_opp_2']),
'% continuation bet turn/5th'
)
_('% continuation bet turn/5th'))
except:
return (stat,
'%3.1f' % (0) + '%',
'cb2=%3.1f' % (0) + '%',
'cb_2=%3.1f' % (0) + '%',
'(%d/%d)' % (0, 0),
'% continuation bet turn/5th'
)
_('% continuation bet turn/5th'))
def cb3(stat_dict, player):
""" River continuation bet."""
@ -724,16 +708,14 @@ def cb3(stat_dict, player):
'cb3=%3.1f' % (100*stat) + '%',
'cb_3=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['cb_3'], stat_dict[player]['cb_opp_3']),
'% continuation bet river/6th'
)
_('% continuation bet river/6th'))
except:
return (stat,
'%3.1f' % (0) + '%',
'cb3=%3.1f' % (0) + '%',
'cb_3=%3.1f' % (0) + '%',
'(%d/%d)' % (0, 0),
'% continuation bet river/6th'
)
_('% continuation bet river/6th'))
def cb4(stat_dict, player):
""" 7th street continuation bet."""
@ -745,16 +727,14 @@ def cb4(stat_dict, player):
'cb4=%3.1f' % (100*stat) + '%',
'cb_4=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['cb_4'], stat_dict[player]['cb_opp_4']),
'% continuation bet 7th'
)
_('% continuation bet 7th'))
except:
return (stat,
'%3.1f' % (0) + '%',
'cb4=%3.1f' % (0) + '%',
'cb_4=%3.1f' % (0) + '%',
'(%d/%d)' % (0, 0),
'% continuation bet 7th'
)
_('% continuation bet 7th'))
def ffreq1(stat_dict, player):
""" Flop/4th fold frequency."""
@ -766,16 +746,14 @@ def ffreq1(stat_dict, player):
'ff1=%3.1f' % (100*stat) + '%',
'ff_1=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['f_freq_1'], stat_dict[player]['was_raised_1']),
'% fold frequency flop/4th'
)
_('% fold frequency flop/4th'))
except:
return (stat,
'NA',
'ff1=NA',
'ff_1=NA',
'(0/0)',
'% fold frequency flop/4th'
)
_('% fold frequency flop/4th'))
def ffreq2(stat_dict, player):
""" Turn/5th fold frequency."""
@ -787,16 +765,14 @@ def ffreq2(stat_dict, player):
'ff2=%3.1f' % (100*stat) + '%',
'ff_2=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['f_freq_2'], stat_dict[player]['was_raised_2']),
'% fold frequency turn/5th'
)
_('% fold frequency turn/5th'))
except:
return (stat,
'%3.1f' % (0) + '%',
'ff2=%3.1f' % (0) + '%',
'ff_2=%3.1f' % (0) + '%',
'(%d/%d)' % (0, 0),
'% fold frequency turn/5th'
)
_('% fold frequency turn/5th'))
def ffreq3(stat_dict, player):
""" River/6th fold frequency."""
@ -808,16 +784,14 @@ def ffreq3(stat_dict, player):
'ff3=%3.1f' % (100*stat) + '%',
'ff_3=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['f_freq_3'], stat_dict[player]['was_raised_3']),
'% fold frequency river/6th'
)
_('% fold frequency river/6th'))
except:
return (stat,
'%3.1f' % (0) + '%',
'ff3=%3.1f' % (0) + '%',
'ff_3=%3.1f' % (0) + '%',
'(%d/%d)' % (0, 0),
'% fold frequency river/6th'
)
_('% fold frequency river/6th'))
def ffreq4(stat_dict, player):
""" 7th fold frequency."""
@ -829,16 +803,14 @@ def ffreq4(stat_dict, player):
'ff4=%3.1f' % (100*stat) + '%',
'ff_4=%3.1f' % (100*stat) + '%',
'(%d/%d)' % (stat_dict[player]['f_freq_4'], stat_dict[player]['was_raised_4']),
'% fold frequency 7th'
)
_('% fold frequency 7th'))
except:
return (stat,
'%3.1f' % (0) + '%',
'ff4=%3.1f' % (0) + '%',
'ff_4=%3.1f' % (0) + '%',
'(%d/%d)' % (0, 0),
'% fold frequency 7th'
)
_('% fold frequency 7th'))
if __name__== "__main__":
statlist = dir()
@ -858,7 +830,7 @@ if __name__== "__main__":
stat_dict = db_connection.get_stats_from_hand(h, "ring")
for player in stat_dict.keys():
print "Example stats, player =", player, "hand =", h, ":"
print (_("Example stats, player = %s hand = %s:") % (player, h))
for attr in statlist:
print " ", do_stat(stat_dict, player=player, stat=attr)
break
@ -891,8 +863,8 @@ if __name__== "__main__":
#print "player = ", player, do_stat(stat_dict, player = player, stat = 'ffreq4')
#print "\n"
print "\n\nLegal stats:"
print "(add _0 to name to display with 0 decimal places, _1 to display with 1, etc)\n"
print _("\n\nLegal stats:")
print _("(add _0 to name to display with 0 decimal places, _1 to display with 1, etc)\n")
for attr in statlist:
print "%-14s %s" % (attr, eval("%s.__doc__" % (attr)))
# print " <pu_stat pu_stat_name = \"%s\"> </pu_stat>" % (attr)

View File

@ -873,7 +873,7 @@ class fpdb:
sys.exit()
log = Configuration.get_logger("logging.conf", "fpdb", log_dir=self.config.dir_log)
print _("Logfile is ") + os.path.join(self.config.dir_log, self.config.log_file) + "\n"
print (_("Logfile is %s\n") % os.path.join(self.config.dir_log, self.config.log_file))
if self.config.example_copy:
self.info_box(_("Config file")
, _("has been created at:\n%s.\n") % self.config.file
@ -901,7 +901,7 @@ class fpdb:
self.db = Database.Database(self.config, sql = self.sql)
if self.db.get_backend_name() == 'SQLite':
# tell sqlite users where the db file is
print _("Connected to SQLite: %(database)s") % {'database':self.db.db_path}
print (_("Connected to SQLite: %s") % self.db.db_path)
except Exceptions.FpdbMySQLAccessDenied:
err_msg = _("MySQL Server reports: Access denied. Are your permissions set correctly?")
except Exceptions.FpdbMySQLNoDatabase:

View File

@ -5,12 +5,12 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2010-08-16 07:17+CEST\n"
"POT-Creation-Date: 2010-08-17 20:08+CEST\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: ENCODING\n"
"Generated-By: pygettext.py 1.5\n"
@ -1014,19 +1014,19 @@ msgstr ""
msgid "Positional Stats page displayed in %4.2f seconds"
msgstr ""
#: GuiPrefs.py:70
#: GuiPrefs.py:81
msgid "Setting"
msgstr ""
#: GuiPrefs.py:76
#: GuiPrefs.py:87
msgid "Value (double-click to change)"
msgstr ""
#: GuiPrefs.py:176
#: GuiPrefs.py:187
msgid "Test Preferences Dialog"
msgstr ""
#: GuiPrefs.py:181 fpdb.pyw:296
#: GuiPrefs.py:192 fpdb.pyw:296
msgid "Preferences"
msgstr ""
@ -1649,6 +1649,138 @@ msgid ""
" on %s."
msgstr ""
#: Hud.py:149
msgid "Kill This HUD"
msgstr ""
#: Hud.py:154
msgid "Save HUD Layout"
msgstr ""
#: Hud.py:158
msgid "Reposition StatWindows"
msgstr ""
#: Hud.py:162
msgid "Show Player Stats"
msgstr ""
#: Hud.py:167 Hud.py:236
msgid "For This Blind Level Only"
msgstr ""
#: Hud.py:172 Hud.py:241
msgid "For Multiple Blind Levels:"
msgstr ""
#: Hud.py:175 Hud.py:244
msgid " 0.5 to 2.0 x Current Blinds"
msgstr ""
#: Hud.py:180 Hud.py:249
msgid " 0.33 to 3.0 x Current Blinds"
msgstr ""
#: Hud.py:185 Hud.py:254
msgid " 0.1 to 10 x Current Blinds"
msgstr ""
#: Hud.py:190 Hud.py:259
msgid " All Levels"
msgstr ""
#: Hud.py:195 Hud.py:264
msgid "For #Seats:"
msgstr ""
#: Hud.py:198 Hud.py:267
msgid " Any Number"
msgstr ""
#: Hud.py:203 Hud.py:272
msgid " Custom"
msgstr ""
#: Hud.py:208 Hud.py:277
msgid " Exact"
msgstr ""
#: Hud.py:213 Hud.py:282
msgid "Since:"
msgstr ""
#: Hud.py:216 Hud.py:285
msgid " All Time"
msgstr ""
#: Hud.py:221 Hud.py:290
msgid " Session"
msgstr ""
#: Hud.py:226 Hud.py:295
msgid " %s Days"
msgstr ""
#: Hud.py:231
msgid "Show Opponent Stats"
msgstr ""
#: Hud.py:353
msgid "Debug StatWindows"
msgstr ""
#: Hud.py:357
msgid "Set max seats"
msgstr ""
#: Hud.py:540
msgid "Updating config file"
msgstr ""
#: Hud.py:549
msgid ""
"No layout found for %d-max games for site %s\n"
msgstr ""
#: Hud.py:563
msgid ""
"exception in Hud.adj_seats\n"
"\n"
msgstr ""
#: Hud.py:564
msgid "error is %s"
msgstr ""
#: Hud.py:571
msgid ""
"Error finding actual seat.\n"
msgstr ""
#: Hud.py:587
msgid ""
"------------------------------------------------------------\n"
"Creating hud from hand %s\n"
msgstr ""
#: Hud.py:636
msgid "KeyError at the start of the for loop in update in hud_main. How this can possibly happen is totally beyond my comprehension. Your HUD may be about to get really weird. -Eric"
msgstr ""
#: Hud.py:637
msgid "(btw, the key was %s and statd is %s"
msgstr ""
#: Hud.py:944
msgid ""
"Fake main window, blah blah, blah\n"
"blah, blah"
msgstr ""
#: Hud.py:952
msgid "Table not found."
msgstr ""
#: ImapFetcher.py:54
msgid "response to logging in:"
msgstr ""
@ -1765,6 +1897,174 @@ msgstr ""
msgid "reading antes"
msgstr ""
#: Stats.py:103
msgid "exception getting stat %s for player %s %s"
msgstr ""
#: Stats.py:104
msgid "Stats.do_stat result = %s"
msgstr ""
#: Stats.py:113
msgid "error: %s"
msgstr ""
#: Stats.py:132 Stats.py:133
msgid "Total Profit"
msgstr ""
#: Stats.py:154 Stats.py:161
msgid "Voluntarily Put In Pot Pre-Flop%"
msgstr ""
#: Stats.py:174 Stats.py:182
msgid "Pre-Flop Raise %"
msgstr ""
#: Stats.py:195 Stats.py:203
msgid "% went to showdown"
msgstr ""
#: Stats.py:216 Stats.py:224
msgid "% won money at showdown"
msgstr ""
#: Stats.py:237 Stats.py:246
msgid "profit/100hands"
msgstr ""
#: Stats.py:240
msgid "exception calcing p/100: 100 * %d / %d"
msgstr ""
#: Stats.py:259 Stats.py:268
msgid "big blinds/100 hands"
msgstr ""
#: Stats.py:281 Stats.py:290
msgid "Big Bets/100 hands"
msgstr ""
#: Stats.py:284
msgid "exception calcing BB/100: "
msgstr ""
#: Stats.py:304 Stats.py:315
msgid "Flop Seen %"
msgstr ""
#: Stats.py:338 Stats.py:346
msgid "number hands seen"
msgstr ""
#: Stats.py:359 Stats.py:367
msgid "folded flop/4th"
msgstr ""
#: Stats.py:380
msgid "% steal attempted"
msgstr ""
#: Stats.py:395 Stats.py:402
msgid "% folded SB to steal"
msgstr ""
#: Stats.py:414 Stats.py:421
msgid "% folded BB to steal"
msgstr ""
#: Stats.py:436 Stats.py:443
msgid "% folded blind to steal"
msgstr ""
#: Stats.py:455 Stats.py:462
msgid "% 3/4 Bet preflop/3rd"
msgstr ""
#: Stats.py:474 Stats.py:481
msgid "% won$/saw flop/4th"
msgstr ""
#: Stats.py:493 Stats.py:500
msgid "Aggression Freq flop/4th"
msgstr ""
#: Stats.py:512 Stats.py:519
msgid "Aggression Freq turn/5th"
msgstr ""
#: Stats.py:531 Stats.py:538
msgid "Aggression Freq river/6th"
msgstr ""
#: Stats.py:550 Stats.py:557
msgid "Aggression Freq 7th"
msgstr ""
#: Stats.py:576 Stats.py:583
msgid "Post-Flop Aggression Freq"
msgstr ""
#: Stats.py:604 Stats.py:611
msgid "Aggression Freq"
msgstr ""
#: Stats.py:630 Stats.py:637
msgid "Aggression Factor"
msgstr ""
#: Stats.py:654 Stats.py:661
msgid "% continuation bet "
msgstr ""
#: Stats.py:673 Stats.py:680
msgid "% continuation bet flop/4th"
msgstr ""
#: Stats.py:692 Stats.py:699
msgid "% continuation bet turn/5th"
msgstr ""
#: Stats.py:711 Stats.py:718
msgid "% continuation bet river/6th"
msgstr ""
#: Stats.py:730 Stats.py:737
msgid "% continuation bet 7th"
msgstr ""
#: Stats.py:749 Stats.py:756
msgid "% fold frequency flop/4th"
msgstr ""
#: Stats.py:768 Stats.py:775
msgid "% fold frequency turn/5th"
msgstr ""
#: Stats.py:787 Stats.py:794
msgid "% fold frequency river/6th"
msgstr ""
#: Stats.py:806 Stats.py:813
msgid "% fold frequency 7th"
msgstr ""
#: Stats.py:833
msgid "Example stats, player = %s hand = %s:"
msgstr ""
#: Stats.py:866
msgid ""
"\n"
"\n"
"Legal stats:"
msgstr ""
#: Stats.py:867
msgid ""
"(add _0 to name to display with 0 decimal places, _1 to display with 1, etc)\n"
msgstr ""
#: Tables.py:234
msgid "Found unknown table = %s"
msgstr ""

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,2 @@
msgmerge --update fpdb-hu_HU.po fpdb-en_GB.po