Merge branch 'master' of git://git.assembla.com/fpdb.git
This commit is contained in:
commit
1ee698975a
22
mit.txt
Normal file
22
mit.txt
Normal file
|
@ -0,0 +1,22 @@
|
|||
This license applies to the pytz files distributed with fpdb's Windows installer
|
||||
|
||||
Copyright (c) Stuart Bishop <stuart@stuartbishop.net>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
10
packaging/gentoo/ChangeLog
Normal file
10
packaging/gentoo/ChangeLog
Normal 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.
|
||||
|
7
packaging/gentoo/Manifest
Normal file
7
packaging/gentoo/Manifest
Normal 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
|
|
@ -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,18 +19,18 @@ 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() {
|
||||
|
@ -48,13 +48,13 @@ src_install() {
|
|||
newicon gfx/fpdb-icon.png ${PN}.png
|
||||
make_desktop_entry ${PN}
|
||||
|
||||
chmod +x "${D}/${GAMES_DATADIR}"/${PN}/pyfpdb/*.pyw
|
||||
prepgamesdirs
|
||||
fperms +x "${GAMES_DATADIR}"/${PN}/pyfpdb/*.pyw
|
||||
}
|
||||
|
||||
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 "the database and user yourself and enter it into the fpdb config."
|
||||
elog "You can find the instructions on the project's website."
|
||||
}
|
||||
|
|
|
@ -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,18 +19,18 @@ 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() {
|
||||
|
@ -48,13 +48,13 @@ src_install() {
|
|||
newicon gfx/fpdb-icon.png ${PN}.png
|
||||
make_desktop_entry ${PN}
|
||||
|
||||
chmod +x "${D}/${GAMES_DATADIR}"/${PN}/pyfpdb/*.pyw
|
||||
prepgamesdirs
|
||||
fperms +x "${GAMES_DATADIR}"/${PN}/pyfpdb/*.pyw
|
||||
}
|
||||
|
||||
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 "the database and user yourself and enter it into the fpdb config."
|
||||
elog "You can find the instructions on the project's website."
|
||||
}
|
||||
|
|
12
packaging/gentoo/dev-readme.txt
Normal file
12
packaging/gentoo/dev-readme.txt
Normal 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.
|
65
packaging/gentoo/fpdb-9999.ebuild
Normal file
65
packaging/gentoo/fpdb-9999.ebuild
Normal file
|
@ -0,0 +1,65 @@
|
|||
# Copyright 1999-2010 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# created by Steffen Schaumburg, steffen@schaumburger.info and Erki Ferenc, erkiferenc@gmail.com
|
||||
EAPI="2"
|
||||
|
||||
inherit eutils
|
||||
inherit games
|
||||
inherit git
|
||||
|
||||
NEED_PYTHON=2.5
|
||||
|
||||
DESCRIPTION="A free/open source tracker/HUD for use with online poker"
|
||||
HOMEPAGE="http://fpdb.wiki.sourceforge.net/"
|
||||
EGIT_REPO_URI="git://git.assembla.com/fpdb.git"
|
||||
|
||||
LICENSE="AGPL-3"
|
||||
SLOT="0"
|
||||
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"
|
||||
DEPEND="${RDEPEND}"
|
||||
|
||||
src_unpack() {
|
||||
git_src_unpack
|
||||
}
|
||||
|
||||
src_install() {
|
||||
insinto "${GAMES_DATADIR}"/${PN}
|
||||
doins -r gfx
|
||||
doins -r pyfpdb
|
||||
doins readme.txt
|
||||
|
||||
exeinto "${GAMES_DATADIR}"/${PN}
|
||||
doexe run_fpdb.py
|
||||
|
||||
dodir "${GAMES_BINDIR}"
|
||||
dosym "${GAMES_DATADIR}"/${PN}/run_fpdb.py "${GAMES_BINDIR}"/${PN}
|
||||
|
||||
newicon gfx/fpdb-icon.png ${PN}.png
|
||||
make_desktop_entry ${PN}
|
||||
|
||||
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."
|
||||
}
|
11
packaging/gentoo/metadata.xml
Normal file
11
packaging/gentoo/metadata.xml
Normal 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>
|
||||
|
9
packaging/windows/py27-links.txt
Normal file
9
packaging/windows/py27-links.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
Python 2.7 ... http://python.org/ftp/python/2.7/python-2.7.msi
|
||||
pywin 214 ... https://sourceforge.net/projects/pywin32/files/pywin32/Build%20214/pywin32-214.win32-py2.7.exe/download
|
||||
matplotlib X ... not available as py27 as of 16aug2010: https://sourceforge.net/projects/matplotlib/files/matplotlib/
|
||||
pygtk X ... not available as py27 as of 16aug2010: http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/
|
||||
pycairo X ... not available as py27 as of 16aug2010: http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/
|
||||
pyGobject X ... not available as py27 as of 16aug2010: http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/
|
||||
py2exe 0.6.9 ... https://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/py2exe-0.6.9.win32-py2.7.exe/download
|
||||
psycopg2 ... http://www.stickpeople.com/projects/python/win-psycopg/psycopg2-2.2.2.win32-py2.7-pg8.4.4-release.exe
|
||||
|
|
@ -30,15 +30,41 @@ py2exe 0.6.9 ... http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/py2ex
|
|||
psycopg2 ... http://www.stickpeople.com/projects/python/win-psycopg/psycopg2-2.2.1.win32-py2.6-pg8.4.3-release.exe
|
||||
(Note: stickpeople is the offical repository, not a community build)
|
||||
|
||||
|
||||
1.2/ MySQL
|
||||
|
||||
MySQL-python-1.2.3.win32-py2.6-fpdb0.20.exe ... http://www.mediafire.com/file/iodnnnznmj1/MySQL-python-1.2.3.win32-py2.6-fpdb0.20.exe
|
||||
|
||||
This is an intaller built from source by gimick. There are no official mysql-python2.6 build for windows.
|
||||
This is an intaller built from source by gimick. There are no official mysql-python2.6 builds for windows.
|
||||
|
||||
Community builds are also available from some developers. see www.codegood.com for example.
|
||||
|
||||
|
||||
1.3/ pytz fixup to work in an executable package
|
||||
|
||||
pytz needs runtime access to timezone definition files. pytz is hard-coded to search in the directory from which the pytz .py modules are being run.
|
||||
In a py2exe package, this directory is actually a library.zip container file, so windows cannot find the timezone definitions, and will crash the app.
|
||||
|
||||
We need to make a one-line change to pytz to search in the current working directory (which is not a container), and not the application directory.
|
||||
The py2exe script copies the timezone datafiles into the package folder pyfpdb/zoneinfo.
|
||||
|
||||
Thanks to Jeff Peck <peck.jeff <at> gmail.com> on the py2exe mailing list for documenting this problem and solution.
|
||||
|
||||
1.3.1/ Navigate to C:\Python26\Lib\site-packages\pytz
|
||||
1.3.2/ Edit __init__.py
|
||||
1.3.3/ At line 55 replace the following line(s):
|
||||
|
||||
filename = os.path.join(os.path.dirname(__file__),
|
||||
'zoneinfo', *name_parts)
|
||||
|
||||
with this line:
|
||||
|
||||
filename = os.path.join(os.getcwd(), 'zoneinfo', *name_parts)
|
||||
|
||||
1.3.4/ Save and exit
|
||||
|
||||
|
||||
|
||||
Step 2 Setup GTK
|
||||
-----------------
|
||||
|
||||
|
@ -196,7 +222,7 @@ pyfpdb/share/man
|
|||
Step 12 rename folder
|
||||
---------------------
|
||||
|
||||
Rename the folder to something meaningful to the community. If you have built for NoSSE, append noSSE to the directory name.
|
||||
Rename the folder to something meaningful to the community. If you have built for NoSSE, append anyCPU to the directory name.
|
||||
|
||||
|
||||
Step 13 Compress to executable archive
|
||||
|
|
|
@ -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: gettextify if file is used again
|
||||
|
||||
from decimal import Decimal
|
||||
|
||||
from sqlalchemy import types
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
This package contains all classes to be mapped and mappers themselves
|
||||
"""
|
||||
|
||||
#TODO: gettextify if file is used again
|
||||
|
||||
import logging
|
||||
import re
|
||||
from decimal import Decimal
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
Contains all sqlalchemy tables
|
||||
"""
|
||||
|
||||
#TODO: gettextify if file is used again
|
||||
|
||||
from sqlalchemy import Table, Float, Column, Integer, String, MetaData, \
|
||||
ForeignKey, Boolean, SmallInteger, DateTime, Text, Index, CHAR, \
|
||||
PickleType, Unicode
|
||||
|
|
|
@ -23,6 +23,18 @@ import HandHistoryConverter
|
|||
import Configuration
|
||||
import sys
|
||||
|
||||
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
|
||||
|
||||
(options, argv) = Options.fpdb_options()
|
||||
config = Configuration.Config()
|
||||
|
||||
|
@ -40,13 +52,13 @@ if os.path.exists(options.infile):
|
|||
filecontents = in_fh.read()
|
||||
in_fh.close()
|
||||
else:
|
||||
print "Could not find file %s" % options.infile
|
||||
print _("Could not find file %s") % options.infile
|
||||
exit(1)
|
||||
|
||||
m = hhc.re_PlayerInfo.finditer(filecontents)
|
||||
|
||||
outfile = options.infile+".anon"
|
||||
print "Output being written to", outfile
|
||||
print _("Output being written to"), outfile
|
||||
|
||||
savestdout = sys.stdout
|
||||
fsock = open(outfile,"w")
|
||||
|
|
|
@ -22,6 +22,18 @@ import sys
|
|||
import logging
|
||||
from HandHistoryConverter import *
|
||||
|
||||
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
|
||||
|
||||
# Betfair HH format
|
||||
|
||||
class Betfair(HandHistoryConverter):
|
||||
|
@ -32,8 +44,9 @@ class Betfair(HandHistoryConverter):
|
|||
siteId = 7 # Needs to match id entry in Sites database
|
||||
|
||||
# Static regexes
|
||||
#re_SplitHands = re.compile(r'\n\n+') # Betfair 1.0 version
|
||||
re_GameInfo = re.compile("^(?P<LIMIT>NL|PL|) (?P<CURRENCY>\$|)?(?P<SB>[.0-9]+)/\$?(?P<BB>[.0-9]+) (?P<GAME>(Texas Hold\'em|Omaha Hi|Razz))", re.MULTILINE)
|
||||
re_SplitHands = re.compile(r'\n\n+')
|
||||
re_SplitHands = re.compile(r'End of hand .{2}-\d{7,9}-\d+ \*\*\*\*\*\n')
|
||||
re_HandInfo = re.compile("\*\*\*\*\* Betfair Poker Hand History for Game (?P<HID>[0-9]+) \*\*\*\*\*\n(?P<LIMIT>NL|PL|) (?P<CURRENCY>\$|)?(?P<SB>[.0-9]+)/\$?(?P<BB>[.0-9]+) (?P<GAMETYPE>(Texas Hold\'em|Omaha Hi|Razz)) - (?P<DATETIME>[a-zA-Z]+, [a-zA-Z]+ \d+, \d\d:\d\d:\d\d GMT \d\d\d\d)\nTable (?P<TABLE>[ a-zA-Z0-9]+) \d-max \(Real Money\)\nSeat (?P<BUTTON>[0-9]+)", re.MULTILINE)
|
||||
re_Button = re.compile(ur"^Seat (?P<BUTTON>\d+) is the button", re.MULTILINE)
|
||||
re_PlayerInfo = re.compile("Seat (?P<SEAT>[0-9]+): (?P<PNAME>.*)\s\(\s(\$(?P<CASH>[.0-9]+)) \)")
|
||||
|
@ -68,7 +81,7 @@ class Betfair(HandHistoryConverter):
|
|||
|
||||
m = self.re_GameInfo.search(handText)
|
||||
if not m:
|
||||
logging.info('GameInfo regex did not match')
|
||||
logging.info(_('GameInfo regex did not match'))
|
||||
return None
|
||||
|
||||
mg = m.groupdict()
|
||||
|
@ -99,7 +112,7 @@ class Betfair(HandHistoryConverter):
|
|||
def readHandInfo(self, hand):
|
||||
m = self.re_HandInfo.search(hand.handText)
|
||||
if(m == None):
|
||||
logging.info("Didn't match re_HandInfo")
|
||||
logging.info(_("Didn't match re_HandInfo"))
|
||||
logging.info(hand.handText)
|
||||
return None
|
||||
logging.debug("HID %s, Table %s" % (m.group('HID'), m.group('TABLE')))
|
||||
|
@ -155,7 +168,7 @@ class Betfair(HandHistoryConverter):
|
|||
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")
|
||||
logging.warning(_("No bringin found"))
|
||||
|
||||
def readButton(self, hand):
|
||||
hand.buttonpos = int(self.re_Button.search(hand.handText).group('BUTTON'))
|
||||
|
@ -191,7 +204,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):
|
||||
|
@ -214,9 +227,9 @@ class Betfair(HandHistoryConverter):
|
|||
|
||||
if __name__ == "__main__":
|
||||
parser = OptionParser()
|
||||
parser.add_option("-i", "--input", dest="ipath", help="parse input hand history", default="regression-test-files/betfair/befair.02.04.txt")
|
||||
parser.add_option("-o", "--output", dest="opath", help="output translation to", default="-")
|
||||
parser.add_option("-f", "--follow", dest="follow", help="follow (tail -f) the input", action="store_true", default=False)
|
||||
parser.add_option("-i", "--input", dest="ipath", help=_("parse input hand history"), default="regression-test-files/betfair/befair.02.04.txt")
|
||||
parser.add_option("-o", "--output", dest="opath", help=_("output translation to"), default="-")
|
||||
parser.add_option("-f", "--follow", dest="follow", help=_("follow (tail -f) the input"), action="store_true", default=False)
|
||||
parser.add_option("-q", "--quiet",
|
||||
action="store_const", const=logging.CRITICAL, dest="verbosity", default=logging.INFO)
|
||||
parser.add_option("-v", "--verbose",
|
||||
|
|
|
@ -15,6 +15,17 @@
|
|||
#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.
|
||||
|
||||
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
|
||||
|
||||
# From fpdb_simple
|
||||
card_map = { "0": 0, "2": 2, "3" : 3, "4" : 4, "5" : 5, "6" : 6, "7" : 7, "8" : 8,
|
||||
|
@ -153,7 +164,7 @@ def encodeCard(cardString):
|
|||
return encodeCardList[cardString]
|
||||
|
||||
if __name__ == '__main__':
|
||||
print "fpdb card encoding(same as pokersource)"
|
||||
print _("fpdb card encoding(same as pokersource)")
|
||||
for i in xrange(1, 14):
|
||||
print "card %2d = %s card %2d = %s card %2d = %s card %2d = %s" % \
|
||||
(i, valueSuitFromCard(i), i+13, valueSuitFromCard(i+13), i+26, valueSuitFromCard(i+26), i+39, valueSuitFromCard(i+39))
|
||||
|
|
|
@ -42,10 +42,10 @@ def to_utf8(s):
|
|||
_out = unicode(s, Configuration.LOCALE_ENCODING).encode('utf-8')
|
||||
return _out
|
||||
except UnicodeDecodeError:
|
||||
sys.stderr.write('Could not convert: "%s"\n' % s)
|
||||
sys.stderr.write(_('Could not convert: "%s"\n') % s)
|
||||
raise
|
||||
except UnicodeEncodeError:
|
||||
sys.stderr.write('Could not encode: "%s"\n' % s)
|
||||
sys.stderr.write(_('Could not encode: "%s"\n') % s)
|
||||
raise
|
||||
except TypeError: # TypeError is raised when we give unicode() an already encoded string
|
||||
return s
|
||||
|
@ -57,10 +57,10 @@ def to_db_utf8(s):
|
|||
(_out, _len) = encoder_to_utf.encode(unicode(s))
|
||||
return _out
|
||||
except UnicodeDecodeError:
|
||||
sys.stderr.write('Could not convert: "%s"\n' % s)
|
||||
sys.stderr.write(_('Could not convert: "%s"\n') % s)
|
||||
raise
|
||||
except UnicodeEncodeError:
|
||||
sys.stderr.write('Could not encode: "%s"\n' % s)
|
||||
sys.stderr.write(_('Could not encode: "%s"\n') % s)
|
||||
raise
|
||||
|
||||
def to_gui(s):
|
||||
|
@ -72,10 +72,10 @@ def to_gui(s):
|
|||
(_out, _len) = encoder_to_sys.encode(s, 'replace')
|
||||
return _out
|
||||
except UnicodeDecodeError:
|
||||
sys.stderr.write('Could not convert: "%s"\n' % s)
|
||||
sys.stderr.write(_('Could not convert: "%s"\n') % s)
|
||||
raise
|
||||
except UnicodeEncodeError:
|
||||
sys.stderr.write('Could not encode: "%s"\n' % s)
|
||||
sys.stderr.write(_('Could not encode: "%s"\n') % s)
|
||||
raise
|
||||
|
||||
def to_hex(s):
|
||||
|
@ -83,7 +83,7 @@ def to_hex(s):
|
|||
out = coder_hex.encode(s)[0]
|
||||
return out
|
||||
except UnicodeDecodeError:
|
||||
sys.stderr.write('Could not convert: "%s"\n' % s)
|
||||
sys.stderr.write(_('Could not convert: "%s"\n') % s)
|
||||
return s
|
||||
|
||||
def from_hex(s):
|
||||
|
@ -91,5 +91,5 @@ def from_hex(s):
|
|||
out = coder_hex.decode(s)[0]
|
||||
return out
|
||||
except UnicodeDecodeError:
|
||||
sys.stderr.write('Could not convert: "%s"\n' % s)
|
||||
sys.stderr.write(_('Could not convert: "%s"\n') % s)
|
||||
return s
|
||||
|
|
|
@ -36,6 +36,18 @@ import re
|
|||
import xml.dom.minidom
|
||||
from xml.dom.minidom import Node
|
||||
|
||||
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 logging, logging.config
|
||||
import ConfigParser
|
||||
|
||||
|
@ -89,25 +101,40 @@ 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:
|
||||
print ""
|
||||
check_dir(default_dir)
|
||||
shutil.copyfile(file_name + ".example", config_path)
|
||||
msg = "No %s found\n in %s\n or %s\n" % (file_name, exec_dir, default_dir) \
|
||||
+ "Config file has been created at %s.\n" % config_path
|
||||
msg = _("No %s found\n in %s\n or %s\n") % (file_name, exec_dir, default_dir) \
|
||||
+ _("Config file has been created at %s.\n") % config_path
|
||||
print msg
|
||||
logging.info(msg)
|
||||
file_name = config_path
|
||||
except:
|
||||
print "Error copying .example file, cannot fall back. Exiting.\n"
|
||||
sys.stderr.write("Error copying .example file, cannot fall back. Exiting.\n")
|
||||
print _("Error copying .example file, cannot fall back. Exiting.\n")
|
||||
sys.stderr.write(_("Error copying .example file, cannot fall back. Exiting.\n"))
|
||||
sys.stderr.write( str(sys.exc_info()) )
|
||||
sys.exit()
|
||||
else:
|
||||
print "No %s found, cannot fall back. Exiting.\n" % file_name
|
||||
sys.stderr.write("No %s found, cannot fall back. Exiting.\n" % file_name)
|
||||
print _("No %s found, cannot fall back. Exiting.\n") % file_name
|
||||
sys.stderr.write(_("No %s found, cannot fall back. Exiting.\n") % file_name)
|
||||
sys.exit()
|
||||
return (file_name,True)
|
||||
|
||||
|
@ -137,8 +164,8 @@ def get_logger(file_name, config = "config", fallback = False, log_dir=None, log
|
|||
log = logging.basicConfig(filename=file, level=logging.INFO)
|
||||
log = logging.getLogger()
|
||||
# but it looks like default is no output :-( maybe because all the calls name a module?
|
||||
log.debug("Default logger initialised for "+file)
|
||||
print "Default logger intialised for "+file
|
||||
log.debug(_("Default logger initialised for ")+file)
|
||||
print _("Default logger intialised for ")+file
|
||||
return log
|
||||
|
||||
def check_dir(path, create = True):
|
||||
|
@ -149,7 +176,7 @@ def check_dir(path, create = True):
|
|||
else:
|
||||
return False
|
||||
if create:
|
||||
msg = "Creating directory: '%s'" % (path)
|
||||
msg = _("Creating directory: '%s'") % (path)
|
||||
print msg
|
||||
log.info(msg)
|
||||
os.mkdir(path)#, "utf-8"))
|
||||
|
@ -175,7 +202,7 @@ DATABASE_TYPES = (
|
|||
#LOCALE_ENCODING = locale.getdefaultlocale()[1]
|
||||
LOCALE_ENCODING = locale.getpreferredencoding()
|
||||
if LOCALE_ENCODING == "US-ASCII":
|
||||
print "Default encoding set to US-ASCII, defaulting to CP1252 instead -- If you're not on a Mac, please report this problem."
|
||||
print _("Default encoding set to US-ASCII, defaulting to CP1252 instead -- If you're not on a Mac, please report this problem.")
|
||||
LOCALE_ENCODING = "cp1252"
|
||||
|
||||
|
||||
|
@ -258,7 +285,7 @@ class Site:
|
|||
self.yshift = node.getAttribute("yshift")
|
||||
self.layout = {}
|
||||
|
||||
print "Loading site", self.site_name
|
||||
print _("Loading site"), self.site_name
|
||||
|
||||
for layout_node in node.getElementsByTagName('layout'):
|
||||
lo = Layout(layout_node)
|
||||
|
@ -452,8 +479,8 @@ class Email:
|
|||
self.fetchType = node.getAttribute("fetchType")
|
||||
|
||||
def __str__(self):
|
||||
return " host = %s\n username = %s\n password = %s\n useSsl = %s\n folder = %s\n" \
|
||||
% (self.host, self.username, self.password, self.useSsl, self.folder)
|
||||
return " siteName=%s\n fetchType=%s\n host = %s\n username = %s\n password = %s\n useSsl = %s\n folder = %s\n" \
|
||||
% (self.siteName, self.fetchType, self.host, self.username, self.password, self.useSsl, self.folder)
|
||||
|
||||
class HudUI:
|
||||
def __init__(self, node):
|
||||
|
@ -496,7 +523,7 @@ class General(dict):
|
|||
# e.g. user could set to 4.0 for day to start at 4am local time
|
||||
# [ HH_bulk_path was here - now moved to import section ]
|
||||
for (name, value) in node.attributes.items():
|
||||
log.debug("config.general: adding %s = %s" % (name,value))
|
||||
log.debug(_("config.general: adding %s = %s") % (name,value))
|
||||
self[name] = value
|
||||
|
||||
def __str__(self):
|
||||
|
@ -529,11 +556,44 @@ class GUICashStats(list):
|
|||
try:
|
||||
if child.hasAttribute('xalignment'): xalignment = float(child.getAttribute('xalignment'))
|
||||
except ValueError:
|
||||
print "bad number in xalignment was ignored"
|
||||
log.info("bad number in xalignment was ignored")
|
||||
print _("bad number in xalignment was ignored")
|
||||
log.info(_("bad number in xalignment was ignored"))
|
||||
|
||||
self.append( [col_name, col_title, disp_all, disp_posn, field_format, field_type, xalignment] )
|
||||
|
||||
def get_defaults(self):
|
||||
"""A list of defaults to be called, should there be no entry in config"""
|
||||
defaults = [ [u'game', u'Game', True, True, u'%s', u'str', 0.0],
|
||||
[u'hand', u'Hand', False, False, u'%s', u'str', 0.0],
|
||||
[u'plposition', u'Posn', False, False, u'%s', u'str', 1.0],
|
||||
[u'pname', u'Name', False, False, u'%s', u'str', 0.0],
|
||||
[u'n', u'Hds', True, True, u'%1.0f', u'str', 1.0],
|
||||
[u'avgseats', u'Seats', False, False, u'%3.1f', u'str', 1.0],
|
||||
[u'vpip', u'VPIP', True, True, u'%3.1f', u'str', 1.0],
|
||||
[u'pfr', u'PFR', True, True, u'%3.1f', u'str', 1.0],
|
||||
[u'pf3', u'PF3', True, True, u'%3.1f', u'str', 1.0],
|
||||
[u'aggfac', u'AggFac', True, True, u'%2.2f', u'str', 1.0],
|
||||
[u'aggfrq', u'AggFreq', True, True, u'%3.1f', u'str', 1.0],
|
||||
[u'conbet', u'ContBet', True, True, u'%3.1f', u'str', 1.0],
|
||||
[u'rfi', u'RFI', True, True, u'%3.1f', u'str', 1.0],
|
||||
[u'steals', u'Steals', True, True, u'%3.1f', u'str', 1.0],
|
||||
[u'saw_f', u'Saw_F', True, True, u'%3.1f', u'str', 1.0],
|
||||
[u'sawsd', u'SawSD', True, True, u'%3.1f', u'str', 1.0],
|
||||
[u'wtsdwsf', u'WtSDwsF', True, True, u'%3.1f', u'str', 1.0],
|
||||
[u'wmsd', u'W$SD', True, True, u'%3.1f', u'str', 1.0],
|
||||
[u'flafq', u'FlAFq', True, True, u'%3.1f', u'str', 1.0],
|
||||
[u'tuafq', u'TuAFq', True, True, u'%3.1f', u'str', 1.0],
|
||||
[u'rvafq', u'RvAFq', True, True, u'%3.1f', u'str', 1.0],
|
||||
[u'pofafq', u'PoFAFq', False, False, u'%3.1f', u'str', 1.0],
|
||||
[u'net', u'Net($)', True, True, u'%6.2f', u'cash', 1.0],
|
||||
[u'bbper100', u'bb/100', True, True, u'%4.2f', u'str', 1.0],
|
||||
[u'rake', u'Rake($)', True, True, u'%6.2f', u'cash', 1.0],
|
||||
[u'bb100xr', u'bbxr/100', True, True, u'%4.2f', u'str', 1.0],
|
||||
[u'variance', u'Variance', True, True, u'%5.2f', u'str', 1.0]
|
||||
]
|
||||
for col in defaults:
|
||||
self.append (col)
|
||||
|
||||
# def __str__(self):
|
||||
# s = ""
|
||||
# for l in self:
|
||||
|
@ -550,8 +610,8 @@ class Config:
|
|||
if file is not None: # config file path passed in
|
||||
file = os.path.expanduser(file)
|
||||
if not os.path.exists(file):
|
||||
print "Configuration file %s not found. Using defaults." % (file)
|
||||
sys.stderr.write("Configuration file %s not found. Using defaults." % (file))
|
||||
print _("Configuration file %s not found. Using defaults.") % (file)
|
||||
sys.stderr.write(_("Configuration file %s not found. Using defaults.") % (file))
|
||||
file = None
|
||||
|
||||
if file is None: (file,self.example_copy) = get_config("HUD_config.xml", True)
|
||||
|
@ -567,13 +627,13 @@ class Config:
|
|||
|
||||
# Parse even if there was no real config file found and we are using the example
|
||||
# If using the example, we'll edit it later
|
||||
log.info("Reading configuration file %s" % file)
|
||||
print "\nReading configuration file %s\n" % file
|
||||
log.info(_("Reading configuration file %s") % file)
|
||||
print _("\nReading configuration file %s\n") % file
|
||||
try:
|
||||
doc = xml.dom.minidom.parse(file)
|
||||
self.file_error = None
|
||||
except:
|
||||
log.error("Error parsing %s. See error log file." % (file))
|
||||
log.error(_("Error parsing %s. See error log file.") % (file))
|
||||
traceback.print_exc(file=sys.stderr)
|
||||
self.file_error = sys.exc_info()[1]
|
||||
# we could add a parameter to decide whether to return or read a line and exit?
|
||||
|
@ -595,11 +655,14 @@ class Config:
|
|||
self.db_selected = None # database the user would like to use
|
||||
self.tv = None
|
||||
self.general = General()
|
||||
self.emails = {}
|
||||
self.gui_cash_stats = GUICashStats()
|
||||
|
||||
for gen_node in doc.getElementsByTagName("general"):
|
||||
self.general.add_elements(node=gen_node) # add/overwrite elements in self.general
|
||||
|
||||
if doc.getElementsByTagName("gui_cash_stats") == []:
|
||||
self.gui_cash_stats.get_defaults()
|
||||
for gcs_node in doc.getElementsByTagName("gui_cash_stats"):
|
||||
self.gui_cash_stats.add_elements(node=gcs_node) # add/overwrite elements in self.gui_cash_stats
|
||||
|
||||
|
@ -655,7 +718,8 @@ class Config:
|
|||
|
||||
for email_node in doc.getElementsByTagName("email"):
|
||||
email = Email(node = email_node)
|
||||
self.email = email
|
||||
if email.siteName!="": #FIXME: Why on earth is this needed?
|
||||
self.emails[email.siteName+"_"+email.fetchType]=email
|
||||
|
||||
for hui_node in doc.getElementsByTagName('hud_ui'):
|
||||
hui = HudUI(node = hui_node)
|
||||
|
@ -702,6 +766,12 @@ class Config:
|
|||
if site_node.getAttribute("site_name") == site:
|
||||
return site_node
|
||||
|
||||
def getEmailNode(self, siteName, fetchType):
|
||||
for emailNode in self.doc.getElementsByTagName("email"):
|
||||
if emailNode.getAttribute("siteName") == siteName and emailNode.getAttribute("fetchType") == fetchType:
|
||||
return emailNode
|
||||
#end def getEmailNode
|
||||
|
||||
def getGameNode(self,gameName):
|
||||
"""returns DOM game node for a given game"""
|
||||
for gameNode in self.doc.getElementsByTagName("game"):
|
||||
|
@ -776,6 +846,15 @@ class Config:
|
|||
else:
|
||||
return(l)
|
||||
|
||||
def editEmail(self, siteName, fetchType, newEmail):
|
||||
emailNode = self.getEmailNode(siteName, fetchType)
|
||||
emailNode.setAttribute("host", newEmail.host)
|
||||
emailNode.setAttribute("username", newEmail.username)
|
||||
emailNode.setAttribute("password", newEmail.password)
|
||||
emailNode.setAttribute("folder", newEmail.folder)
|
||||
emailNode.setAttribute("useSsl", newEmail.useSsl)
|
||||
#end def editEmail
|
||||
|
||||
def edit_layout(self, site_name, max, width = None, height = None,
|
||||
fav_seat = None, locations = None):
|
||||
site_node = self.get_site_node(site_name)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -51,8 +51,8 @@ class DerivedStats():
|
|||
self.handsplayers[player[1]]['position'] = 2
|
||||
self.handsplayers[player[1]]['street0_3BChance'] = False
|
||||
self.handsplayers[player[1]]['street0_3BDone'] = False
|
||||
self.handsplayers[player[1]]['street0_4BChance'] = False
|
||||
self.handsplayers[player[1]]['street0_4BDone'] = False
|
||||
self.handsplayers[player[1]]['street0_4BChance'] = False #FIXME: this might not actually be implemented
|
||||
self.handsplayers[player[1]]['street0_4BDone'] = False #FIXME: this might not actually be implemented
|
||||
self.handsplayers[player[1]]['raiseFirstInChance'] = False
|
||||
self.handsplayers[player[1]]['raisedFirstIn'] = False
|
||||
self.handsplayers[player[1]]['foldBbToStealChance'] = False
|
||||
|
@ -74,9 +74,16 @@ class DerivedStats():
|
|||
self.handsplayers[player[1]]['foldToOtherRaisedStreet%d' %i] = False
|
||||
|
||||
#FIXME - Everything below this point is incomplete.
|
||||
self.handsplayers[player[1]]['other3BStreet0'] = False
|
||||
self.handsplayers[player[1]]['other4BStreet0'] = False
|
||||
self.handsplayers[player[1]]['otherRaisedStreet0'] = False
|
||||
self.handsplayers[player[1]]['foldToOtherRaisedStreet0'] = False
|
||||
for i in range(1,5):
|
||||
self.handsplayers[player[1]]['foldToStreet%dCBChance' %i] = False
|
||||
self.handsplayers[player[1]]['foldToStreet%dCBDone' %i] = False
|
||||
self.handsplayers[player[1]]['wonWhenSeenStreet2'] = 0.0
|
||||
self.handsplayers[player[1]]['wonWhenSeenStreet3'] = 0.0
|
||||
self.handsplayers[player[1]]['wonWhenSeenStreet4'] = 0.0
|
||||
|
||||
self.assembleHands(self.hand)
|
||||
self.assembleHandsPlayers(self.hand)
|
||||
|
@ -290,9 +297,12 @@ class DerivedStats():
|
|||
# print "p_actions:", self.pfba(actions), "p_folds:", self.pfba(actions, l=('folds',)), "alliners:", alliners
|
||||
# pas = set.union(self.pfba(actions) - self.pfba(actions, l=('folds',)), alliners)
|
||||
|
||||
# hand.players includes people that are sitting out on some sites.
|
||||
# Those that posted an ante should have been deal cards.
|
||||
p_in = set([x[0] for x in hand.actions['BLINDSANTES']])
|
||||
# hand.players includes people that are sitting out on some sites for cash games
|
||||
# actionStreets[1] is 'DEAL', 'THIRD', 'PREFLOP', so any player dealt cards
|
||||
# must act on this street if dealt cards. Almost certainly broken for the 'all-in blind' case
|
||||
# and right now i don't care - CG
|
||||
p_in = set([x[0] for x in hand.actions[hand.actionStreets[1]]])
|
||||
|
||||
for (i, street) in enumerate(hand.actionStreets):
|
||||
actions = hand.actions[street]
|
||||
p_in = p_in - self.pfba(actions, l=('folds',))
|
||||
|
|
|
@ -34,11 +34,11 @@ class Everleaf(HandHistoryConverter):
|
|||
# Static regexes
|
||||
re_SplitHands = re.compile(r"\n\n\n+")
|
||||
re_TailSplitHands = re.compile(r"(\n\n\n+)")
|
||||
re_GameInfo = re.compile(ur"^(Blinds )?(?P<CURRENCY>\$| €|)(?P<SB>[.0-9]+)/(?:\$| €)?(?P<BB>[.0-9]+) (?P<LIMIT>NL|PL|) ?(?P<GAME>(Hold\'em|Omaha|7 Card Stud))", re.MULTILINE)
|
||||
#re.compile(ur"^(Blinds )?(?P<CURRENCY>\$| €|)(?P<SB>[.0-9]+)/(?:\$| €)?(?P<BB>[.0-9]+) (?P<LIMIT>NL|PL|) (?P<GAME>(Hold\'em|Omaha|7 Card Stud))", re.MULTILINE)
|
||||
re_HandInfo = re.compile(ur".*#(?P<HID>[0-9]+)\n.*\n(Blinds )?(?:\$| €|)(?P<SB>[.0-9]+)/(?:\$| €|)(?P<BB>[.0-9]+) (?P<GAMETYPE>.*) - (?P<DATETIME>\d\d\d\d/\d\d/\d\d - \d\d:\d\d:\d\d)\nTable (?P<TABLE>.+$)", re.MULTILINE)
|
||||
re_Button = re.compile(ur"^Seat (?P<BUTTON>\d+) is the button", re.MULTILINE)
|
||||
re_PlayerInfo = re.compile(ur"^Seat (?P<SEAT>[0-9]+): (?P<PNAME>.*) \(\s+((?:\$| €|) (?P<CASH>[.0-9]+) (USD|EURO|Chips)|new player|All-in) \)", re.MULTILINE)
|
||||
re_GameInfo = re.compile(ur"^(Blinds )?(?P<CURRENCY>[$€]?)(?P<SB>[.0-9]+)/[$€]?(?P<BB>[.0-9]+) (?P<LIMIT>NL|PL|) ?(?P<GAME>(Hold\'em|Omaha|7 Card Stud))", re.MULTILINE)
|
||||
#re.compile(ur"^(Blinds )?(?P<CURRENCY>\$| €|)(?P<SB>[.0-9]+)/(?:\$| €)?(?P<BB>[.0-9]+) (?P<LIMIT>NL|PL|) ?(?P<GAME>(Hold\'em|Omaha|7 Card Stud))", re.MULTILINE)
|
||||
re_HandInfo = re.compile(ur".*#(?P<HID>[0-9]+)\n.*\n(Blinds )?(?P<CURRENCY>[$€])?(?P<SB>[.0-9]+)/(?:[$€])?(?P<BB>[.0-9]+) (?P<GAMETYPE>.*) - (?P<DATETIME>\d\d\d\d/\d\d/\d\d - \d\d:\d\d:\d\d)\nTable (?P<TABLE>.+$)", re.MULTILINE)
|
||||
re_Button = re.compile(ur"^Seat (?P<BUTTON>\d+) is the button$", re.MULTILINE)
|
||||
re_PlayerInfo = re.compile(ur"^Seat (?P<SEAT>[0-9]+): (?P<PNAME>.*) \(\s+([$€]? (?P<CASH>[.0-9]+) (USD|EURO|Chips)|new player|All-in) \)$", re.MULTILINE)
|
||||
re_Board = re.compile(ur"\[ (?P<CARDS>.+) \]")
|
||||
re_TourneyInfoFromFilename = re.compile(ur".*TID_(?P<TOURNO>[0-9]+)-(?P<TABLE>[0-9]+)\.txt")
|
||||
|
||||
|
@ -50,16 +50,16 @@ class Everleaf(HandHistoryConverter):
|
|||
self.compiledPlayers = players
|
||||
player_re = "(?P<PNAME>" + "|".join(map(re.escape, players)) + ")"
|
||||
logging.debug("player_re: "+ player_re)
|
||||
self.re_PostSB = re.compile(ur"^%s: posts small blind \[(?:\$| €|) (?P<SB>[.0-9]+)" % player_re, re.MULTILINE)
|
||||
self.re_PostBB = re.compile(ur"^%s: posts big blind \[(?:\$| €|) (?P<BB>[.0-9]+)" % player_re, re.MULTILINE)
|
||||
self.re_PostBoth = re.compile(ur"^%s: posts both blinds \[(?:\$| €|) (?P<SBBB>[.0-9]+)" % player_re, re.MULTILINE)
|
||||
self.re_Antes = re.compile(ur"^%s: posts ante \[(?:\$| €|) (?P<ANTE>[.0-9]+)" % player_re, re.MULTILINE)
|
||||
self.re_BringIn = re.compile(ur"^%s posts bring-in (?:\$| €|)(?P<BRINGIN>[.0-9]+)\." % player_re, re.MULTILINE)
|
||||
self.re_HeroCards = re.compile(ur"^Dealt to %s \[ (?P<CARDS>.*) \]" % player_re, re.MULTILINE)
|
||||
self.re_Action = re.compile(ur"^%s(?P<ATYPE>: bets| checks| raises| calls| folds)(\s\[(?:\$| €|) (?P<BET>[.,\d]+) (USD|EURO|Chips)\])?" % player_re, re.MULTILINE)
|
||||
#self.re_Action = re.compile(ur"^%s(?P<ATYPE>: bets| checks| raises| calls| folds| complete to)(\s\[?(?:\$| €|) ?(?P<BET>\d+\.?\d*)\.?\s?(USD|EUR|)\]?)?" % player_re, re.MULTILINE)
|
||||
self.re_PostSB = re.compile(ur"^%s: posts small blind \[[$€]? (?P<SB>[.0-9]+)\s.*\]$" % player_re, re.MULTILINE)
|
||||
self.re_PostBB = re.compile(ur"^%s: posts big blind \[[$€]? (?P<BB>[.0-9]+)\s.*\]$" % player_re, re.MULTILINE)
|
||||
self.re_PostBoth = re.compile(ur"^%s: posts both blinds \[[$€]? (?P<SBBB>[.0-9]+)\s.*\]$" % player_re, re.MULTILINE)
|
||||
self.re_Antes = re.compile(ur"^%s: posts ante \[[$€]? (?P<ANTE>[.0-9]+)\s.*\]$" % player_re, re.MULTILINE)
|
||||
self.re_BringIn = re.compile(ur"^%s posts bring-in [$€]? (?P<BRINGIN>[.0-9]+)\." % player_re, re.MULTILINE)
|
||||
self.re_HeroCards = re.compile(ur"^Dealt to %s \[ (?P<CARDS>.*) \]$" % player_re, re.MULTILINE)
|
||||
# ^%s(?P<ATYPE>: bets| checks| raises| calls| folds)(\s\[(?:\$| €|) (?P<BET>[.,\d]+) (USD|EURO|Chips)\])?
|
||||
self.re_Action = re.compile(ur"^%s(?P<ATYPE>: bets| checks| raises| calls| folds)(\s\[(?:[$€]?) (?P<BET>[.,\d]+)\s?(USD|EURO|Chips|)\])?" % player_re, re.MULTILINE)
|
||||
self.re_ShowdownAction = re.compile(ur"^%s shows \[ (?P<CARDS>.*) \]" % player_re, re.MULTILINE)
|
||||
self.re_CollectPot = re.compile(ur"^%s wins (?:\$| €|) (?P<POT>[.\d]+) (USD|EURO|chips)(.*?\[ (?P<CARDS>.*?) \])?" % player_re, re.MULTILINE)
|
||||
self.re_CollectPot = re.compile(ur"^%s wins (?:[$€]?)\s?(?P<POT>[.\d]+) (USD|EURO|chips)(.*?\[ (?P<CARDS>.*?) \])?" % player_re, re.MULTILINE)
|
||||
self.re_SitsOut = re.compile(ur"^%s sits out" % player_re, re.MULTILINE)
|
||||
|
||||
def readSupportedGames(self):
|
||||
|
@ -112,7 +112,7 @@ or None if we fail to get the info """
|
|||
'Razz' : ('stud','razz'),
|
||||
'7 Card Stud' : ('stud','studhi')
|
||||
}
|
||||
currencies = { u' €':'EUR', '$':'USD', '':'T$' }
|
||||
currencies = { u'€':'EUR', '$':'USD', '':'T$'}
|
||||
if 'LIMIT' in mg:
|
||||
info['limitType'] = limits[mg['LIMIT']]
|
||||
if 'GAME' in mg:
|
||||
|
@ -141,6 +141,11 @@ or None if we fail to get the info """
|
|||
hand.tablename = m.group('TABLE')
|
||||
hand.maxseats = 6 # assume 6-max unless we have proof it's a larger/smaller game, since everleaf doesn't give seat max info
|
||||
|
||||
currencies = { u'€':'EUR', '$':'USD', '':'T$', None:'T$' }
|
||||
mg = m.groupdict()
|
||||
hand.gametype['currency'] = currencies[mg['CURRENCY']]
|
||||
|
||||
|
||||
t = self.re_TourneyInfoFromFilename.search(self.in_path)
|
||||
if t:
|
||||
tourno = t.group('TOURNO')
|
||||
|
|
|
@ -30,6 +30,17 @@ import logging
|
|||
# logging has been set up in fpdb.py or HUD_main.py, use their settings:
|
||||
log = logging.getLogger("filter")
|
||||
|
||||
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
|
||||
import Database
|
||||
|
@ -48,14 +59,14 @@ class Filters(threading.Thread):
|
|||
self.display = display
|
||||
|
||||
# text used on screen stored here so that it can be configured
|
||||
self.filterText = {'limitsall':'All', 'limitsnone':'None', 'limitsshow':'Show _Limits'
|
||||
,'seatsbetween':'Between:', 'seatsand':'And:', 'seatsshow':'Show Number of _Players'
|
||||
,'playerstitle':'Hero:', 'sitestitle':'Sites:', 'gamestitle':'Games:'
|
||||
,'limitstitle':'Limits:', 'seatstitle':'Number of Players:'
|
||||
,'groupstitle':'Grouping:', 'posnshow':'Show Position Stats:'
|
||||
,'datestitle':'Date:'
|
||||
,'groupsall':'All Players'
|
||||
,'limitsFL':'FL', 'limitsNL':'NL', 'limitsPL':'PL', 'ring':'Ring', 'tour':'Tourney'
|
||||
self.filterText = {'limitsall':_('All'), 'limitsnone':_('None'), 'limitsshow':_('Show _Limits')
|
||||
,'seatsbetween':_('Between:'), 'seatsand':_('And:'), 'seatsshow':_('Show Number of _Players')
|
||||
,'playerstitle':_('Hero:'), 'sitestitle':_('Sites:'), 'gamestitle':_('Games:')
|
||||
,'limitstitle':_('Limits:'), 'seatstitle':_('Number of Players:')
|
||||
,'groupstitle':_('Grouping:'), 'posnshow':_('Show Position Stats:')
|
||||
,'datestitle':_('Date:')
|
||||
,'groupsall':_('All Players')
|
||||
,'limitsFL':'FL', 'limitsNL':'NL', 'limitsPL':'PL', 'ring':_('Ring'), 'tour':_('Tourney')
|
||||
}
|
||||
|
||||
gen = self.conf.get_general_params()
|
||||
|
@ -89,7 +100,7 @@ class Filters(threading.Thread):
|
|||
if len(result) == 1:
|
||||
self.siteid[site] = result[0][0]
|
||||
else:
|
||||
print "Either 0 or more than one site matched (%s) - EEK" % site
|
||||
print _("Either 0 or more than one site matched (%s) - EEK") % site
|
||||
|
||||
# For use in date ranges.
|
||||
self.start_date = gtk.Entry(max=12)
|
||||
|
@ -299,7 +310,7 @@ class Filters(threading.Thread):
|
|||
#end def registerButton2Callback
|
||||
|
||||
def cardCallback(self, widget, data=None):
|
||||
log.debug( "%s was toggled %s" % (data, ("OFF", "ON")[widget.get_active()]) )
|
||||
log.debug( _("%s was toggled %s") % (data, (_("OFF"), _("ON"))[widget.get_active()]) )
|
||||
|
||||
def createPlayerLine(self, hbox, site, player):
|
||||
log.debug('add:"%s"' % player)
|
||||
|
@ -380,19 +391,19 @@ class Filters(threading.Thread):
|
|||
def __set_site_select(self, w, site):
|
||||
#print w.get_active()
|
||||
self.sites[site] = w.get_active()
|
||||
log.debug("self.sites[%s] set to %s" %(site, self.sites[site]))
|
||||
log.debug(_("self.sites[%s] set to %s") %(site, self.sites[site]))
|
||||
#end def __set_site_select
|
||||
|
||||
def __set_game_select(self, w, game):
|
||||
#print w.get_active()
|
||||
self.games[game] = w.get_active()
|
||||
log.debug("self.games[%s] set to %s" %(game, self.games[game]))
|
||||
log.debug(_("self.games[%s] set to %s") %(game, self.games[game]))
|
||||
#end def __set_game_select
|
||||
|
||||
def __set_limit_select(self, w, limit):
|
||||
#print "__set_limit_select: limit =", limit, w.get_active()
|
||||
self.limits[limit] = w.get_active()
|
||||
log.debug("self.limit[%s] set to %s" %(limit, self.limits[limit]))
|
||||
log.debug(_("self.limit[%s] set to %s") %(limit, self.limits[limit]))
|
||||
if limit.isdigit() or (len(limit) > 2 and (limit[-2:] == 'nl' or limit[-2:] == 'fl' or limit[-2:] == 'pl')):
|
||||
if self.limits[limit]:
|
||||
if self.cbNoLimits is not None:
|
||||
|
@ -529,13 +540,13 @@ class Filters(threading.Thread):
|
|||
def __set_seat_select(self, w, seat):
|
||||
#print "__set_seat_select: seat =", seat, "active =", w.get_active()
|
||||
self.seats[seat] = w.get_active()
|
||||
log.debug( "self.seats[%s] set to %s" %(seat, self.seats[seat]) )
|
||||
log.debug( _("self.seats[%s] set to %s") %(seat, self.seats[seat]) )
|
||||
#end def __set_seat_select
|
||||
|
||||
def __set_group_select(self, w, group):
|
||||
#print "__set_seat_select: seat =", seat, "active =", w.get_active()
|
||||
self.groups[group] = w.get_active()
|
||||
log.debug( "self.groups[%s] set to %s" %(group, self.groups[group]) )
|
||||
log.debug( _("self.groups[%s] set to %s") %(group, self.groups[group]) )
|
||||
|
||||
def fillPlayerFrame(self, vbox, display):
|
||||
top_hbox = gtk.HBox(False, 0)
|
||||
|
@ -568,7 +579,7 @@ class Filters(threading.Thread):
|
|||
self.sbGroups['allplayers'] = cb
|
||||
self.groups['allplayers'] = False
|
||||
|
||||
lbl = gtk.Label('Min # Hands:')
|
||||
lbl = gtk.Label(_('Min # Hands:'))
|
||||
lbl.set_alignment(xalign=1.0, yalign=0.5)
|
||||
hbox.pack_start(lbl, expand=True, padding=3)
|
||||
|
||||
|
@ -634,8 +645,8 @@ class Filters(threading.Thread):
|
|||
vbox1.pack_start(hbox, False, True, 0)
|
||||
self.createTourneyTypeLine(hbox, line[0])
|
||||
else:
|
||||
print "INFO: No tourney types returned from database"
|
||||
log.info("No tourney types returned from database")
|
||||
print _("INFO: No tourney types returned from database")
|
||||
log.info(_("No tourney types returned from database"))
|
||||
#end def fillTourneyTypesFrame
|
||||
|
||||
def fillGamesFrame(self, vbox):
|
||||
|
@ -661,8 +672,8 @@ class Filters(threading.Thread):
|
|||
vbox1.pack_start(hbox, False, True, 0)
|
||||
self.createGameLine(hbox, line[0])
|
||||
else:
|
||||
print "INFO: No games returned from database"
|
||||
log.info("No games returned from database")
|
||||
print _("INFO: No games returned from database")
|
||||
log.info(_("No games returned from database"))
|
||||
#end def fillGamesFrame
|
||||
|
||||
def fillLimitsFrame(self, vbox, display):
|
||||
|
@ -750,8 +761,8 @@ class Filters(threading.Thread):
|
|||
self.cbPL = self.createLimitLine(hbox, 'pl', self.filterText['limitsPL'])
|
||||
dest = vbox2 # for ring/tour buttons
|
||||
else:
|
||||
print "INFO: No games returned from database"
|
||||
log.info("No games returned from database")
|
||||
print _("INFO: No games returned from database")
|
||||
log.info(_("No games returned from database"))
|
||||
|
||||
if "Type" in display and display["Type"] == True and self.found['ring'] and self.found['tour']:
|
||||
rb1 = gtk.RadioButton(None, self.filterText['ring'])
|
||||
|
@ -899,7 +910,7 @@ class Filters(threading.Thread):
|
|||
btn_end.set_image(gtk.image_new_from_stock(gtk.STOCK_INDEX, gtk.ICON_SIZE_BUTTON))
|
||||
btn_end.connect('clicked', self.__calendar_dialog, self.end_date)
|
||||
|
||||
btn_clear = gtk.Button(label=' Clear Dates ')
|
||||
btn_clear = gtk.Button(label=_(' Clear Dates '))
|
||||
btn_clear.connect('clicked', self.__clear_dates)
|
||||
|
||||
hbox.pack_start(lbl_end, expand=False, padding=3)
|
||||
|
@ -926,13 +937,13 @@ class Filters(threading.Thread):
|
|||
|
||||
def __calendar_dialog(self, widget, entry):
|
||||
d = gtk.Window(gtk.WINDOW_TOPLEVEL)
|
||||
d.set_title('Pick a date')
|
||||
d.set_title(_('Pick a date'))
|
||||
|
||||
vb = gtk.VBox()
|
||||
cal = gtk.Calendar()
|
||||
vb.pack_start(cal, expand=False, padding=0)
|
||||
|
||||
btn = gtk.Button('Done')
|
||||
btn = gtk.Button(_('Done'))
|
||||
btn.connect('clicked', self.__get_date, cal, entry, d)
|
||||
|
||||
vb.pack_start(btn, expand=False, padding=4)
|
||||
|
|
|
@ -31,49 +31,55 @@ class Fulltilt(HandHistoryConverter):
|
|||
codepage = ["utf-16", "cp1252", "utf-8"]
|
||||
siteId = 1 # Needs to match id entry in Sites database
|
||||
|
||||
substitutions = {
|
||||
'LEGAL_ISO' : "USD|EUR|GBP|CAD|FPP", # legal ISO currency codes
|
||||
'LS' : u"\$|\u20AC|\xe2\x82\xac|", # legal currency symbols - Euro(cp1252, utf-8)
|
||||
'TAB' : u"-\u2013\s\da-zA-Z"
|
||||
}
|
||||
|
||||
# Static regexes
|
||||
re_GameInfo = re.compile('''.*\#(?P<HID>[0-9]+):\s
|
||||
re_GameInfo = re.compile(u'''.*\#(?P<HID>[0-9]+):\s
|
||||
(?:(?P<TOURNAMENT>.+)\s\((?P<TOURNO>\d+)\),\s)?
|
||||
.+
|
||||
-\s(?P<CURRENCY>\$|)?
|
||||
-\s(?P<CURRENCY>[%(LS)s]|)?
|
||||
(?P<SB>[.0-9]+)/
|
||||
\$?(?P<BB>[.0-9]+)\s
|
||||
[%(LS)s]?(?P<BB>[.0-9]+)\s
|
||||
(Ante\s\$?(?P<ANTE>[.0-9]+)\s)?-\s
|
||||
\$?(?P<CAP>[.0-9]+\sCap\s)?
|
||||
[%(LS)s]?(?P<CAP>[.0-9]+\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))
|
||||
''', re.VERBOSE)
|
||||
''' % substitutions, re.VERBOSE)
|
||||
re_SplitHands = re.compile(r"\n\n+")
|
||||
re_TailSplitHands = re.compile(r"(\n\n+)")
|
||||
re_HandInfo = re.compile(r'''.*\#(?P<HID>[0-9]+):\s
|
||||
(?:(?P<TOURNAMENT>.+)\s\((?P<TOURNO>\d+)\),\s)?
|
||||
(Table|Match)\s
|
||||
(?P<PLAY>Play\sChip\s|PC)?
|
||||
(?P<TABLE>[-\s\da-zA-Z]+)\s
|
||||
(?P<TABLE>[%(TAB)s]+)\s
|
||||
(\((?P<TABLEATTRIBUTES>.+)\)\s)?-\s
|
||||
\$?(?P<SB>[.0-9]+)/\$?(?P<BB>[.0-9]+)\s(Ante\s\$?(?P<ANTE>[.0-9]+)\s)?-\s
|
||||
\$?(?P<CAP>[.0-9]+\sCap\s)?
|
||||
[%(LS)s]?(?P<SB>[.0-9]+)/[%(LS)s]?(?P<BB>[.0-9]+)\s(Ante\s[%(LS)s]?(?P<ANTE>[.0-9]+)\s)?-\s
|
||||
[%(LS)s]?(?P<CAP>[.0-9]+\sCap\s)?
|
||||
(?P<GAMETYPE>[a-zA-Z\/\'\s]+)\s-\s
|
||||
(?P<DATETIME>\d+:\d+:\d+\s(?P<TZ1>\w+)\s-\s\d+/\d+/\d+|\d+:\d+\s(?P<TZ2>\w+)\s-\s\w+\,\s\w+\s\d+\,\s\d+)
|
||||
(?P<PARTIAL>\(partial\))?\n
|
||||
(?:.*?\n(?P<CANCELLED>Hand\s\#(?P=HID)\shas\sbeen\scanceled))?
|
||||
''', re.VERBOSE|re.DOTALL)
|
||||
''' % substitutions, re.VERBOSE|re.DOTALL)
|
||||
re_TourneyExtraInfo = re.compile('''(((?P<TOURNEY_NAME>[^$]+)?
|
||||
(?P<CURRENCY>\$)?(?P<BUYIN>[.0-9]+)?\s*\+\s*\$?(?P<FEE>[.0-9]+)?
|
||||
(?P<CURRENCY>[%(LS)s])?(?P<BUYIN>[.0-9]+)?\s*\+\s*[%(LS)s]?(?P<FEE>[.0-9]+)?
|
||||
(\s(?P<SPECIAL>(KO|Heads\sUp|Matrix\s\dx|Rebuy|Madness)))?
|
||||
(\s(?P<SHOOTOUT>Shootout))?
|
||||
(\s(?P<SNG>Sit\s&\sGo))?
|
||||
(\s\((?P<TURBO>Turbo)\))?)|(?P<UNREADABLE_INFO>.+))
|
||||
''', re.VERBOSE)
|
||||
''' % substitutions, re.VERBOSE)
|
||||
re_Button = re.compile('^The button is in seat #(?P<BUTTON>\d+)', re.MULTILINE)
|
||||
re_PlayerInfo = re.compile('Seat (?P<SEAT>[0-9]+): (?P<PNAME>.{2,15}) \(\$(?P<CASH>[,.0-9]+)\)$', re.MULTILINE)
|
||||
re_TourneysPlayerInfo = re.compile('Seat (?P<SEAT>[0-9]+): (?P<PNAME>.{2,15}) \(\$?(?P<CASH>[,.0-9]+)\)(, is sitting out)?$', re.MULTILINE)
|
||||
re_PlayerInfo = re.compile('Seat (?P<SEAT>[0-9]+): (?P<PNAME>.{2,15}) \([%(LS)s](?P<CASH>[,.0-9]+)\)$' % substitutions, re.MULTILINE)
|
||||
re_TourneysPlayerInfo = re.compile('Seat (?P<SEAT>[0-9]+): (?P<PNAME>.{2,15}) \([%(LS)s]?(?P<CASH>[,.0-9]+)\)(, is sitting out)?$' % substitutions, re.MULTILINE)
|
||||
re_Board = re.compile(r"\[(?P<CARDS>.+)\]")
|
||||
|
||||
#static regex for tourney purpose
|
||||
re_TourneyInfo = re.compile('''Tournament\sSummary\s
|
||||
(?P<TOURNAMENT_NAME>[^$(]+)?\s*
|
||||
((?P<CURRENCY>\$|)?(?P<BUYIN>[.0-9]+)\s*\+\s*\$?(?P<FEE>[.0-9]+)\s)?
|
||||
((?P<CURRENCY>[%(LS)s]|)?(?P<BUYIN>[.0-9]+)\s*\+\s*[%(LS)s]?(?P<FEE>[.0-9]+)\s)?
|
||||
((?P<SPECIAL>(KO|Heads\sUp|Matrix\s\dx|Rebuy|Madness))\s)?
|
||||
((?P<SHOOTOUT>Shootout)\s)?
|
||||
((?P<SNG>Sit\s&\sGo)\s)?
|
||||
|
@ -83,24 +89,24 @@ class Fulltilt(HandHistoryConverter):
|
|||
(?P<GAME>(Hold\'em|Omaha\sHi|Omaha\sH/L|7\sCard\sStud|Stud\sH/L|Razz|Stud\sHi))\s
|
||||
(\((?P<TURBO2>Turbo)\)\s)?
|
||||
(?P<LIMIT>(No\sLimit|Pot\sLimit|Limit))?
|
||||
''', re.VERBOSE)
|
||||
re_TourneyBuyInFee = re.compile("Buy-In: (?P<BUYIN_CURRENCY>\$|)?(?P<BUYIN>[.0-9]+) \+ \$?(?P<FEE>[.0-9]+)")
|
||||
''' % substitutions, re.VERBOSE)
|
||||
re_TourneyBuyInFee = re.compile("Buy-In: (?P<BUYIN_CURRENCY>[%(LS)s]|)?(?P<BUYIN>[.0-9]+) \+ [%(LS)s]?(?P<FEE>[.0-9]+)" % substitutions)
|
||||
re_TourneyBuyInChips = re.compile("Buy-In Chips: (?P<BUYINCHIPS>\d+)")
|
||||
re_TourneyEntries = re.compile("(?P<ENTRIES>\d+) Entries")
|
||||
re_TourneyPrizePool = re.compile("Total Prize Pool: (?P<PRIZEPOOL_CURRENCY>\$|)?(?P<PRIZEPOOL>[.,0-9]+)")
|
||||
re_TourneyRebuyCost = re.compile("Rebuy: (?P<REBUY_CURRENCY>\$|)?(?P<REBUY_COST>[.,0-9]+)")
|
||||
re_TourneyAddOnCost = re.compile("Add-On: (?P<ADDON_CURRENCY>\$|)?(?P<ADDON_COST>[.,0-9]+)")
|
||||
re_TourneyPrizePool = re.compile("Total Prize Pool: (?P<PRIZEPOOL_CURRENCY>[%(LS)s]|)?(?P<PRIZEPOOL>[.,0-9]+)" % substitutions)
|
||||
re_TourneyRebuyCost = re.compile("Rebuy: (?P<REBUY_CURRENCY>[%(LS)s]|)?(?P<REBUY_COST>[.,0-9]+)"% substitutions)
|
||||
re_TourneyAddOnCost = re.compile("Add-On: (?P<ADDON_CURRENCY>[%(LS)s]|)?(?P<ADDON_COST>[.,0-9]+)"% substitutions)
|
||||
re_TourneyRebuyCount = re.compile("performed (?P<REBUY_COUNT>\d+) Rebuy")
|
||||
re_TourneyAddOnCount = re.compile("performed (?P<ADDON_COUNT>\d+) Add-On")
|
||||
re_TourneyRebuysTotal = re.compile("Total Rebuys: (?P<REBUY_TOTAL>\d+)")
|
||||
re_TourneyAddOnsTotal = re.compile("Total Add-Ons: (?P<ADDONS_TOTAL>\d+)")
|
||||
re_TourneyRebuyChips = re.compile("Rebuy Chips: (?P<REBUY_CHIPS>\d+)")
|
||||
re_TourneyAddOnChips = re.compile("Add-On Chips: (?P<ADDON_CHIPS>\d+)")
|
||||
re_TourneyKOBounty = re.compile("Knockout Bounty: (?P<KO_BOUNTY_CURRENCY>\$|)?(?P<KO_BOUNTY_AMOUNT>[.,0-9]+)")
|
||||
re_TourneyKOBounty = re.compile("Knockout Bounty: (?P<KO_BOUNTY_CURRENCY>[%(LS)s]|)?(?P<KO_BOUNTY_AMOUNT>[.,0-9]+)" % substitutions)
|
||||
re_TourneyKoCount = re.compile("received (?P<COUNT_KO>\d+) Knockout Bounty Award(s)?")
|
||||
re_TourneyTimeInfo = re.compile("Tournament started: (?P<STARTTIME>.*)\nTournament ((?P<IN_PROGRESS>is still in progress)?|(finished:(?P<ENDTIME>.*))?)$")
|
||||
|
||||
re_TourneysPlayersSummary = re.compile("^(?P<RANK>(Still Playing|\d+))( - |: )(?P<PNAME>[^\n,]+)(, )?(?P<WINNING_CURRENCY>\$|)?(?P<WINNING>[.\d]+)?", re.MULTILINE)
|
||||
re_TourneysPlayersSummary = re.compile("^(?P<RANK>(Still Playing|\d+))( - |: )(?P<PNAME>[^\n,]+)(, )?(?P<WINNING_CURRENCY>[%(LS)s]|)?(?P<WINNING>[.\d]+)?" % substitutions, re.MULTILINE)
|
||||
re_TourneyHeroFinishingP = re.compile("(?P<HERO_NAME>.*) finished in (?P<HERO_FINISHING_POS>\d+)(st|nd|rd|th) place")
|
||||
|
||||
#TODO: See if we need to deal with play money tourney summaries -- Not right now (they shouldn't pass the re_TourneyInfo)
|
||||
|
@ -127,17 +133,19 @@ class Fulltilt(HandHistoryConverter):
|
|||
# we need to recompile the player regexs.
|
||||
self.compiledPlayers = players
|
||||
player_re = "(?P<PNAME>" + "|".join(map(re.escape, players)) + ")"
|
||||
self.substitutions['PLAYERS'] = player_re
|
||||
|
||||
logging.debug("player_re: " + player_re)
|
||||
self.re_PostSB = re.compile(r"^%s posts the small blind of \$?(?P<SB>[.0-9]+)" % player_re, re.MULTILINE)
|
||||
self.re_PostDead = re.compile(r"^%s posts a dead small blind of \$?(?P<SB>[.0-9]+)" % player_re, re.MULTILINE)
|
||||
self.re_PostBB = re.compile(r"^%s posts (the big blind of )?\$?(?P<BB>[.0-9]+)" % player_re, re.MULTILINE)
|
||||
self.re_Antes = re.compile(r"^%s antes \$?(?P<ANTE>[.0-9]+)" % player_re, re.MULTILINE)
|
||||
self.re_BringIn = re.compile(r"^%s brings in for \$?(?P<BRINGIN>[.0-9]+)" % player_re, re.MULTILINE)
|
||||
self.re_PostBoth = re.compile(r"^%s posts small \& big blinds \[\$? (?P<SBBB>[.0-9]+)" % player_re, re.MULTILINE)
|
||||
self.re_PostSB = re.compile(r"^%(PLAYERS)s posts the small blind of [%(LS)s]?(?P<SB>[.0-9]+)" % self.substitutions, re.MULTILINE)
|
||||
self.re_PostDead = re.compile(r"^%(PLAYERS)s posts a dead small blind of [%(LS)s]?(?P<SB>[.0-9]+)" % self.substitutions, re.MULTILINE)
|
||||
self.re_PostBB = re.compile(r"^%(PLAYERS)s posts (the big blind of )?[%(LS)s]?(?P<BB>[.0-9]+)" % self.substitutions, re.MULTILINE)
|
||||
self.re_Antes = re.compile(r"^%(PLAYERS)s antes [%(LS)s]?(?P<ANTE>[.0-9]+)" % self.substitutions, re.MULTILINE)
|
||||
self.re_BringIn = re.compile(r"^%(PLAYERS)s brings in for [%(LS)s]?(?P<BRINGIN>[.0-9]+)" % self.substitutions, re.MULTILINE)
|
||||
self.re_PostBoth = re.compile(r"^%(PLAYERS)s posts small \& big blinds \[[%(LS)s]? (?P<SBBB>[.0-9]+)" % self.substitutions, re.MULTILINE)
|
||||
self.re_HeroCards = re.compile(r"^Dealt to %s(?: \[(?P<OLDCARDS>.+?)\])?( \[(?P<NEWCARDS>.+?)\])" % player_re, re.MULTILINE)
|
||||
self.re_Action = re.compile(r"^%s(?P<ATYPE> bets| checks| raises to| completes it to| calls| folds)( \$?(?P<BET>[.,\d]+))?" % player_re, re.MULTILINE)
|
||||
self.re_Action = re.compile(r"^%(PLAYERS)s(?P<ATYPE> bets| checks| raises to| completes it to| calls| folds)( [%(LS)s]?(?P<BET>[.,\d]+))?" % self.substitutions, re.MULTILINE)
|
||||
self.re_ShowdownAction = re.compile(r"^%s shows \[(?P<CARDS>.*)\]" % player_re, re.MULTILINE)
|
||||
self.re_CollectPot = re.compile(r"^Seat (?P<SEAT>[0-9]+): %s (\(button\) |\(small blind\) |\(big blind\) )?(collected|showed \[.*\] and won) \(\$?(?P<POT>[.,\d]+)\)(, mucked| with.*)" % player_re, re.MULTILINE)
|
||||
self.re_CollectPot = re.compile(r"^Seat (?P<SEAT>[0-9]+): %(PLAYERS)s (\(button\) |\(small blind\) |\(big blind\) )?(collected|showed \[.*\] and won) \([%(LS)s]?(?P<POT>[.,\d]+)\)(, mucked| with.*)" % self.substitutions, re.MULTILINE)
|
||||
self.re_SitsOut = re.compile(r"^%s sits out" % player_re, re.MULTILINE)
|
||||
self.re_ShownCards = re.compile(r"^Seat (?P<SEAT>[0-9]+): %s (\(button\) |\(small blind\) |\(big blind\) )?(?P<ACT>showed|mucked) \[(?P<CARDS>.*)\].*" % player_re, re.MULTILINE)
|
||||
|
||||
|
@ -161,12 +169,14 @@ class Fulltilt(HandHistoryConverter):
|
|||
# Full Tilt Poker Game #10773265574: Table Butte (6 max) - $0.01/$0.02 - Pot Limit Hold'em - 21:33:46 ET - 2009/02/21
|
||||
# Full Tilt Poker Game #9403951181: Table CR - tay - $0.05/$0.10 - No Limit Hold'em - 9:40:20 ET - 2008/12/09
|
||||
# Full Tilt Poker Game #10809877615: Table Danville - $0.50/$1 Ante $0.10 - Limit Razz - 21:47:27 ET - 2009/02/23
|
||||
# Full Tilt Poker.fr Game #23057874034: Table Douai–Lens (6 max) - €0.01/€0.02 - No Limit Hold'em - 21:59:17 CET - 2010/08/13
|
||||
info = {'type':'ring'}
|
||||
|
||||
m = self.re_GameInfo.search(handText)
|
||||
if not m:
|
||||
return None
|
||||
mg = m.groupdict()
|
||||
|
||||
# translations from captured groups to our info strings
|
||||
limits = { 'No Limit':'nl', 'Pot Limit':'pl', 'Limit':'fl' }
|
||||
games = { # base, category
|
||||
|
@ -177,7 +187,7 @@ class Fulltilt(HandHistoryConverter):
|
|||
'Stud Hi' : ('stud','studhi'),
|
||||
'Stud H/L' : ('stud','studhilo')
|
||||
}
|
||||
currencies = { u' €':'EUR', '$':'USD', '':'T$' }
|
||||
currencies = { u'€':'EUR', '$':'USD', '':'T$' }
|
||||
if mg['CAP']:
|
||||
info['limitType'] = 'cn'
|
||||
else:
|
||||
|
@ -198,6 +208,7 @@ class Fulltilt(HandHistoryConverter):
|
|||
if m is None:
|
||||
logging.info("Didn't match re_HandInfo")
|
||||
logging.info(hand.handText)
|
||||
# Should this throw an exception? - CG
|
||||
return None
|
||||
hand.handid = m.group('HID')
|
||||
hand.tablename = m.group('TABLE')
|
||||
|
@ -704,5 +715,3 @@ if __name__ == "__main__":
|
|||
|
||||
e = Fulltilt(in_path = options.ipath, out_path = options.opath, follow = options.follow)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -31,6 +31,18 @@ from optparse import OptionParser
|
|||
import Configuration
|
||||
import string
|
||||
|
||||
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
|
||||
|
||||
class GuiAutoImport (threading.Thread):
|
||||
def __init__(self, settings, config, sql, parent):
|
||||
self.importtimer = 0
|
||||
|
@ -70,7 +82,7 @@ class GuiAutoImport (threading.Thread):
|
|||
vbox2 = gtk.VBox(True, 0)
|
||||
hbox.pack_start(vbox2, True, True, 0)
|
||||
|
||||
self.intervalLabel = gtk.Label("Time between imports in seconds:")
|
||||
self.intervalLabel = gtk.Label(_("Time between imports in seconds:"))
|
||||
self.intervalLabel.set_alignment(xalign=1.0, yalign=0.5)
|
||||
vbox1.pack_start(self.intervalLabel, False, True, 0)
|
||||
|
||||
|
@ -101,7 +113,7 @@ class GuiAutoImport (threading.Thread):
|
|||
hbox.pack_start(lbl1, expand=True, fill=False)
|
||||
|
||||
self.doAutoImportBool = False
|
||||
self.startButton = gtk.ToggleButton(" Start _Autoimport ")
|
||||
self.startButton = gtk.ToggleButton(_(" Start _Autoimport "))
|
||||
self.startButton.connect("clicked", self.startClicked, "start clicked")
|
||||
hbox.pack_start(self.startButton, expand=False, fill=False)
|
||||
|
||||
|
@ -120,7 +132,7 @@ class GuiAutoImport (threading.Thread):
|
|||
scrolledwindow.add(self.textview)
|
||||
|
||||
self.mainVBox.show_all()
|
||||
self.addText("AutoImport Ready.")
|
||||
self.addText(_("AutoImport Ready."))
|
||||
|
||||
def addText(self, text):
|
||||
end_iter = self.textbuffer.get_end_iter()
|
||||
|
@ -133,7 +145,7 @@ class GuiAutoImport (threading.Thread):
|
|||
"""runs when user clicks one of the browse buttons in the auto import tab"""
|
||||
current_path=data[1].get_text()
|
||||
|
||||
dia_chooser = gtk.FileChooserDialog(title="Please choose the path that you want to auto import",
|
||||
dia_chooser = gtk.FileChooserDialog(title=_("Please choose the path that you want to auto import"),
|
||||
action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER,
|
||||
buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK))
|
||||
#dia_chooser.set_current_folder(pathname)
|
||||
|
@ -156,7 +168,7 @@ class GuiAutoImport (threading.Thread):
|
|||
def do_import(self):
|
||||
"""Callback for timer to do an import iteration."""
|
||||
if self.doAutoImportBool:
|
||||
self.startButton.set_label(u' _Auto Import Running ')
|
||||
self.startButton.set_label(_(u' _Auto Import Running '))
|
||||
self.importer.runUpdated()
|
||||
self.addText(".")
|
||||
#sys.stdout.write(".")
|
||||
|
@ -167,9 +179,9 @@ class GuiAutoImport (threading.Thread):
|
|||
|
||||
def reset_startbutton(self):
|
||||
if self.pipe_to_hud is not None:
|
||||
self.startButton.set_label(u' Stop _Autoimport ')
|
||||
self.startButton.set_label(_(u' Stop _Autoimport '))
|
||||
else:
|
||||
self.startButton.set_label(u' Start _Autoimport ')
|
||||
self.startButton.set_label(_(u' Start _Autoimport '))
|
||||
|
||||
return False
|
||||
|
||||
|
@ -192,9 +204,9 @@ class GuiAutoImport (threading.Thread):
|
|||
# - Ideally we want to release the lock if the auto-import is killed by some
|
||||
# kind of exception - is this possible?
|
||||
if self.settings['global_lock'].acquire(False): # returns false immediately if lock not acquired
|
||||
self.addText("\nGlobal lock taken ... Auto Import Started.\n")
|
||||
self.addText(_("\nGlobal lock taken ... Auto Import Started.\n"))
|
||||
self.doAutoImportBool = True
|
||||
widget.set_label(u' _Stop Autoimport ')
|
||||
widget.set_label(_(u' _Stop Autoimport '))
|
||||
if self.pipe_to_hud is None:
|
||||
if Configuration.FROZEN:
|
||||
path = Configuration.EXEC_PATH
|
||||
|
@ -210,7 +222,7 @@ class GuiAutoImport (threading.Thread):
|
|||
bs = 1
|
||||
|
||||
try:
|
||||
print "opening pipe to HUD"
|
||||
print _("opening pipe to HUD")
|
||||
self.pipe_to_hud = subprocess.Popen(command, bufsize=bs,
|
||||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE, # only needed for py2exe
|
||||
|
@ -222,7 +234,7 @@ class GuiAutoImport (threading.Thread):
|
|||
except:
|
||||
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
||||
#self.addText( "\n*** GuiAutoImport Error opening pipe: " + err[2] + "(" + str(err[1]) + "): " + str(sys.exc_info()[1]))
|
||||
self.addText( "\n*** GuiAutoImport Error opening pipe: " + traceback.format_exc() )
|
||||
self.addText(_("\n*** GuiAutoImport Error opening pipe: ") + traceback.format_exc() )
|
||||
else:
|
||||
for site in self.input_settings:
|
||||
self.importer.addImportDirectory(self.input_settings[site][0], True, site, self.input_settings[site][1])
|
||||
|
@ -234,19 +246,19 @@ class GuiAutoImport (threading.Thread):
|
|||
self.importtimer = gobject.timeout_add(interval * 1000, self.do_import)
|
||||
|
||||
else:
|
||||
self.addText("\nauto-import aborted - global lock not available")
|
||||
self.addText(_("\nauto-import aborted - global lock not available"))
|
||||
else: # toggled off
|
||||
gobject.source_remove(self.importtimer)
|
||||
self.settings['global_lock'].release()
|
||||
self.doAutoImportBool = False # do_import will return this and stop the gobject callback timer
|
||||
self.addText("\nStopping autoimport - global lock released.")
|
||||
self.addText(_("\nStopping autoimport - global lock released."))
|
||||
if self.pipe_to_hud.poll() is not None:
|
||||
self.addText("\n * Stop Autoimport: HUD already terminated")
|
||||
self.addText(_("\n * Stop Autoimport: HUD already terminated"))
|
||||
else:
|
||||
#print >>self.pipe_to_hud.stdin, "\n"
|
||||
self.pipe_to_hud.communicate('\n') # waits for process to terminate
|
||||
self.pipe_to_hud = None
|
||||
self.startButton.set_label(u' Start _Autoimport ')
|
||||
self.startButton.set_label(_(u' Start _Autoimport '))
|
||||
|
||||
#end def GuiAutoImport.startClicked
|
||||
|
||||
|
@ -268,7 +280,7 @@ class GuiAutoImport (threading.Thread):
|
|||
hbox1.pack_start(dirPath, True, True, 3)
|
||||
dirPath.show()
|
||||
|
||||
browseButton=gtk.Button("Browse...")
|
||||
browseButton=gtk.Button(_("Browse..."))
|
||||
browseButton.connect("clicked", self.browseClicked, [site] + [dirPath])
|
||||
hbox2.pack_start(browseButton, False, False, 3)
|
||||
browseButton.show()
|
||||
|
@ -311,7 +323,7 @@ if __name__== "__main__":
|
|||
parser = OptionParser()
|
||||
parser.add_option("-q", "--quiet", action="store_false", dest="gui", default=True, help="don't start gui")
|
||||
parser.add_option("-m", "--minPrint", "--status", dest="minPrint", default="0", type="int",
|
||||
help="How often to print a one-line status report (0 (default) means never)")
|
||||
help=_("How often to print a one-line status report (0 (default) means never)"))
|
||||
(options, argv) = parser.parse_args()
|
||||
|
||||
config = Configuration.Config()
|
||||
|
|
|
@ -33,6 +33,18 @@ import fpdb_import
|
|||
import Configuration
|
||||
import Exceptions
|
||||
|
||||
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
|
||||
|
||||
class GuiBulkImport():
|
||||
|
||||
# CONFIGURATION - update these as preferred:
|
||||
|
@ -52,8 +64,8 @@ class GuiBulkImport():
|
|||
# (see comment above about what to do if pipe already open)
|
||||
if self.settings['global_lock'].acquire(wait=False, source="GuiBulkImport"): # returns false immediately if lock not acquired
|
||||
#try:
|
||||
print "\nGlobal lock taken ..."
|
||||
self.progressbar.set_text("Importing...")
|
||||
print _("\nGlobal lock taken ...")
|
||||
self.progressbar.set_text(_("Importing..."))
|
||||
self.progressbar.pulse()
|
||||
while gtk.events_pending(): # see http://faq.pygtk.org/index.py?req=index for more hints (3.7)
|
||||
gtk.main_iteration(False)
|
||||
|
@ -102,7 +114,7 @@ class GuiBulkImport():
|
|||
ttime = time() - starttime
|
||||
if ttime == 0:
|
||||
ttime = 1
|
||||
print 'GuiBulkImport.load done: Stored: %d \tDuplicates: %d \tPartial: %d \tErrors: %d in %s seconds - %.0f/sec'\
|
||||
print _('GuiBulkImport.load done: Stored: %d \tDuplicates: %d \tPartial: %d \tErrors: %d in %s seconds - %.0f/sec')\
|
||||
% (stored, dups, partial, errs, ttime, (stored+0.0) / ttime)
|
||||
self.importer.clearFileList()
|
||||
# This file should really be 'logging'
|
||||
|
@ -116,7 +128,7 @@ class GuiBulkImport():
|
|||
self.cb_drophudcache.set_active(0)
|
||||
self.lab_hdrop.set_sensitive(True)
|
||||
|
||||
self.progressbar.set_text("Import Complete")
|
||||
self.progressbar.set_text(_("Import Complete"))
|
||||
self.progressbar.set_fraction(0)
|
||||
#except:
|
||||
#err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
||||
|
@ -124,7 +136,7 @@ class GuiBulkImport():
|
|||
#self.settings['global_lock'].release()
|
||||
self.settings['global_lock'].release()
|
||||
else:
|
||||
print "bulk-import aborted - global lock not available"
|
||||
print _("bulk-import aborted - global lock not available")
|
||||
|
||||
def get_vbox(self):
|
||||
"""returns the vbox of this thread"""
|
||||
|
@ -150,14 +162,14 @@ class GuiBulkImport():
|
|||
self.table.show()
|
||||
|
||||
# checkbox - print start/stop?
|
||||
self.chk_st_st = gtk.CheckButton('Print Start/Stop Info')
|
||||
self.chk_st_st = gtk.CheckButton(_('Print Start/Stop Info'))
|
||||
self.table.attach(self.chk_st_st, 0, 1, 0, 1, xpadding=10, ypadding=0,
|
||||
yoptions=gtk.SHRINK)
|
||||
self.chk_st_st.show()
|
||||
self.chk_st_st.set_active(True)
|
||||
|
||||
# label - status
|
||||
self.lab_status = gtk.Label("Hands/status print:")
|
||||
self.lab_status = gtk.Label(_("Hands/status print:"))
|
||||
self.table.attach(self.lab_status, 1, 2, 0, 1, xpadding=0, ypadding=0,
|
||||
yoptions=gtk.SHRINK)
|
||||
self.lab_status.show()
|
||||
|
@ -174,7 +186,7 @@ class GuiBulkImport():
|
|||
self.spin_status.show()
|
||||
|
||||
# label - threads
|
||||
self.lab_threads = gtk.Label("Number of threads:")
|
||||
self.lab_threads = gtk.Label(_("Number of threads:"))
|
||||
self.table.attach(self.lab_threads, 3, 4, 0, 1, xpadding=0, ypadding=0,
|
||||
yoptions=gtk.SHRINK)
|
||||
self.lab_threads.show()
|
||||
|
@ -194,12 +206,12 @@ class GuiBulkImport():
|
|||
self.spin_threads.set_sensitive(False)
|
||||
|
||||
# checkbox - fail on error?
|
||||
self.chk_fail = gtk.CheckButton('Fail on error')
|
||||
self.chk_fail = gtk.CheckButton(_('Fail on error'))
|
||||
self.table.attach(self.chk_fail, 0, 1, 1, 2, xpadding=10, ypadding=0, yoptions=gtk.SHRINK)
|
||||
self.chk_fail.show()
|
||||
|
||||
# label - hands
|
||||
self.lab_hands = gtk.Label("Hands/file:")
|
||||
self.lab_hands = gtk.Label(_("Hands/file:"))
|
||||
self.table.attach(self.lab_hands, 1, 2, 1, 2, xpadding=0, ypadding=0, yoptions=gtk.SHRINK)
|
||||
self.lab_hands.show()
|
||||
self.lab_hands.set_justify(gtk.JUSTIFY_RIGHT)
|
||||
|
@ -214,7 +226,7 @@ class GuiBulkImport():
|
|||
self.spin_hands.show()
|
||||
|
||||
# label - drop indexes
|
||||
self.lab_drop = gtk.Label("Drop indexes:")
|
||||
self.lab_drop = gtk.Label(_("Drop indexes:"))
|
||||
self.table.attach(self.lab_drop, 3, 4, 1, 2, xpadding=0, ypadding=0,
|
||||
yoptions=gtk.SHRINK)
|
||||
self.lab_drop.show()
|
||||
|
@ -223,20 +235,20 @@ class GuiBulkImport():
|
|||
|
||||
# ComboBox - drop indexes
|
||||
self.cb_dropindexes = gtk.combo_box_new_text()
|
||||
self.cb_dropindexes.append_text('auto')
|
||||
self.cb_dropindexes.append_text("don't drop")
|
||||
self.cb_dropindexes.append_text('drop')
|
||||
self.cb_dropindexes.append_text(_('auto'))
|
||||
self.cb_dropindexes.append_text(_("don't drop"))
|
||||
self.cb_dropindexes.append_text(_('drop'))
|
||||
self.cb_dropindexes.set_active(0)
|
||||
self.table.attach(self.cb_dropindexes, 4, 5, 1, 2, xpadding=10,
|
||||
ypadding=0, yoptions=gtk.SHRINK)
|
||||
self.cb_dropindexes.show()
|
||||
|
||||
self.cb_testmode = gtk.CheckButton('HUD Test mode')
|
||||
self.cb_testmode = gtk.CheckButton(_('HUD Test mode'))
|
||||
self.table.attach(self.cb_testmode, 0, 1, 2, 3, xpadding=10, ypadding=0, yoptions=gtk.SHRINK)
|
||||
self.cb_testmode.show()
|
||||
|
||||
# label - filter
|
||||
self.lab_filter = gtk.Label("Site filter:")
|
||||
self.lab_filter = gtk.Label(_("Site filter:"))
|
||||
self.table.attach(self.lab_filter, 1, 2, 2, 3, xpadding=0, ypadding=0,
|
||||
yoptions=gtk.SHRINK)
|
||||
self.lab_filter.show()
|
||||
|
@ -264,7 +276,7 @@ class GuiBulkImport():
|
|||
self.cbfilter.show()
|
||||
|
||||
# label - drop hudcache
|
||||
self.lab_hdrop = gtk.Label("Drop HudCache:")
|
||||
self.lab_hdrop = gtk.Label(_("Drop HudCache:"))
|
||||
self.table.attach(self.lab_hdrop, 3, 4, 2, 3, xpadding=0, ypadding=0,
|
||||
yoptions=gtk.SHRINK)
|
||||
self.lab_hdrop.show()
|
||||
|
@ -273,18 +285,18 @@ class GuiBulkImport():
|
|||
|
||||
# ComboBox - drop hudcache
|
||||
self.cb_drophudcache = gtk.combo_box_new_text()
|
||||
self.cb_drophudcache.append_text('auto')
|
||||
self.cb_drophudcache.append_text("don't drop")
|
||||
self.cb_drophudcache.append_text('drop')
|
||||
self.cb_drophudcache.append_text(_('auto'))
|
||||
self.cb_drophudcache.append_text(_("don't drop"))
|
||||
self.cb_drophudcache.append_text(_('drop'))
|
||||
self.cb_drophudcache.set_active(0)
|
||||
self.table.attach(self.cb_drophudcache, 4, 5, 2, 3, xpadding=10,
|
||||
ypadding=0, yoptions=gtk.SHRINK)
|
||||
self.cb_drophudcache.show()
|
||||
|
||||
# button - Import
|
||||
self.load_button = gtk.Button('Import') # todo: rename variables to import too
|
||||
self.load_button = gtk.Button(_('Import')) # todo: rename variables to import too
|
||||
self.load_button.connect('clicked', self.load_clicked,
|
||||
'Import clicked')
|
||||
_('Import clicked'))
|
||||
self.table.attach(self.load_button, 2, 3, 4, 5, xpadding=0, ypadding=0,
|
||||
yoptions=gtk.SHRINK)
|
||||
self.load_button.show()
|
||||
|
@ -302,7 +314,7 @@ class GuiBulkImport():
|
|||
self.progressbar = gtk.ProgressBar()
|
||||
self.table.attach(self.progressbar, 3, 5, 4, 5, xpadding=0, ypadding=0,
|
||||
yoptions=gtk.SHRINK)
|
||||
self.progressbar.set_text("Waiting...")
|
||||
self.progressbar.set_text(_("Waiting..."))
|
||||
self.progressbar.set_fraction(0)
|
||||
self.progressbar.show()
|
||||
|
||||
|
@ -331,29 +343,31 @@ def main(argv=None):
|
|||
|
||||
parser = OptionParser()
|
||||
parser.add_option("-f", "--file", dest="filename", metavar="FILE", default=None,
|
||||
help="Input file in quiet mode")
|
||||
help=_("Input file in quiet mode"))
|
||||
parser.add_option("-q", "--quiet", action="store_false", dest="gui", default=True,
|
||||
help="don't start gui; deprecated (just give a filename with -f).")
|
||||
help=_("don't start gui; deprecated (just give a filename with -f)."))
|
||||
parser.add_option("-c", "--convert", dest="filtername", default="PokerStars", metavar="FILTER",
|
||||
help="Conversion filter (*Full Tilt Poker, PokerStars, Everleaf, Absolute)")
|
||||
help=_("Conversion filter (*Full Tilt Poker, PokerStars, Everleaf, Absolute)"))
|
||||
parser.add_option("-x", "--failOnError", action="store_true", default=False,
|
||||
help="If this option is passed it quits when it encounters any error")
|
||||
help=_("If this option is passed it quits when it encounters any error"))
|
||||
parser.add_option("-m", "--minPrint", "--status", dest="minPrint", default="0", type="int",
|
||||
help="How often to print a one-line status report (0 (default) means never)")
|
||||
help=_("How often to print a one-line status report (0 (default) means never)"))
|
||||
parser.add_option("-u", "--usage", action="store_true", dest="usage", default=False,
|
||||
help="Print some useful one liners")
|
||||
help=_("Print some useful one liners"))
|
||||
parser.add_option("-s", "--starsarchive", action="store_true", dest="starsArchive", default=False,
|
||||
help="Do the required conversion for Stars Archive format (ie. as provided by support")
|
||||
help=_("Do the required conversion for Stars Archive format (ie. as provided by support"))
|
||||
parser.add_option("-t", "--testdata", action="store_true", dest="testData", default=False,
|
||||
help=_("Output the pprinted version of the HandsPlayer hash for regresion testing"))
|
||||
(options, argv) = parser.parse_args(args = argv)
|
||||
|
||||
if options.usage == True:
|
||||
#Print usage examples and exit
|
||||
print "USAGE:"
|
||||
print 'PokerStars converter: ./GuiBulkImport -c PokerStars -f filename'
|
||||
print 'Full Tilt converter: ./GuiBulkImport -c "Full Tilt Poker" -f filename'
|
||||
print "Everleaf converter: ./GuiBulkImport -c Everleaf -f filename"
|
||||
print "Absolute converter: ./GuiBulkImport -c Absolute -f filename"
|
||||
print "PartyPoker converter: ./GuiBulkImport -c PartyPoker -f filename"
|
||||
print _("USAGE:")
|
||||
print _('PokerStars converter: ./GuiBulkImport.py -c PokerStars -f filename')
|
||||
print _('Full Tilt converter: ./GuiBulkImport.py -c "Full Tilt Poker" -f filename')
|
||||
print _("Everleaf converter: ./GuiBulkImport.py -c Everleaf -f filename")
|
||||
print _("Absolute converter: ./GuiBulkImport.py -c Absolute -f filename")
|
||||
print _("PartyPoker converter: ./GuiBulkImport.py -c PartyPoker -f filename")
|
||||
sys.exit(0)
|
||||
|
||||
config = Configuration.Config()
|
||||
|
@ -369,7 +383,7 @@ def main(argv=None):
|
|||
settings.update(config.get_default_paths())
|
||||
|
||||
if not options.gui:
|
||||
print '-q is deprecated. Just use "-f filename" instead'
|
||||
print _('-q is deprecated. Just use "-f filename" instead')
|
||||
# This is because -q on its own causes an error, so -f is necessary and sufficient for cmd line use
|
||||
if not options.filename:
|
||||
i = GuiBulkImport(settings, config)
|
||||
|
@ -382,16 +396,18 @@ def main(argv=None):
|
|||
#Do something useful
|
||||
importer = fpdb_import.Importer(False,settings, config)
|
||||
# importer.setDropIndexes("auto")
|
||||
importer.setDropIndexes("don't drop")
|
||||
importer.setDropIndexes(_("don't drop"))
|
||||
importer.setFailOnError(options.failOnError)
|
||||
importer.setThreads(-1)
|
||||
importer.addBulkImportImportFileOrDir(os.path.expanduser(options.filename), site=options.filtername)
|
||||
importer.setCallHud(False)
|
||||
if options.starsArchive:
|
||||
importer.setStarsArchive(True)
|
||||
if options.testData:
|
||||
importer.setPrintTestData(True)
|
||||
(stored, dups, partial, errs, ttime) = importer.runImport()
|
||||
importer.clearFileList()
|
||||
print 'GuiBulkImport done: Stored: %d \tDuplicates: %d \tPartial: %d \tErrors: %d in %s seconds - %.0f/sec'\
|
||||
print _('GuiBulkImport done: Stored: %d \tDuplicates: %d \tPartial: %d \tErrors: %d in %s seconds - %.0f/sec')\
|
||||
% (stored, dups, partial, errs, ttime, (stored+0.0) / ttime)
|
||||
|
||||
|
||||
|
|
|
@ -35,6 +35,17 @@ import Exceptions
|
|||
import Database
|
||||
import SQL
|
||||
|
||||
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
|
||||
|
||||
class GuiDatabase:
|
||||
|
||||
|
@ -92,19 +103,19 @@ class GuiDatabase:
|
|||
self.scrolledwindow.add(self.listview)
|
||||
self.vbox.pack_start(self.scrolledwindow, expand=True, fill=True, padding=0)
|
||||
|
||||
refreshbutton = gtk.Button("Refresh")
|
||||
refreshbutton = gtk.Button(_("Refresh"))
|
||||
refreshbutton.connect("clicked", self.refresh, None)
|
||||
self.vbox.pack_start(refreshbutton, False, False, 3)
|
||||
refreshbutton.show()
|
||||
|
||||
col = self.addTextColumn("Type", 0, False)
|
||||
col = self.addTextColumn("Name", 1, False)
|
||||
col = self.addTextColumn("Description", 2, True)
|
||||
col = self.addTextColumn("Username", 3, True)
|
||||
col = self.addTextColumn("Password", 4, True)
|
||||
col = self.addTextColumn("Host", 5, True)
|
||||
col = self.addTextObjColumn("Default", 6, 6)
|
||||
col = self.addTextObjColumn("Status", 7, 8)
|
||||
col = self.addTextColumn(_("Type"), 0, False)
|
||||
col = self.addTextColumn(_("Name"), 1, False)
|
||||
col = self.addTextColumn(_("Description"), 2, True)
|
||||
col = self.addTextColumn(_("Username"), 3, True)
|
||||
col = self.addTextColumn(_("Password"), 4, True)
|
||||
col = self.addTextColumn(_("Host"), 5, True)
|
||||
col = self.addTextObjColumn(_("Default"), 6, 6)
|
||||
col = self.addTextObjColumn(_("Status"), 7, 8)
|
||||
|
||||
#self.listview.get_selection().set_mode(gtk.SELECTION_SINGLE)
|
||||
#self.listview.get_selection().connect("changed", self.on_selection_changed)
|
||||
|
@ -237,7 +248,7 @@ class GuiDatabase:
|
|||
|
||||
self.liststore.clear()
|
||||
#self.listcols = []
|
||||
dia = self.info_box2(None, 'Testing database connections ... ', "", False, False)
|
||||
dia = self.info_box2(None, _('Testing database connections ... '), "", False, False)
|
||||
while gtk.events_pending():
|
||||
gtk.mainiteration()
|
||||
|
||||
|
@ -267,49 +278,47 @@ class GuiDatabase:
|
|||
try:
|
||||
# is creating empty db for sqlite ... mod db.py further?
|
||||
# add noDbTables flag to db.py?
|
||||
log.debug("loaddbs: trying to connect to: %s/%s, %s, %s/%s" % (str(dbms_num),dbms,name,user,passwd))
|
||||
log.debug(_("loaddbs: trying to connect to: %s/%s, %s, %s/%s") % (str(dbms_num),dbms,name,user,passwd))
|
||||
db.connect(backend=dbms_num, host=host, database=name, user=user, password=passwd, create=False)
|
||||
if db.connected:
|
||||
log.debug(" connected ok")
|
||||
log.debug(_(" connected ok"))
|
||||
status = 'ok'
|
||||
icon = gtk.STOCK_APPLY
|
||||
if db.wrongDbVersion:
|
||||
status = 'old'
|
||||
icon = gtk.STOCK_INFO
|
||||
else:
|
||||
log.debug(" not connected but no exception")
|
||||
log.debug(_(" not connected but no exception"))
|
||||
except Exceptions.FpdbMySQLAccessDenied:
|
||||
err_msg = "MySQL Server reports: Access denied. Are your permissions set correctly?"
|
||||
err_msg = _("MySQL Server reports: Access denied. Are your permissions set correctly?")
|
||||
status = "failed"
|
||||
icon = gtk.STOCK_CANCEL
|
||||
except Exceptions.FpdbMySQLNoDatabase:
|
||||
err_msg = "MySQL client reports: 2002 or 2003 error. Unable to connect - " \
|
||||
+ "Please check that the MySQL service has been started"
|
||||
err_msg = _("MySQL client reports: 2002 or 2003 error. Unable to connect - Please check that the MySQL service has been started")
|
||||
status = "failed"
|
||||
icon = gtk.STOCK_CANCEL
|
||||
except Exceptions.FpdbPostgresqlAccessDenied:
|
||||
err_msg = "Postgres Server reports: Access denied. Are your permissions set correctly?"
|
||||
err_msg = _("Postgres Server reports: Access denied. Are your permissions set correctly?")
|
||||
status = "failed"
|
||||
except Exceptions.FpdbPostgresqlNoDatabase:
|
||||
err_msg = "Postgres client reports: Unable to connect - " \
|
||||
+ "Please check that the Postgres service has been started"
|
||||
err_msg = _("Postgres client reports: Unable to connect - Please check that the Postgres service has been started")
|
||||
status = "failed"
|
||||
icon = gtk.STOCK_CANCEL
|
||||
except:
|
||||
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
||||
log.info( 'db connection to '+str(dbms_num)+','+host+','+name+','+user+','+passwd+' failed: '
|
||||
+ err[2] + "(" + str(err[1]) + "): " + str(sys.exc_info()[1]) )
|
||||
+ err[2] + "(" + str(err[1]) + "): " + str(sys.exc_info()[1]) )#TODO Gettextify
|
||||
status = "failed"
|
||||
icon = gtk.STOCK_CANCEL
|
||||
if err_msg:
|
||||
log.info( 'db connection to '+str(dbms_num)+','+host+','+name+','+user+','+passwd+' failed: '
|
||||
+ err_msg )
|
||||
+ err_msg )#TODO Gettextify
|
||||
|
||||
b = gtk.Button(name)
|
||||
b.show()
|
||||
iter = self.liststore.append( (dbms, name, comment, user, passwd, host, "", default_icon, status, icon) )
|
||||
|
||||
self.info_box2(dia[0], "finished.", "", False, True)
|
||||
self.info_box2(dia[0], _("finished."), "", False, True)
|
||||
self.listview.show()
|
||||
self.scrolledwindow.show()
|
||||
self.vbox.show()
|
||||
|
@ -319,7 +328,7 @@ class GuiDatabase:
|
|||
self.dia.show()
|
||||
except:
|
||||
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
||||
print 'loaddbs error: '+str(dbms_num)+','+host+','+name+','+user+','+passwd+' failed: ' \
|
||||
print _('loaddbs error: ')+str(dbms_num)+','+host+','+name+','+user+','+passwd+' failed: ' \
|
||||
+ err[2] + "(" + str(err[1]) + "): " + str(sys.exc_info()[1])
|
||||
|
||||
def sortCols(self, col, n):
|
||||
|
@ -340,9 +349,9 @@ class GuiDatabase:
|
|||
# to turn indicator off for other cols
|
||||
except:
|
||||
err = traceback.extract_tb(sys.exc_info()[2])
|
||||
print "***sortCols error: " + str(sys.exc_info()[1])
|
||||
print _("***sortCols error: ") + str(sys.exc_info()[1])
|
||||
print "\n".join( [e[0]+':'+str(e[1])+" "+e[2] for e in err] )
|
||||
log.info('sortCols error: ' + str(sys.exc_info()) )
|
||||
log.info(_('sortCols error: ') + str(sys.exc_info()) )
|
||||
|
||||
def refresh(self, widget, data):
|
||||
self.loadDbs()
|
||||
|
@ -363,7 +372,7 @@ class GuiDatabase:
|
|||
for d in c.get_children():
|
||||
log.info('child: '+str(d)+' is a '+str(d.__class__))
|
||||
if isinstance(d, gtk.Button):
|
||||
log.info('removing button '+str(d))
|
||||
log.info(_('removing button %s'% str(d)))
|
||||
c.remove(d)
|
||||
if str2:
|
||||
dia.format_secondary_text(str2)
|
||||
|
@ -412,12 +421,12 @@ if __name__=="__main__":
|
|||
config = Configuration.Config()
|
||||
|
||||
win = gtk.Window(gtk.WINDOW_TOPLEVEL)
|
||||
win.set_title("Test Log Viewer")
|
||||
win.set_title(_("Test Log Viewer"))
|
||||
win.set_border_width(1)
|
||||
win.set_default_size(600, 500)
|
||||
win.set_resizable(True)
|
||||
|
||||
dia = gtk.Dialog("Log Viewer",
|
||||
dia = gtk.Dialog(_("Log Viewer"),
|
||||
win,
|
||||
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||
(gtk.STOCK_CLOSE, gtk.RESPONSE_OK))
|
||||
|
|
|
@ -36,12 +36,24 @@ try:
|
|||
from numpy import arange, cumsum
|
||||
from pylab import *
|
||||
except ImportError, inst:
|
||||
print """Failed to load libs for graphing, graphing will not function. Please in
|
||||
stall numpy and matplotlib if you want to use graphs."""
|
||||
print """This is of no consequence for other parts of the program, e.g. import
|
||||
and HUD are NOT affected by this problem."""
|
||||
print _("""Failed to load libs for graphing, graphing will not function. Please
|
||||
install numpy and matplotlib if you want to use graphs.""")
|
||||
print _("""This is of no consequence for other parts of the program, e.g. import
|
||||
and HUD are NOT affected by this problem.""")
|
||||
print "ImportError: %s" % inst.args
|
||||
|
||||
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 fpdb_import
|
||||
import Database
|
||||
import Filters
|
||||
|
@ -126,7 +138,7 @@ class GuiGraphViewer (threading.Thread):
|
|||
self.canvas = FigureCanvas(self.fig) # a gtk.DrawingArea
|
||||
except:
|
||||
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
||||
print "***Error: "+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
||||
print _("***Error: ")+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
||||
raise
|
||||
|
||||
def generateGraph(self, widget, data):
|
||||
|
@ -156,17 +168,17 @@ class GuiGraphViewer (threading.Thread):
|
|||
|
||||
if not sitenos:
|
||||
#Should probably pop up here.
|
||||
print "No sites selected - defaulting to PokerStars"
|
||||
print _("No sites selected - defaulting to PokerStars")
|
||||
self.db.rollback()
|
||||
return
|
||||
|
||||
if not playerids:
|
||||
print "No player ids found"
|
||||
print _("No player ids found")
|
||||
self.db.rollback()
|
||||
return
|
||||
|
||||
if not limits:
|
||||
print "No limits found"
|
||||
print _("No limits found")
|
||||
self.db.rollback()
|
||||
return
|
||||
|
||||
|
@ -176,15 +188,15 @@ class GuiGraphViewer (threading.Thread):
|
|||
#Get graph data from DB
|
||||
starttime = time()
|
||||
(green, blue, red) = self.getRingProfitGraph(playerids, sitenos, limits, games)
|
||||
print "Graph generated in: %s" %(time() - starttime)
|
||||
print _("Graph generated in: %s") %(time() - starttime)
|
||||
|
||||
|
||||
#Set axis labels and grid overlay properites
|
||||
self.ax.set_xlabel("Hands", fontsize = 12)
|
||||
self.ax.set_xlabel(_("Hands"), fontsize = 12)
|
||||
self.ax.set_ylabel("$", fontsize = 12)
|
||||
self.ax.grid(color='g', linestyle=':', linewidth=0.2)
|
||||
if green == None or green == []:
|
||||
self.ax.set_title("No Data for Player(s) Found")
|
||||
self.ax.set_title(_("No Data for Player(s) Found"))
|
||||
green = ([ 0., 0., 0., 0., 500., 1000., 900., 800.,
|
||||
700., 600., 500., 400., 300., 200., 100., 0.,
|
||||
500., 1000., 1000., 1000., 1000., 1000., 1000., 1000.,
|
||||
|
@ -207,9 +219,9 @@ class GuiGraphViewer (threading.Thread):
|
|||
0., 500., 1000., 900., 800., 700., 600., 500.,
|
||||
400., 300., 200., 100., 0., 500., 1000., 1000.])
|
||||
|
||||
self.ax.plot(green, color='green', label='Hands: %d\nProfit: $%.2f' %(len(green), green[-1]))
|
||||
self.ax.plot(blue, color='blue', label='Showdown: $%.2f' %(blue[-1]))
|
||||
self.ax.plot(red, color='red', label='Non-showdown: $%.2f' %(red[-1]))
|
||||
self.ax.plot(green, color='green', label=_('Hands: %d\nProfit: $%.2f') %(len(green), green[-1]))
|
||||
self.ax.plot(blue, color='blue', label=_('Showdown: $%.2f') %(blue[-1]))
|
||||
self.ax.plot(red, color='red', label=_('Non-showdown: $%.2f') %(red[-1]))
|
||||
self.graphBox.add(self.canvas)
|
||||
self.canvas.show()
|
||||
self.canvas.draw()
|
||||
|
@ -217,7 +229,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")
|
||||
self.ax.set_title(_("Profit graph for ring games"))
|
||||
#text = "Profit: $%.2f\nTotal Hands: %d" %(green[-1], len(green))
|
||||
#self.ax.annotate(text,
|
||||
# xy=(10, -10),
|
||||
|
@ -226,9 +238,9 @@ class GuiGraphViewer (threading.Thread):
|
|||
# fontsize=10)
|
||||
|
||||
#Draw plot
|
||||
self.ax.plot(green, color='green', label='Hands: %d\nProfit: $%.2f' %(len(green), green[-1]))
|
||||
self.ax.plot(blue, color='blue', label='Showdown: $%.2f' %(blue[-1]))
|
||||
self.ax.plot(red, color='red', label='Non-showdown: $%.2f' %(red[-1]))
|
||||
self.ax.plot(green, color='green', label=_('Hands: %d\nProfit: $%.2f') %(len(green), green[-1]))
|
||||
self.ax.plot(blue, color='blue', label=_('Showdown: $%.2f') %(blue[-1]))
|
||||
self.ax.plot(red, color='red', label=_('Non-showdown: $%.2f') %(red[-1]))
|
||||
if sys.version[0:3] == '2.5':
|
||||
self.ax.legend(loc='upper left', shadow=True, prop=FontProperties(size='smaller'))
|
||||
else:
|
||||
|
@ -240,7 +252,7 @@ class GuiGraphViewer (threading.Thread):
|
|||
#self.exportButton.set_sensitive(True)
|
||||
except:
|
||||
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
||||
print "***Error: "+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
||||
print _("***Error: ")+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
||||
|
||||
#end of def showClicked
|
||||
|
||||
|
@ -337,7 +349,7 @@ class GuiGraphViewer (threading.Thread):
|
|||
if self.fig is None:
|
||||
return # Might want to disable export button until something has been generated.
|
||||
|
||||
dia_chooser = gtk.FileChooserDialog(title="Please choose the directory you wish to export to:",
|
||||
dia_chooser = gtk.FileChooserDialog(title=_("Please choose the directory you wish to export to:"),
|
||||
action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER,
|
||||
buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OK,gtk.RESPONSE_OK))
|
||||
dia_chooser.set_destroy_with_parent(True)
|
||||
|
@ -350,7 +362,7 @@ class GuiGraphViewer (threading.Thread):
|
|||
response = dia_chooser.run()
|
||||
|
||||
if response <> gtk.RESPONSE_OK:
|
||||
print 'Closed, no graph exported'
|
||||
print _('Closed, no graph exported')
|
||||
dia_chooser.destroy()
|
||||
return
|
||||
|
||||
|
@ -368,7 +380,7 @@ class GuiGraphViewer (threading.Thread):
|
|||
flags=gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||
type=gtk.MESSAGE_INFO,
|
||||
buttons=gtk.BUTTONS_OK,
|
||||
message_format="Graph created")
|
||||
message_format=_("Graph created"))
|
||||
diainfo.format_secondary_text(self.exportFile)
|
||||
diainfo.run()
|
||||
diainfo.destroy()
|
||||
|
|
166
pyfpdb/GuiImapFetcher.py
Normal file
166
pyfpdb/GuiImapFetcher.py
Normal file
|
@ -0,0 +1,166 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2010 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.
|
||||
#
|
||||
#This program is distributed in the hope that it will be useful,
|
||||
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
#GNU General Public License for more details.
|
||||
#
|
||||
#You should have received a copy of the GNU Affero General Public License
|
||||
#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.
|
||||
|
||||
import threading
|
||||
import pygtk
|
||||
pygtk.require('2.0')
|
||||
import gtk
|
||||
from imaplib import IMAP4
|
||||
from socket import gaierror
|
||||
|
||||
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 ImapFetcher
|
||||
|
||||
class GuiImapFetcher (threading.Thread):
|
||||
def __init__(self, config, db, sql, mainwin, debug=True):
|
||||
self.config = config
|
||||
self.db = db
|
||||
self.mainVBox = gtk.VBox()
|
||||
|
||||
|
||||
self.buttonsHBox = gtk.HBox()
|
||||
self.mainVBox.pack_end(self.buttonsHBox, expand=False)
|
||||
|
||||
label=gtk.Label(_("To cancel just close this tab."))
|
||||
self.buttonsHBox.add(label)
|
||||
|
||||
self.saveButton = gtk.Button(_("_Save"))
|
||||
self.saveButton.connect('clicked', self.saveClicked)
|
||||
self.buttonsHBox.add(self.saveButton)
|
||||
|
||||
self.importAllButton = gtk.Button(_("_Import All"))
|
||||
self.importAllButton.connect('clicked', self.importAllClicked)
|
||||
self.buttonsHBox.add(self.importAllButton)
|
||||
|
||||
self.statusLabel=gtk.Label(_("If you change the config you must save before importing"))
|
||||
self.mainVBox.pack_end(self.statusLabel, expand=False, padding=4)
|
||||
|
||||
self.passwords={}
|
||||
self.displayConfig()
|
||||
|
||||
self.mainVBox.show_all()
|
||||
#end def __init__
|
||||
|
||||
def saveClicked(self, widget, data=None):
|
||||
row = self.rowVBox.get_children()
|
||||
columns=row[0].get_children() #TODO: make save capable of handling multiple email entries - not relevant yet as only one entry is useful atm. The rest of this tab works fine for multiple entries though
|
||||
|
||||
siteName=columns[0].get_text()
|
||||
fetchType=columns[1].get_text()
|
||||
code=siteName+"_"+fetchType
|
||||
|
||||
for email in self.config.emails:
|
||||
toSave=self.config.emails[email]
|
||||
break
|
||||
toSave.siteName=siteName
|
||||
toSave.fetchType=fetchType
|
||||
|
||||
toSave.host=columns[2].get_text()
|
||||
toSave.username=columns[3].get_text()
|
||||
|
||||
if columns[4].get_text()=="***":
|
||||
toSave.password=self.passwords[code]
|
||||
else:
|
||||
toSave.password=columns[4].get_text()
|
||||
|
||||
toSave.folder=columns[5].get_text()
|
||||
|
||||
if columns[6].get_active() == 0:
|
||||
toSave.useSsl="True"
|
||||
else:
|
||||
toSave.useSsl="False"
|
||||
|
||||
self.config.editEmail(siteName, fetchType, toSave)
|
||||
self.config.save()
|
||||
#def saveClicked
|
||||
|
||||
def importAllClicked(self, widget, data=None):
|
||||
self.statusLabel.set_label(_("Starting import. Please wait.")) #FIXME: why doesnt this one show?
|
||||
for email in self.config.emails:
|
||||
try:
|
||||
result=ImapFetcher.run(self.config.emails[email], self.db)
|
||||
self.statusLabel.set_label(_("Finished import without error."))
|
||||
except IMAP4.error as error:
|
||||
if str(error)=="[AUTHENTICATIONFAILED] Authentication failed.":
|
||||
self.statusLabel.set_label(_("Login to mailserver failed: please check mailserver, username and password"))
|
||||
except gaierror as error:
|
||||
if str(error)=="[Errno -2] Name or service not known":
|
||||
self.statusLabel.set_label(_("Could not connect to mailserver: check mailserver and use SSL settings and internet connectivity"))
|
||||
#def importAllClicked
|
||||
|
||||
def get_vbox(self):
|
||||
"""returns the vbox of this thread"""
|
||||
return self.mainVBox
|
||||
#end def get_vbox
|
||||
|
||||
def displayConfig(self):
|
||||
box=gtk.HBox(homogeneous=True)
|
||||
for text in (_("Site"), _("Fetch Type"), _("Mailserver"), _("Username"), _("Password"), _("Mail Folder"), _("Use SSL")):
|
||||
label=gtk.Label(text)
|
||||
box.add(label)
|
||||
self.mainVBox.pack_start(box, expand=False)
|
||||
|
||||
self.rowVBox = gtk.VBox()
|
||||
self.mainVBox.add(self.rowVBox)
|
||||
|
||||
for email in self.config.emails:
|
||||
config=self.config.emails[email]
|
||||
box=gtk.HBox(homogeneous=True)
|
||||
|
||||
for field in (config.siteName, config.fetchType):
|
||||
label=gtk.Label(field)
|
||||
box.add(label)
|
||||
|
||||
for field in (config.host, config.username):
|
||||
entry=gtk.Entry()
|
||||
entry.set_text(field)
|
||||
box.add(entry)
|
||||
|
||||
entry=gtk.Entry()
|
||||
self.passwords[email]=config.password
|
||||
entry.set_text("***")
|
||||
box.add(entry)
|
||||
|
||||
entry=gtk.Entry()
|
||||
entry.set_text(config.folder)
|
||||
box.add(entry)
|
||||
|
||||
sslBox = gtk.combo_box_new_text()
|
||||
sslBox.append_text(_("Yes"))
|
||||
sslBox.append_text(_("No"))
|
||||
sslBox.set_active(0)
|
||||
box.add(sslBox)
|
||||
|
||||
#TODO: "run just this one" button
|
||||
|
||||
self.rowVBox.pack_start(box, expand=False)
|
||||
#print
|
||||
|
||||
self.mainVBox.show_all()
|
||||
#end def displayConfig
|
||||
#end class GuiImapFetcher
|
|
@ -30,6 +30,17 @@ import logging
|
|||
# logging has been set up in fpdb.py or HUD_main.py, use their settings:
|
||||
log = logging.getLogger("logview")
|
||||
|
||||
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
|
||||
|
||||
MAX_LINES = 100000 # max lines to display in window
|
||||
EST_CHARS_PER_LINE = 150 # used to guesstimate number of lines in log file
|
||||
|
@ -47,7 +58,7 @@ class GuiLogView:
|
|||
self.closeq = closeq
|
||||
|
||||
self.logfile = os.path.join(self.config.dir_log, LOGFILES[1][1])
|
||||
self.dia = gtk.Dialog(title="Log Messages"
|
||||
self.dia = gtk.Dialog(title=_("Log Messages")
|
||||
,parent=None
|
||||
,flags=gtk.DIALOG_DESTROY_WITH_PARENT
|
||||
,buttons=(gtk.STOCK_CLOSE,gtk.RESPONSE_OK))
|
||||
|
@ -82,7 +93,7 @@ class GuiLogView:
|
|||
rb.set_active(logf[2])
|
||||
rb.connect('clicked', self.__set_logfile, logf[0])
|
||||
hb.pack_start(rb, False, False, 3)
|
||||
refreshbutton = gtk.Button("Refresh")
|
||||
refreshbutton = gtk.Button(_("Refresh"))
|
||||
refreshbutton.connect("clicked", self.refresh, None)
|
||||
hb.pack_start(refreshbutton, False, False, 3)
|
||||
refreshbutton.show()
|
||||
|
@ -186,7 +197,7 @@ class GuiLogView:
|
|||
# to turn indicator off for other cols
|
||||
except:
|
||||
err = traceback.extract_tb(sys.exc_info()[2])
|
||||
print "***sortCols error: " + str(sys.exc_info()[1])
|
||||
print _("***sortCols error: ") + str(sys.exc_info()[1])
|
||||
print "\n".join( [e[0]+':'+str(e[1])+" "+e[2] for e in err] )
|
||||
|
||||
def refresh(self, widget, data):
|
||||
|
@ -199,12 +210,12 @@ if __name__=="__main__":
|
|||
config = Configuration.Config()
|
||||
|
||||
win = gtk.Window(gtk.WINDOW_TOPLEVEL)
|
||||
win.set_title("Test Log Viewer")
|
||||
win.set_title(_("Test Log Viewer"))
|
||||
win.set_border_width(1)
|
||||
win.set_default_size(600, 500)
|
||||
win.set_resizable(True)
|
||||
|
||||
dia = gtk.Dialog("Log Viewer",
|
||||
dia = gtk.Dialog(_("Log Viewer"),
|
||||
win,
|
||||
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||
(gtk.STOCK_CLOSE, gtk.RESPONSE_OK))
|
||||
|
|
|
@ -22,6 +22,18 @@ import gtk
|
|||
import os
|
||||
from time import time, strftime
|
||||
|
||||
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 fpdb_import
|
||||
import Database
|
||||
import Filters
|
||||
|
@ -132,7 +144,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()
|
||||
|
@ -163,13 +175,13 @@ class GuiPositionalStats (threading.Thread):
|
|||
|
||||
if not sitenos:
|
||||
#Should probably pop up here.
|
||||
print "No sites selected - defaulting to PokerStars"
|
||||
print _("No sites selected - defaulting to PokerStars")
|
||||
sitenos = [2]
|
||||
if not playerids:
|
||||
print "No player ids found"
|
||||
print _("No player ids found")
|
||||
return
|
||||
if not limits:
|
||||
print "No limits found"
|
||||
print _("No limits found")
|
||||
return
|
||||
|
||||
self.createStatsTable(vbox, playerids, sitenos, limits, seats, dates)
|
||||
|
@ -318,7 +330,7 @@ class GuiPositionalStats (threading.Thread):
|
|||
vbox.show_all()
|
||||
|
||||
self.db.rollback()
|
||||
print "Positional Stats page displayed in %4.2f seconds" % (time() - starttime)
|
||||
print _("Positional Stats page displayed in %4.2f seconds") % (time() - starttime)
|
||||
#end def fillStatsFrame(self, vbox):
|
||||
|
||||
def refineQuery(self, query, playerids, sitenos, limits, seats, dates):
|
||||
|
|
|
@ -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'
|
||||
|
@ -67,13 +78,13 @@ class GuiPrefs:
|
|||
self.configView = gtk.TreeView(self.configStore)
|
||||
self.configView.set_enable_tree_lines(True)
|
||||
|
||||
configColumn = gtk.TreeViewColumn("Setting")
|
||||
configColumn = gtk.TreeViewColumn(_("Setting"))
|
||||
self.configView.append_column(configColumn)
|
||||
cRender = gtk.CellRendererText()
|
||||
configColumn.pack_start(cRender, True)
|
||||
configColumn.add_attribute(cRender, 'text', 1)
|
||||
|
||||
configColumn = gtk.TreeViewColumn("Value (double-click to change)")
|
||||
configColumn = gtk.TreeViewColumn(_("Value (double-click to change)"))
|
||||
self.configView.append_column(configColumn)
|
||||
cRender = gtk.CellRendererText()
|
||||
configColumn.pack_start(cRender, True)
|
||||
|
@ -168,19 +179,17 @@ class GuiPrefs:
|
|||
if dia is not None:
|
||||
dia.response(gtk.RESPONSE_ACCEPT)
|
||||
|
||||
|
||||
|
||||
if __name__=="__main__":
|
||||
|
||||
config = Configuration.Config()
|
||||
|
||||
win = gtk.Window(gtk.WINDOW_TOPLEVEL)
|
||||
win.set_title("Test Preferences Dialog")
|
||||
win.set_title(_("Test Preferences Dialog"))
|
||||
win.set_border_width(1)
|
||||
win.set_default_size(600, 500)
|
||||
win.set_resizable(True)
|
||||
|
||||
dia = gtk.Dialog("Preferences",
|
||||
dia = gtk.Dialog(_("Preferences"),
|
||||
win,
|
||||
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||
(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
|
||||
|
@ -193,7 +202,3 @@ if __name__=="__main__":
|
|||
# save updated config
|
||||
config.save()
|
||||
dia.destroy()
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -24,6 +24,18 @@ import os
|
|||
import sys
|
||||
from time import time, strftime
|
||||
|
||||
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 Card
|
||||
import fpdb_import
|
||||
import Database
|
||||
|
@ -237,13 +249,13 @@ class GuiRingPlayerStats (GuiPlayerStats.GuiPlayerStats):
|
|||
|
||||
if not sitenos:
|
||||
#Should probably pop up here.
|
||||
print "No sites selected - defaulting to PokerStars"
|
||||
print _("No sites selected - defaulting to PokerStars")
|
||||
sitenos = [2]
|
||||
if not playerids:
|
||||
print "No player ids found"
|
||||
print _("No player ids found")
|
||||
return
|
||||
if not limits:
|
||||
print "No limits found"
|
||||
print _("No limits found")
|
||||
return
|
||||
|
||||
self.createStatsTable(vbox, playerids, sitenos, limits, type, seats, groups, dates, games)
|
||||
|
@ -308,7 +320,7 @@ class GuiRingPlayerStats (GuiPlayerStats.GuiPlayerStats):
|
|||
self.stats_vbox.set_position(self.top_pane_height + self.height_inc)
|
||||
|
||||
self.db.rollback()
|
||||
print "Stats page displayed in %4.2f seconds" % (time() - startTime)
|
||||
print (_("Stats page displayed in %4.2f seconds") % (time() - startTime))
|
||||
#end def createStatsTable
|
||||
|
||||
def reset_style_render_func(self, treeviewcolumn, cell, model, iter):
|
||||
|
@ -355,7 +367,7 @@ class GuiRingPlayerStats (GuiPlayerStats.GuiPlayerStats):
|
|||
#print "n =", n, "iter1[n] =", self.liststore[grid].get_value(iter1,n), "iter2[n] =", self.liststore[grid].get_value(iter2,n), "ret =", ret
|
||||
except:
|
||||
err = traceback.extract_tb(sys.exc_info()[2])
|
||||
print "***sortnums error: " + str(sys.exc_info()[1])
|
||||
print _("***sortnums error: ") + str(sys.exc_info()[1])
|
||||
print "\n".join( [e[0]+':'+str(e[1])+" "+e[2] for e in err] )
|
||||
|
||||
return(ret)
|
||||
|
@ -377,7 +389,7 @@ class GuiRingPlayerStats (GuiPlayerStats.GuiPlayerStats):
|
|||
# to turn indicator off for other cols
|
||||
except:
|
||||
err = traceback.extract_tb(sys.exc_info()[2])
|
||||
print "***sortcols error: " + str(sys.exc_info()[1])
|
||||
print _("***sortcols error: ") + str(sys.exc_info()[1])
|
||||
print "\n".join( [e[0]+':'+str(e[1])+" "+e[2] for e in err] )
|
||||
#end def sortcols
|
||||
|
||||
|
@ -668,7 +680,7 @@ class GuiRingPlayerStats (GuiPlayerStats.GuiPlayerStats):
|
|||
#end def refineQuery
|
||||
|
||||
def showDetailFilter(self, widget, data):
|
||||
detailDialog = gtk.Dialog(title="Detailed Filters", parent=self.main_window
|
||||
detailDialog = gtk.Dialog(title=_("Detailed Filters"), parent=self.main_window
|
||||
,flags=gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT
|
||||
,buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
|
||||
gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
|
||||
|
@ -677,7 +689,7 @@ class GuiRingPlayerStats (GuiPlayerStats.GuiPlayerStats):
|
|||
detailDialog.vbox.pack_start(handbox, False, False, 0)
|
||||
handbox.show()
|
||||
|
||||
label = gtk.Label("Hand Filters:")
|
||||
label = gtk.Label(_("Hand Filters:"))
|
||||
handbox.add(label)
|
||||
label.show()
|
||||
|
||||
|
@ -690,8 +702,8 @@ class GuiRingPlayerStats (GuiPlayerStats.GuiPlayerStats):
|
|||
cb = gtk.CheckButton()
|
||||
lbl_from = gtk.Label(htest[1])
|
||||
lbl_from.set_alignment(xalign=0.0, yalign=0.5)
|
||||
lbl_tween = gtk.Label('between')
|
||||
lbl_to = gtk.Label('and')
|
||||
lbl_tween = gtk.Label(_('between'))
|
||||
lbl_to = gtk.Label(_('and'))
|
||||
adj1 = gtk.Adjustment(value=htest[2], lower=0, upper=10, step_incr=1, page_incr=1, page_size=0)
|
||||
sb1 = gtk.SpinButton(adjustment=adj1, climb_rate=0.0, digits=0)
|
||||
adj2 = gtk.Adjustment(value=htest[3], lower=2, upper=10, step_incr=1, page_incr=1, page_size=0)
|
||||
|
|
|
@ -38,9 +38,20 @@ try:
|
|||
# DayLocator, MONDAY, timezone
|
||||
|
||||
except ImportError, inst:
|
||||
print """Failed to load numpy in Session Viewer"""
|
||||
print """This is of no consequence as the page is broken and only of interest to developers."""
|
||||
print "ImportError: %s" % inst.args
|
||||
print _("""Failed to load numpy and/or matplotlib in Session Viewer""")
|
||||
print _("ImportError: %s") % inst.args
|
||||
|
||||
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 Card
|
||||
import fpdb_import
|
||||
|
@ -76,8 +87,7 @@ class GuiSessionViewer (threading.Thread):
|
|||
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,
|
||||
"Sites" : True,
|
||||
|
@ -191,13 +201,13 @@ class GuiSessionViewer (threading.Thread):
|
|||
|
||||
if not sitenos:
|
||||
#Should probably pop up here.
|
||||
print "No sites selected - defaulting to PokerStars"
|
||||
print _("No sites selected - defaulting to PokerStars")
|
||||
sitenos = [2]
|
||||
if not playerids:
|
||||
print "No player ids found"
|
||||
print _("No player ids found")
|
||||
return
|
||||
if not limits:
|
||||
print "No limits found"
|
||||
print _("No limits found")
|
||||
return
|
||||
|
||||
self.createStatsPane(vbox, playerids, sitenos, limits, seats)
|
||||
|
@ -236,7 +246,7 @@ class GuiSessionViewer (threading.Thread):
|
|||
self.addTable(vbox1, results)
|
||||
|
||||
self.db.rollback()
|
||||
print "Stats page displayed in %4.2f seconds" % (time() - starttime)
|
||||
print _("Stats page displayed in %4.2f seconds") % (time() - starttime)
|
||||
#end def fillStatsFrame(self, vbox):
|
||||
|
||||
def generateDatasets(self, playerids, sitenos, limits, seats):
|
||||
|
@ -342,7 +352,7 @@ class GuiSessionViewer (threading.Thread):
|
|||
self.canvas = FigureCanvas(self.fig) # a gtk.DrawingArea
|
||||
except:
|
||||
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
||||
print "***Error: "+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
||||
print _("***Error: ")+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
||||
raise
|
||||
|
||||
|
||||
|
@ -363,10 +373,10 @@ class GuiSessionViewer (threading.Thread):
|
|||
|
||||
self.ax = self.fig.add_subplot(111)
|
||||
|
||||
self.ax.set_title("Session candlestick graph")
|
||||
self.ax.set_title(_("Session candlestick graph"))
|
||||
|
||||
#Set axis labels and grid overlay properites
|
||||
self.ax.set_xlabel("Sessions", fontsize = 12)
|
||||
self.ax.set_xlabel(_("Sessions"), fontsize = 12)
|
||||
self.ax.set_ylabel("$", fontsize = 12)
|
||||
self.ax.grid(color='g', linestyle=':', linewidth=0.2)
|
||||
|
||||
|
|
|
@ -24,6 +24,18 @@ import gtk
|
|||
#import sys
|
||||
from time import time, strftime
|
||||
|
||||
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 Card
|
||||
#import fpdb_import
|
||||
#import Database
|
||||
|
@ -69,7 +81,7 @@ class GuiTourneyPlayerStats (GuiPlayerStats.GuiPlayerStats):
|
|||
self.filters = TourneyFilters.TourneyFilters(self.db, self.conf, self.sql, display = filters_display)
|
||||
#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
|
||||
|
@ -86,9 +98,9 @@ class GuiTourneyPlayerStats (GuiPlayerStats.GuiPlayerStats):
|
|||
, ["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"]
|
||||
, ["_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"]
|
||||
|
@ -237,7 +249,7 @@ class GuiTourneyPlayerStats (GuiPlayerStats.GuiPlayerStats):
|
|||
self.addGrid(swin, 'playerDetailedStats', flags, playerids, sitenos, seats, dates)
|
||||
|
||||
self.db.rollback()
|
||||
print "Stats page displayed in %4.2f seconds" % (time() - startTime)
|
||||
print _("Stats page displayed in %4.2f seconds") % (time() - startTime)
|
||||
#end def createStatsTable
|
||||
|
||||
def fillStatsFrame(self, vbox):
|
||||
|
@ -262,10 +274,10 @@ class GuiTourneyPlayerStats (GuiPlayerStats.GuiPlayerStats):
|
|||
|
||||
if not sitenos:
|
||||
#Should probably pop up here.
|
||||
print "No sites selected - defaulting to PokerStars"
|
||||
print _("No sites selected - defaulting to PokerStars")
|
||||
sitenos = [2]
|
||||
if not playerids:
|
||||
print "No player ids found"
|
||||
print _("No player ids found")
|
||||
return
|
||||
|
||||
self.createStatsTable(vbox, tourneyTypes, playerids, sitenos, seats, dates)
|
||||
|
@ -451,7 +463,7 @@ class GuiTourneyPlayerStats (GuiPlayerStats.GuiPlayerStats):
|
|||
# to turn indicator off for other cols
|
||||
except:
|
||||
err = traceback.extract_tb(sys.exc_info()[2])
|
||||
print "***sortCols error: " + str(sys.exc_info()[1])
|
||||
print _("***sortCols error: ") + str(sys.exc_info()[1])
|
||||
print "\n".join( [e[0]+':'+str(e[1])+" "+e[2] for e in err] )
|
||||
#end def sortCols
|
||||
#end class GuiTourneyPlayerStats
|
||||
|
|
151
pyfpdb/GuiTourneyViewer.py
Normal file
151
pyfpdb/GuiTourneyViewer.py
Normal file
|
@ -0,0 +1,151 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2010 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.
|
||||
#
|
||||
#This program is distributed in the hope that it will be useful,
|
||||
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
#GNU General Public License for more details.
|
||||
#
|
||||
#You should have received a copy of the GNU Affero General Public License
|
||||
#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.
|
||||
|
||||
import threading
|
||||
import pygtk
|
||||
pygtk.require('2.0')
|
||||
import gtk
|
||||
|
||||
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
|
||||
|
||||
class GuiTourneyViewer (threading.Thread):
|
||||
def __init__(self, config, db, sql, mainwin, debug=True):
|
||||
self.db = db
|
||||
|
||||
self.mainVBox = gtk.VBox()
|
||||
self.interfaceHBox = gtk.HBox()
|
||||
self.mainVBox.pack_start(self.interfaceHBox, expand=False)
|
||||
|
||||
self.siteBox = gtk.combo_box_new_text()
|
||||
for site in config.supported_sites:
|
||||
self.siteBox.append_text(site)
|
||||
self.siteBox.set_active(0)
|
||||
self.interfaceHBox.add(self.siteBox)
|
||||
|
||||
label=gtk.Label(_("Enter the tourney number you want to display:"))
|
||||
self.interfaceHBox.add(label)
|
||||
|
||||
self.entryTourney = gtk.Entry()
|
||||
self.interfaceHBox.add(self.entryTourney)
|
||||
|
||||
self.displayButton = gtk.Button(_("_Display"))
|
||||
self.displayButton.connect('clicked', self.displayClicked)
|
||||
self.interfaceHBox.add(self.displayButton)
|
||||
|
||||
self.entryPlayer = gtk.Entry()
|
||||
self.interfaceHBox.add(self.entryPlayer)
|
||||
|
||||
self.playerButton = gtk.Button(_("Display _Player"))
|
||||
self.playerButton.connect('clicked', self.displayPlayerClicked)
|
||||
self.interfaceHBox.add(self.playerButton)
|
||||
|
||||
self.table = gtk.Table(columns=10, rows=9)
|
||||
self.mainVBox.add(self.table)
|
||||
|
||||
self.mainVBox.show_all()
|
||||
#end def __init__
|
||||
|
||||
def displayClicked(self, widget, data=None):
|
||||
if self.prepare(10, 9):
|
||||
result=self.db.getTourneyInfo(self.siteName, self.tourneyNo)
|
||||
if result[1] == None:
|
||||
self.table.destroy()
|
||||
self.errorLabel=gtk.Label(_("Tournament not found - please ensure you imported it and selected the correct site"))
|
||||
self.mainVBox.add(self.errorLabel)
|
||||
else:
|
||||
x=0
|
||||
y=0
|
||||
for i in range(1,len(result[0])):
|
||||
if y==9:
|
||||
x+=2
|
||||
y=0
|
||||
|
||||
label=gtk.Label(result[0][i])
|
||||
self.table.attach(label,x,x+1,y,y+1)
|
||||
|
||||
if result[1][i]==None:
|
||||
label=gtk.Label("N/A")
|
||||
else:
|
||||
label=gtk.Label(result[1][i])
|
||||
self.table.attach(label,x+1,x+2,y,y+1)
|
||||
|
||||
y+=1
|
||||
self.mainVBox.show_all()
|
||||
#def displayClicked
|
||||
|
||||
def displayPlayerClicked(self, widget, data=None):
|
||||
if self.prepare(4, 5):
|
||||
result=self.db.getTourneyPlayerInfo(self.siteName, self.tourneyNo, self.playerName)
|
||||
if result[1] == None:
|
||||
self.table.destroy()
|
||||
self.errorLabel=gtk.Label(_("Player or tourney not found - please ensure you imported it and selected the correct site"))
|
||||
self.mainVBox.add(self.errorLabel)
|
||||
else:
|
||||
x=0
|
||||
y=0
|
||||
for i in range(1,len(result[0])):
|
||||
if y==5:
|
||||
x+=2
|
||||
y=0
|
||||
|
||||
label=gtk.Label(result[0][i])
|
||||
self.table.attach(label,x,x+1,y,y+1)
|
||||
|
||||
if result[1][i]==None:
|
||||
label=gtk.Label(_("N/A"))
|
||||
else:
|
||||
label=gtk.Label(result[1][i])
|
||||
self.table.attach(label,x+1,x+2,y,y+1)
|
||||
|
||||
y+=1
|
||||
self.mainVBox.show_all()
|
||||
#def displayPlayerClicked
|
||||
|
||||
def get_vbox(self):
|
||||
"""returns the vbox of this thread"""
|
||||
return self.mainVBox
|
||||
#end def get_vbox
|
||||
|
||||
def prepare(self, columns, rows):
|
||||
try: self.errorLabel.destroy()
|
||||
except: pass
|
||||
|
||||
try:
|
||||
self.tourneyNo=int(self.entryTourney.get_text())
|
||||
except ValueError:
|
||||
self.errorLabel=gtk.Label(_("invalid entry in tourney number - must enter numbers only"))
|
||||
self.mainVBox.add(self.errorLabel)
|
||||
return False
|
||||
self.siteName=self.siteBox.get_active_text()
|
||||
self.playerName=self.entryPlayer.get_text()
|
||||
|
||||
self.table.destroy()
|
||||
self.table=gtk.Table(columns=columns, rows=rows)
|
||||
self.mainVBox.add(self.table)
|
||||
return True
|
||||
#end def readInfo
|
||||
#end class GuiTourneyViewer
|
|
@ -11,6 +11,36 @@
|
|||
|
||||
<import callFpdbHud = "True" interval = "10" fastStoreHudCache="False" hhArchiveBase="~/.fpdb/HandHistories/" saveActions="True"></import>
|
||||
|
||||
<gui_cash_stats>
|
||||
<col col_name="game" disp_all="True" disp_posn="True" col_title="Game" xalignment="0.0" field_format="%s" field_type="str" />
|
||||
<col col_name="hand" disp_all="False" disp_posn="False" col_title="Hand" xalignment="0.0" field_format="%s" field_type="str" />
|
||||
<col col_name="plposition" disp_all="False" disp_posn="False" col_title="Posn" xalignment="1.0" field_format="%s" field_type="str" />
|
||||
<col col_name="pname" disp_all="False" disp_posn="False" col_title="Name" xalignment="0.0" field_format="%s" field_type="str" />
|
||||
<col col_name="n" disp_all="True" disp_posn="True" col_title="Hds" xalignment="1.0" field_format="%1.0f" field_type="str" />
|
||||
<col col_name="avgseats" disp_all="False" disp_posn="False" col_title="Seats" xalignment="1.0" field_format="%3.1f" field_type="str" />
|
||||
<col col_name="vpip" disp_all="True" disp_posn="True" col_title="VPIP" xalignment="1.0" field_format="%3.1f" field_type="str" />
|
||||
<col col_name="pfr" disp_all="True" disp_posn="True" col_title="PFR" xalignment="1.0" field_format="%3.1f" field_type="str" />
|
||||
<col col_name="pf3" disp_all="True" disp_posn="True" col_title="PF3" xalignment="1.0" field_format="%3.1f" field_type="str" />
|
||||
<col col_name="aggfac" disp_all="True" disp_posn="True" col_title="AggFac" xalignment="1.0" field_format="%2.2f" field_type="str" />
|
||||
<col col_name="aggfrq" disp_all="True" disp_posn="True" col_title="AggFreq" xalignment="1.0" field_format="%3.1f" field_type="str" />
|
||||
<col col_name="conbet" disp_all="True" disp_posn="True" col_title="ContBet" xalignment="1.0" field_format="%3.1f" field_type="str" />
|
||||
<col col_name="rfi" disp_all="True" disp_posn="True" col_title="RFI" xalignment="1.0" field_format="%3.1f" field_type="str" />
|
||||
<col col_name="steals" disp_all="True" disp_posn="True" col_title="Steals" xalignment="1.0" field_format="%3.1f" field_type="str" />
|
||||
<col col_name="saw_f" disp_all="True" disp_posn="True" col_title="Saw_F" xalignment="1.0" field_format="%3.1f" field_type="str" />
|
||||
<col col_name="sawsd" disp_all="True" disp_posn="True" col_title="SawSD" xalignment="1.0" field_format="%3.1f" field_type="str" />
|
||||
<col col_name="wtsdwsf" disp_all="True" disp_posn="True" col_title="WtSDwsF" xalignment="1.0" field_format="%3.1f" field_type="str" />
|
||||
<col col_name="wmsd" disp_all="True" disp_posn="True" col_title="W$SD" xalignment="1.0" field_format="%3.1f" field_type="str" />
|
||||
<col col_name="flafq" disp_all="True" disp_posn="True" col_title="FlAFq" xalignment="1.0" field_format="%3.1f" field_type="str" />
|
||||
<col col_name="tuafq" disp_all="True" disp_posn="True" col_title="TuAFq" xalignment="1.0" field_format="%3.1f" field_type="str" />
|
||||
<col col_name="rvafq" disp_all="True" disp_posn="True" col_title="RvAFq" xalignment="1.0" field_format="%3.1f" field_type="str" />
|
||||
<col col_name="pofafq" disp_all="False" disp_posn="False" col_title="PoFAFq" xalignment="1.0" field_format="%3.1f" field_type="str" />
|
||||
<col col_name="net" disp_all="True" disp_posn="True" col_title="Net($)" xalignment="1.0" field_format="%6.2f" field_type="cash" />
|
||||
<col col_name="bbper100" disp_all="True" disp_posn="True" col_title="bb/100" xalignment="1.0" field_format="%4.2f" field_type="str" />
|
||||
<col col_name="rake" disp_all="True" disp_posn="True" col_title="Rake($)" xalignment="1.0" field_format="%6.2f" field_type="cash" />
|
||||
<col col_name="bb100xr" disp_all="True" disp_posn="True" col_title="bbxr/100" xalignment="1.0" field_format="%4.2f" field_type="str" />
|
||||
<col col_name="variance" disp_all="True" disp_posn="True" col_title="Variance" xalignment="1.0" field_format="%5.2f" field_type="str" />
|
||||
</gui_cash_stats>
|
||||
|
||||
<!-- These values determine what stats are displayed in the HUD
|
||||
|
||||
The following values define how opponents' stats are done, the first 2 determine
|
||||
|
@ -222,49 +252,46 @@ Left-Drag to Move"
|
|||
</layout>
|
||||
</site>
|
||||
|
||||
<site enabled="False"
|
||||
site_name="Everleaf"
|
||||
table_finder="Everleaf.exe"
|
||||
screen_name="YOUR SCREEN NAME HERE"
|
||||
site_path=""
|
||||
HH_path=""
|
||||
decoder="everleaf_decode_table"
|
||||
converter="EverleafToFpdb"
|
||||
supported_games="holdem">
|
||||
<layout fav_seat="0" height="547" max="8" width="794">
|
||||
<location seat="1" x="640" y="64"> </location>
|
||||
<location seat="2" x="650" y="230"> </location>
|
||||
<location seat="3" x="650" y="385"> </location>
|
||||
<location seat="4" x="588" y="425"> </location>
|
||||
<location seat="5" x="92" y="425"> </location>
|
||||
<location seat="6" x="0" y="373"> </location>
|
||||
<location seat="7" x="0" y="223"> </location>
|
||||
<location seat="8" x="25" y="50"> </location>
|
||||
</layout>
|
||||
<layout fav_seat="0" height="547" max="6" width="794">
|
||||
<location seat="1" x="640" y="58"> </location>
|
||||
<location seat="2" x="654" y="288"> </location>
|
||||
<location seat="3" x="615" y="424"> </location>
|
||||
<location seat="4" x="70" y="421"> </location>
|
||||
<location seat="5" x="0" y="280"> </location>
|
||||
<location seat="6" x="70" y="58"> </location>
|
||||
</layout>
|
||||
<layout fav_seat="0" height="547" max="2" width="794">
|
||||
<location seat="1" x="651" y="288"> </location>
|
||||
<location seat="2" x="10" y="288"> </location>
|
||||
</layout>
|
||||
<layout fav_seat="0" height="547" max="9" width="794">
|
||||
<location seat="1" x="634" y="38"> </location>
|
||||
<location seat="2" x="667" y="184"> </location>
|
||||
<location seat="3" x="667" y="321"> </location>
|
||||
<location seat="4" x="667" y="445"> </location>
|
||||
<location seat="5" x="337" y="459"> </location>
|
||||
<location seat="6" x="0" y="400"> </location>
|
||||
<location seat="7" x="0" y="322"> </location>
|
||||
<location seat="8" x="0" y="181"> </location>
|
||||
<location seat="9" x="70" y="53"> </location>
|
||||
</layout>
|
||||
</site>
|
||||
<site HH_path="C:\Users\WindowsUserName\Documents\EverleafSiteName\HandHistory\PlayerName"
|
||||
bgcolor="#000000"
|
||||
converter="EverleafToFpdb"
|
||||
decoder="everleaf_decode_table"
|
||||
enabled="False"
|
||||
fgcolor="#EEEEEE"
|
||||
hudopacity="0.75"
|
||||
screen_name="PlayerName"
|
||||
site_name="Everleaf"
|
||||
site_path="C:\Users\WindowsUserName\AppData\Roaming\EverleafSiteName\"
|
||||
supported_games="holdem,omahahi,omahahilo"
|
||||
table_finder="Poker.exe">
|
||||
<layout fav_seat="0" height="546" max="6" width="792">
|
||||
<location seat="0" x="0" y="0"> </location>
|
||||
<location seat="1" x="586" y="109"> </location>
|
||||
<location seat="2" x="605" y="283"> </location>
|
||||
<location seat="3" x="544" y="383"> </location>
|
||||
<location seat="4" x="67" y="383"> </location>
|
||||
<location seat="5" x="5" y="284"> </location>
|
||||
<location seat="6" x="61" y="111"> </location>
|
||||
</layout>
|
||||
<layout fav_seat="0" height="546" max="10" width="792">
|
||||
<location seat="0" x="182" y="69"> </location>
|
||||
<location seat="1" x="456" y="74"> </location>
|
||||
<location seat="2" x="630" y="81"> </location>
|
||||
<location seat="3" x="637" y="208"> </location>
|
||||
<location seat="4" x="629" y="347"> </location>
|
||||
<location seat="5" x="412" y="377"> </location>
|
||||
<location seat="6" x="232" y="377"> </location>
|
||||
<location seat="7" x="21" y="349"> </location>
|
||||
<location seat="8" x="4" y="208"> </location>
|
||||
<location seat="9" x="7" y="88"> </location>
|
||||
<location seat="10" x="196" y="69"> </location>
|
||||
</layout>
|
||||
<layout fav_seat="0" height="546" max="2" width="792">
|
||||
<location seat="1" x="651" y="288"> </location>
|
||||
<location seat="2" x="10" y="288"> </location>
|
||||
</layout>
|
||||
|
||||
</site>
|
||||
|
||||
<site enabled="False"
|
||||
site_name="Win2day"
|
||||
|
@ -556,22 +583,28 @@ Left-Drag to Move"
|
|||
|
||||
<popup_windows>
|
||||
<pu pu_name="default">
|
||||
<pu_stat pu_stat_name="playername"> </pu_stat>
|
||||
<pu_stat pu_stat_name="totalprofit"> </pu_stat>
|
||||
<pu_stat pu_stat_name="profit100"> </pu_stat>
|
||||
<pu_stat pu_stat_name="bbper100"> </pu_stat>
|
||||
<pu_stat pu_stat_name="BBper100"> </pu_stat>
|
||||
<pu_stat pu_stat_name="n"> </pu_stat>
|
||||
<pu_stat pu_stat_name="vpip"> </pu_stat>
|
||||
<pu_stat pu_stat_name="pfr"> </pu_stat>
|
||||
<pu_stat pu_stat_name="three_B_0"> </pu_stat>
|
||||
<pu_stat pu_stat_name="steal"> </pu_stat>
|
||||
<pu_stat pu_stat_name="f_steal"> </pu_stat>
|
||||
<pu_stat pu_stat_name="f_BB_steal"> </pu_stat>
|
||||
<pu_stat pu_stat_name="f_SB_steal"> </pu_stat>
|
||||
<pu_stat pu_stat_name="wmsd"> </pu_stat>
|
||||
<pu_stat pu_stat_name="wtsd"> </pu_stat>
|
||||
<pu_stat pu_stat_name="WMsF"> </pu_stat>
|
||||
<pu_stat pu_stat_name="agg_fact"> </pu_stat>
|
||||
<pu_stat pu_stat_name="a_freq1"> </pu_stat>
|
||||
<pu_stat pu_stat_name="a_freq2"> </pu_stat>
|
||||
<pu_stat pu_stat_name="a_freq3"> </pu_stat>
|
||||
<pu_stat pu_stat_name="a_freq4"> </pu_stat>
|
||||
<pu_stat pu_stat_name="agg_freq"> </pu_stat>
|
||||
<pu_stat pu_stat_name="agg_fact"> </pu_stat>
|
||||
<pu_stat pu_stat_name="cbet"> </pu_stat>
|
||||
<pu_stat pu_stat_name="cb1"> </pu_stat>
|
||||
<pu_stat pu_stat_name="cb2"> </pu_stat>
|
||||
|
@ -637,8 +670,40 @@ Left-Drag to Move"
|
|||
<hhc site="Betfair" converter="BetfairToFpdb"/>
|
||||
<hhc site="Partouche" converter="PartoucheToFpdb"/>
|
||||
<hhc site="Carbon" converter="CarbonToFpdb"/>
|
||||
<hhc site="OnGame" converter="OnGameToFpdb"/>
|
||||
</hhcs>
|
||||
|
||||
<!-- attribute names chosen to be in alphabetic order so that order can be set when retrieved -->
|
||||
<gui_cash_stats>
|
||||
<col col_name="game" col_title="Game" disp_all="True" disp_posn="True" field_format="%s" field_type="str" xalignment="0.0"/>
|
||||
<col col_name="hand" col_title="Hand" disp_all="False" disp_posn="False" field_format="%s" field_type="str" xalignment="0.0"/>
|
||||
<col col_name="plposition" col_title="Posn" disp_all="False" disp_posn="False" field_format="%s" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="pname" col_title="Name" disp_all="False" disp_posn="False" field_format="%s" field_type="str" xalignment="0.0"/>
|
||||
<col col_name="n" col_title="Hds" disp_all="True" disp_posn="True" field_format="%1.0f" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="avgseats" col_title="Seats" disp_all="False" disp_posn="False" field_format="%3.1f" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="vpip" col_title="VPIP" disp_all="True" disp_posn="True" field_format="%3.1f" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="pfr" col_title="PFR" disp_all="True" disp_posn="True" field_format="%3.1f" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="pf3" col_title="PF3" disp_all="True" disp_posn="True" field_format="%3.1f" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="aggfac" col_title="AggFac" disp_all="True" disp_posn="True" field_format="%2.2f" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="aggfrq" col_title="AggFreq" disp_all="True" disp_posn="True" field_format="%3.1f" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="conbet" col_title="ContBet" disp_all="False" disp_posn="True" field_format="%3.1f" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="rfi" col_title="RFI" disp_all="True" disp_posn="True" field_format="%3.1f" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="steals" col_title="Steals" disp_all="True" disp_posn="True" field_format="%3.1f" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="saw_f" col_title="Saw_F" disp_all="True" disp_posn="True" field_format="%3.1f" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="sawsd" col_title="SawSD" disp_all="True" disp_posn="True" field_format="%3.1f" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="wtsdwsf" col_title="WtSDwsF" disp_all="True" disp_posn="True" field_format="%3.1f" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="wmsd" col_title="W$SD" disp_all="True" disp_posn="True" field_format="%3.1f" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="flafq" col_title="FlAFq" disp_all="True" disp_posn="True" field_format="%3.1f" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="tuafq" col_title="TuAFq" disp_all="True" disp_posn="True" field_format="%3.1f" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="rvafq" col_title="RvAFq" disp_all="True" disp_posn="True" field_format="%3.1f" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="pofafq" col_title="PoFAFq" disp_all="False" disp_posn="False" field_format="%3.1f" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="net" col_title="Net($)" disp_all="True" disp_posn="True" field_format="%6.2f" field_type="cash" xalignment="1.0"/>
|
||||
<col col_name="bbper100" col_title="bb/100" disp_all="True" disp_posn="True" field_format="%4.2f" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="rake" col_title="Rake($)" disp_all="True" disp_posn="True" field_format="%6.2f" field_type="cash" xalignment="1.0"/>
|
||||
<col col_name="bb100xr" col_title="bbxr/100" disp_all="True" disp_posn="True" field_format="%4.2f" field_type="str" xalignment="1.0"/>
|
||||
<col col_name="variance" col_title="Variance" disp_all="True" disp_posn="True" field_format="%5.2f" field_type="str" xalignment="1.0"/>
|
||||
</gui_cash_stats>
|
||||
|
||||
<supported_databases>
|
||||
<!-- <database db_name="fpdb" db_server="mysql" db_ip="localhost" db_user="fpdb" db_pass="YOUR MYSQL PASSWORD"></database> -->
|
||||
<database db_ip="localhost" db_server="sqlite" db_name="fpdb.db3" db_user="fpdb" db_pass="fpdb"/>
|
||||
|
|
|
@ -60,6 +60,18 @@ elif os.name == 'nt':
|
|||
#import Tables
|
||||
import Hud
|
||||
|
||||
import locale
|
||||
lang=locale.getdefaultlocale()[0][0:2]
|
||||
print "lang:", lang
|
||||
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
|
||||
|
||||
# get config and set up logger
|
||||
c = Configuration.Config(file=options.config, dbname=options.dbname)
|
||||
|
@ -71,22 +83,22 @@ class HUD_main(object):
|
|||
# This class mainly provides state for controlling the multiple HUDs.
|
||||
|
||||
def __init__(self, db_name = 'fpdb'):
|
||||
print "\nHUD_main: starting ..."
|
||||
print _("\nHUD_main: starting ...")
|
||||
self.db_name = db_name
|
||||
self.config = c
|
||||
print "Logfile is " + os.path.join(self.config.dir_log, 'HUD-log.txt')
|
||||
log.info("HUD_main starting: using db name = %s" % (db_name))
|
||||
print _("Logfile is ") + os.path.join(self.config.dir_log, 'HUD-log.txt')
|
||||
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')
|
||||
print "Note: error output is being diverted to:\n"+fileName \
|
||||
+ "\nAny major error will be reported there _only_.\n"
|
||||
log.info("Note: error output is being diverted to:"+fileName)
|
||||
log.info("Any major error will be reported there _only_.")
|
||||
print _("Note: error output is being diverted to:\n")+fileName \
|
||||
+ _("\nAny major error will be reported there _only_.\n")
|
||||
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")
|
||||
sys.stderr.write(_("HUD_main: starting ...\n"))
|
||||
|
||||
self.hud_dict = {}
|
||||
self.hud_params = self.config.get_hud_ui_parameters()
|
||||
|
@ -99,10 +111,10 @@ class HUD_main(object):
|
|||
self.main_window = gtk.Window()
|
||||
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")
|
||||
self.main_window.set_title(_("HUD Main Window"))
|
||||
self.main_window.show_all()
|
||||
except:
|
||||
log.error( "*** Exception in HUD_main.init() *** " )
|
||||
|
@ -111,7 +123,7 @@ class HUD_main(object):
|
|||
|
||||
|
||||
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):
|
||||
|
@ -215,7 +227,7 @@ class HUD_main(object):
|
|||
t0 = time.time()
|
||||
t1 = t2 = t3 = t4 = t5 = t6 = t0
|
||||
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()
|
||||
|
@ -234,12 +246,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.error("db error: skipping %s" % new_hand_id)
|
||||
log.error(_("db error: skipping %s" % new_hand_id))
|
||||
continue
|
||||
t1 = time.time()
|
||||
|
||||
|
@ -260,8 +272,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
|
||||
|
@ -295,8 +307,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 "+table_name+" not found, skipping.\n")
|
||||
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.max = max
|
||||
tablewindow.site = site_name
|
||||
|
@ -304,10 +315,10 @@ class HUD_main(object):
|
|||
if hasattr(tablewindow, 'number'):
|
||||
self.create_HUD(new_hand_id, tablewindow, temp_key, max, poker_game, type, stat_dict, cards)
|
||||
else:
|
||||
log.error('Table "%s" no longer exists\n' % table_name)
|
||||
log.error(_('Table "%s" no longer exists\n') % table_name)
|
||||
|
||||
t6 = time.time()
|
||||
log.info("HUD_main.read_stdin: hand read in %4.3f seconds (%4.3f,%4.3f,%4.3f,%4.3f,%4.3f,%4.3f)"
|
||||
log.info(_("HUD_main.read_stdin: hand read in %4.3f seconds (%4.3f,%4.3f,%4.3f,%4.3f,%4.3f,%4.3f)")
|
||||
% (t6-t0,t1-t0,t2-t0,t3-t0,t4-t0,t5-t0,t6-t0))
|
||||
self.db_connection.connection.rollback()
|
||||
|
||||
|
|
|
@ -42,13 +42,13 @@ def destroy(*args): # call back for terminating the main eventloop
|
|||
|
||||
|
||||
if __name__== "__main__":
|
||||
sys.stderr.write("HUD_main starting\n")
|
||||
sys.stderr.write(_("HUD_main starting\n"))
|
||||
|
||||
try:
|
||||
HUD_main.db_name = sys.argv[1]
|
||||
except:
|
||||
HUD_main.db_name = 'fpdb'
|
||||
sys.stderr.write("Using db name = %s\n" % (HUD_main.db_name))
|
||||
sys.stderr.write(_("Using db name = %s\n") % (HUD_main.db_name))
|
||||
|
||||
HUD_main.config = Configuration.Config()
|
||||
|
||||
|
@ -59,11 +59,11 @@ if __name__== "__main__":
|
|||
HUD_main.main_window = gtk.Window()
|
||||
HUD_main.main_window.connect("destroy", destroy)
|
||||
HUD_main.eb = gtk.VBox()
|
||||
label = gtk.Label('Closing this window will exit from the HUD.')
|
||||
label = gtk.Label(_('Closing this window will exit from the HUD.'))
|
||||
HUD_main.eb.add(label)
|
||||
HUD_main.main_window.add(HUD_main.eb)
|
||||
|
||||
HUD_main.main_window.set_title("HUD Main Window")
|
||||
HUD_main.main_window.set_title(_("HUD Main Window"))
|
||||
HUD_main.main_window.show_all()
|
||||
|
||||
gtk.main()
|
||||
|
|
175
pyfpdb/Hand.py
175
pyfpdb/Hand.py
|
@ -28,6 +28,18 @@ import time,datetime
|
|||
from copy import deepcopy
|
||||
import pprint
|
||||
|
||||
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 logging
|
||||
# logging has been set up in fpdb.py or HUD_main.py, use their settings:
|
||||
log = logging.getLogger("parser")
|
||||
|
@ -83,6 +95,7 @@ class Hand(object):
|
|||
self.isRebuy = False
|
||||
self.isAddOn = False
|
||||
self.isKO = False
|
||||
self.koBounty = None
|
||||
self.isMatrix = False
|
||||
self.isShootout = False
|
||||
self.added = None
|
||||
|
@ -134,58 +147,59 @@ class Hand(object):
|
|||
self.is_duplicate = False # i.e. don't update hudcache if true
|
||||
|
||||
def __str__(self):
|
||||
vars = ( ("BB", self.bb),
|
||||
("SB", self.sb),
|
||||
("BUTTONPOS", self.buttonpos),
|
||||
("HAND NO.", self.handid),
|
||||
("SITE", self.sitename),
|
||||
("TABLE NAME", self.tablename),
|
||||
("HERO", self.hero),
|
||||
("MAXSEATS", self.maxseats),
|
||||
("LEVEL", self.level),
|
||||
("MIXED", self.mixed),
|
||||
("LASTBET", self.lastBet),
|
||||
("ACTION STREETS", self.actionStreets),
|
||||
("STREETS", self.streets),
|
||||
("ALL STREETS", self.allStreets),
|
||||
("COMMUNITY STREETS", self.communityStreets),
|
||||
("HOLE STREETS", self.holeStreets),
|
||||
("COUNTED SEATS", self.counted_seats),
|
||||
("DEALT", self.dealt),
|
||||
("SHOWN", self.shown),
|
||||
("MUCKED", self.mucked),
|
||||
("TOTAL POT", self.totalpot),
|
||||
("TOTAL COLLECTED", self.totalcollected),
|
||||
("RAKE", self.rake),
|
||||
("START TIME", self.startTime),
|
||||
("TOURNAMENT NO", self.tourNo),
|
||||
("TOURNEY ID", self.tourneyId),
|
||||
("TOURNEY TYPE ID", self.tourneyTypeId),
|
||||
("BUYIN", self.buyin),
|
||||
("BUYIN CURRENCY", self.buyinCurrency),
|
||||
("BUYIN CHIPS", self.buyInChips),
|
||||
("FEE", self.fee),
|
||||
("IS REBUY", self.isRebuy),
|
||||
("IS ADDON", self.isAddOn),
|
||||
("IS KO", self.isKO),
|
||||
("IS MATRIX", self.isMatrix),
|
||||
("IS SHOOTOUT", self.isShootout),
|
||||
("TOURNEY COMMENT", self.tourneyComment),
|
||||
vars = ( (_("BB"), self.bb),
|
||||
(_("SB"), self.sb),
|
||||
(_("BUTTONPOS"), self.buttonpos),
|
||||
(_("HAND NO."), self.handid),
|
||||
(_("SITE"), self.sitename),
|
||||
(_("TABLE NAME"), self.tablename),
|
||||
(_("HERO"), self.hero),
|
||||
(_("MAXSEATS"), self.maxseats),
|
||||
(_("LEVEL"), self.level),
|
||||
(_("MIXED"), self.mixed),
|
||||
(_("LASTBET"), self.lastBet),
|
||||
(_("ACTION STREETS"), self.actionStreets),
|
||||
(_("STREETS"), self.streets),
|
||||
(_("ALL STREETS"), self.allStreets),
|
||||
(_("COMMUNITY STREETS"), self.communityStreets),
|
||||
(_("HOLE STREETS"), self.holeStreets),
|
||||
(_("COUNTED SEATS"), self.counted_seats),
|
||||
(_("DEALT"), self.dealt),
|
||||
(_("SHOWN"), self.shown),
|
||||
(_("MUCKED"), self.mucked),
|
||||
(_("TOTAL POT"), self.totalpot),
|
||||
(_("TOTAL COLLECTED"), self.totalcollected),
|
||||
(_("RAKE"), self.rake),
|
||||
(_("START TIME"), self.startTime),
|
||||
(_("TOURNAMENT NO"), self.tourNo),
|
||||
(_("TOURNEY ID"), self.tourneyId),
|
||||
(_("TOURNEY TYPE ID"), self.tourneyTypeId),
|
||||
(_("BUYIN"), self.buyin),
|
||||
(_("BUYIN CURRENCY"), self.buyinCurrency),
|
||||
(_("BUYIN CHIPS"), self.buyInChips),
|
||||
(_("FEE"), self.fee),
|
||||
(_("IS REBUY"), self.isRebuy),
|
||||
(_("IS ADDON"), self.isAddOn),
|
||||
(_("IS KO"), self.isKO),
|
||||
(_("KO BOUNTY"), self.koBounty),
|
||||
(_("IS MATRIX"), self.isMatrix),
|
||||
(_("IS SHOOTOUT"), self.isShootout),
|
||||
(_("TOURNEY COMMENT"), self.tourneyComment),
|
||||
)
|
||||
|
||||
structs = ( ("PLAYERS", self.players),
|
||||
("STACKS", self.stacks),
|
||||
("POSTED", self.posted),
|
||||
("POT", self.pot),
|
||||
("SEATING", self.seating),
|
||||
("GAMETYPE", self.gametype),
|
||||
("ACTION", self.actions),
|
||||
("COLLECTEES", self.collectees),
|
||||
("BETS", self.bets),
|
||||
("BOARD", self.board),
|
||||
("DISCARDS", self.discards),
|
||||
("HOLECARDS", self.holecards),
|
||||
("TOURNEYS PLAYER IDS", self.tourneysPlayersIds),
|
||||
structs = ( (_("PLAYERS"), self.players),
|
||||
(_("STACKS"), self.stacks),
|
||||
(_("POSTED"), self.posted),
|
||||
(_("POT"), self.pot),
|
||||
(_("SEATING"), self.seating),
|
||||
(_("GAMETYPE"), self.gametype),
|
||||
(_("ACTION"), self.actions),
|
||||
(_("COLLECTEES"), self.collectees),
|
||||
(_("BETS"), self.bets),
|
||||
(_("BOARD"), self.board),
|
||||
(_("DISCARDS"), self.discards),
|
||||
(_("HOLECARDS"), self.holecards),
|
||||
(_("TOURNEYS PLAYER IDS"), self.tourneysPlayersIds),
|
||||
)
|
||||
str = ''
|
||||
for (name, var) in vars:
|
||||
|
@ -208,7 +222,7 @@ dealt whether they were seen in a 'dealt to' line
|
|||
try:
|
||||
self.checkPlayerExists(player)
|
||||
except FpdbParseError, e:
|
||||
print "[ERROR] Tried to add holecards for unknown player: %s" % (player,)
|
||||
print _("[ERROR] Tried to add holecards for unknown player: %s") % (player,)
|
||||
return
|
||||
|
||||
if dealt: self.dealt.add(player)
|
||||
|
@ -237,7 +251,7 @@ dealt whether they were seen in a 'dealt to' line
|
|||
db.commit()
|
||||
#end def prepInsert
|
||||
|
||||
def insert(self, db):
|
||||
def insert(self, db, printtest = False):
|
||||
""" Function to insert Hand into database
|
||||
Should not commit, and do minimal selects. Callers may want to cache commits
|
||||
db: a connected Database object"""
|
||||
|
@ -257,11 +271,11 @@ db: a connected Database object"""
|
|||
hh['seats'] = len(self.dbid_pids)
|
||||
|
||||
self.dbid_hands = db.storeHand(hh)
|
||||
db.storeHandsPlayers(self.dbid_hands, self.dbid_pids, self.stats.getHandsPlayers())
|
||||
db.storeHandsPlayers(self.dbid_hands, self.dbid_pids, self.stats.getHandsPlayers(), printdata = printtest)
|
||||
# TODO HandsActions - all actions for all players for all streets - self.actions
|
||||
# HudCache data can be generated from HandsActions (HandsPlayers?)
|
||||
else:
|
||||
log.info("Hand.insert(): hid #: %s is a duplicate" % hh['siteHandNo'])
|
||||
log.info(_("Hand.insert(): hid #: %s is a duplicate") % hh['siteHandNo'])
|
||||
self.is_duplicate = True # i.e. don't update hudcache
|
||||
raise FpdbHandDuplicate(hh['siteHandNo'])
|
||||
|
||||
|
@ -300,15 +314,14 @@ If a player has None chips he won't be added."""
|
|||
log.debug("markStreets:\n"+ str(self.streets))
|
||||
else:
|
||||
tmp = self.handText[0:100]
|
||||
log.error("markstreets didn't match")
|
||||
log.error(" - Assuming hand cancelled")
|
||||
log.error(_("markstreets didn't match - Assuming hand cancelled"))
|
||||
self.cancelled = True
|
||||
raise FpdbParseError("FpdbParseError: markStreets appeared to fail: First 100 chars: '%s'" % tmp)
|
||||
raise FpdbParseError(_("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" % player
|
||||
raise FpdbParseError("checkPlayerExists: '%s' failed." % player)
|
||||
print _("DEBUG: checkPlayerExists %s fail") % player
|
||||
raise FpdbParseError(_("checkPlayerExists: '%s' failed.") % player)
|
||||
|
||||
|
||||
|
||||
|
@ -391,7 +404,7 @@ For sites (currently only Carbon Poker) which record "all in" as a special actio
|
|||
def addCall(self, street, player=None, amount=None):
|
||||
if amount:
|
||||
amount = re.sub(u',', u'', amount) #some sites have commas
|
||||
log.debug("%s %s calls %s" %(street, player, amount))
|
||||
log.debug(_("%s %s calls %s") %(street, player, amount))
|
||||
# Potentially calculate the amount of the call if not supplied
|
||||
# corner cases include if player would be all in
|
||||
if amount is not None:
|
||||
|
@ -461,7 +474,7 @@ Add a raise on [street] by [player] to [amountTo]
|
|||
self._addRaise(street, player, C, Rb, Rt)
|
||||
|
||||
def _addRaise(self, street, player, C, Rb, Rt):
|
||||
log.debug("%s %s raise %s" %(street, player, Rt))
|
||||
log.debug(_("%s %s raise %s") %(street, player, Rt))
|
||||
self.bets[street][player].append(C + Rb)
|
||||
self.stacks[player] -= (C + Rb)
|
||||
act = (player, 'raises', Rb, Rt, C, self.stacks[player]==0)
|
||||
|
@ -472,7 +485,7 @@ Add a raise on [street] by [player] to [amountTo]
|
|||
|
||||
|
||||
def addBet(self, street, player, amount):
|
||||
log.debug("%s %s bets %s" %(street, player, amount))
|
||||
log.debug(_("%s %s bets %s") %(street, player, amount))
|
||||
amount = re.sub(u',', u'', amount) #some sites have commas
|
||||
self.checkPlayerExists(player)
|
||||
self.bets[street][player].append(Decimal(amount))
|
||||
|
@ -491,7 +504,7 @@ Add a raise on [street] by [player] to [amountTo]
|
|||
|
||||
|
||||
def addFold(self, street, player):
|
||||
log.debug("%s %s folds" % (street, player))
|
||||
log.debug(_("%s %s folds") % (street, player))
|
||||
self.checkPlayerExists(player)
|
||||
self.folded.add(player)
|
||||
self.pot.addFold(player)
|
||||
|
@ -500,7 +513,7 @@ Add a raise on [street] by [player] to [amountTo]
|
|||
|
||||
def addCheck(self, street, player):
|
||||
#print "DEBUG: %s %s checked" % (street, player)
|
||||
logging.debug("%s %s checks" % (street, player))
|
||||
logging.debug(_("%s %s checks") % (street, player))
|
||||
self.checkPlayerExists(player)
|
||||
self.actions[street].append((player, 'checks'))
|
||||
|
||||
|
@ -520,7 +533,7 @@ Add a raise on [street] by [player] to [amountTo]
|
|||
For when a player shows cards for any reason (for showdown or out of choice).
|
||||
Card ranks will be uppercased
|
||||
"""
|
||||
log.debug("addShownCards %s hole=%s all=%s" % (player, cards, holeandboard))
|
||||
log.debug(_("addShownCards %s hole=%s all=%s") % (player, cards, holeandboard))
|
||||
if cards is not None:
|
||||
self.addHoleCards(cards,player,shown, mucked)
|
||||
elif holeandboard is not None:
|
||||
|
@ -631,9 +644,9 @@ Map the tuple self.gametype onto the pokerstars string describing it
|
|||
try:
|
||||
timestr = datetime.datetime.strftime(self.startTime, '%Y/%m/%d %H:%M:%S ET')
|
||||
except TypeError:
|
||||
print "*** ERROR - HAND: calling writeGameLine with unexpected STARTTIME value, expecting datetime.date object, received:", self.startTime
|
||||
print "*** Make sure your HandHistoryConverter is setting hand.startTime properly!"
|
||||
print "*** Game String:", gs
|
||||
print _("*** ERROR - HAND: calling writeGameLine with unexpected STARTTIME value, expecting datetime.date object, received:"), self.startTime
|
||||
print _("*** Make sure your HandHistoryConverter is setting hand.startTime properly!")
|
||||
print _("*** Game String:"), gs
|
||||
return gs
|
||||
else:
|
||||
return gs + timestr
|
||||
|
@ -681,9 +694,15 @@ class HoldemOmahaHand(Hand):
|
|||
hhc.readPlayerStacks(self)
|
||||
hhc.compilePlayerRegexs(self)
|
||||
hhc.markStreets(self)
|
||||
|
||||
if self.cancelled:
|
||||
return
|
||||
hhc.readBlinds(self)
|
||||
|
||||
try: hhc.readBlinds(self)
|
||||
except:
|
||||
print _("*** Parse error reading blinds (check compilePlayerRegexs as a likely culprit)"), self
|
||||
return
|
||||
|
||||
hhc.readAntes(self)
|
||||
hhc.readButton(self)
|
||||
hhc.readHeroCards(self)
|
||||
|
@ -708,9 +727,9 @@ class HoldemOmahaHand(Hand):
|
|||
if handid is not None:
|
||||
self.select(handid) # Will need a handId
|
||||
else:
|
||||
log.warning("HoldemOmahaHand.__init__:Can't assemble hand from db without a handid")
|
||||
log.warning(_("HoldemOmahaHand.__init__:Can't assemble hand from db without a handid"))
|
||||
else:
|
||||
log.warning("HoldemOmahaHand.__init__:Neither HHC nor DB+handid provided")
|
||||
log.warning(_("HoldemOmahaHand.__init__:Neither HHC nor DB+handid provided"))
|
||||
pass
|
||||
|
||||
|
||||
|
@ -1222,7 +1241,7 @@ closed likewise, but known only to player
|
|||
self.checkPlayerExists(player)
|
||||
self.holecards[street][player] = (open, closed)
|
||||
except FpdbParseError, e:
|
||||
print "[ERROR] Tried to add holecards for unknown player: %s" % (player,)
|
||||
print _("[ERROR] Tried to add holecards for unknown player: %s") % (player,)
|
||||
|
||||
# TODO: def addComplete(self, player, amount):
|
||||
def addComplete(self, street, player, amountTo):
|
||||
|
@ -1231,7 +1250,7 @@ closed likewise, but known only to player
|
|||
"""\
|
||||
Add a complete on [street] by [player] to [amountTo]
|
||||
"""
|
||||
log.debug("%s %s completes %s" % (street, player, amountTo))
|
||||
log.debug(_("%s %s completes %s") % (street, player, amountTo))
|
||||
amountTo = re.sub(u',', u'', amountTo) #some sites have commas
|
||||
self.checkPlayerExists(player)
|
||||
Bp = self.lastBet['THIRD']
|
||||
|
@ -1249,7 +1268,7 @@ Add a complete on [street] by [player] to [amountTo]
|
|||
|
||||
def addBringIn(self, player, bringin):
|
||||
if player is not None:
|
||||
log.debug("Bringin: %s, %s" % (player , bringin))
|
||||
log.debug(_("Bringin: %s, %s") % (player , bringin))
|
||||
self.bets['THIRD'][player].append(Decimal(bringin))
|
||||
self.stacks[player] -= Decimal(bringin)
|
||||
act = (player, 'bringin', bringin, self.stacks[player]==0)
|
||||
|
@ -1429,8 +1448,8 @@ Add a complete on [street] by [player] to [amountTo]
|
|||
#Non hero folded before showdown, add first two downcards
|
||||
holecards = [u'0x', u'0x'] + holecards
|
||||
else:
|
||||
log.warning("join_holecards: # of holecards should be either < 4, 4 or 7 - 5 and 6 should be impossible for anyone who is not a hero")
|
||||
log.warning("join_holcards: holecards(%s): %s" %(player, holecards))
|
||||
log.warning(_("join_holecards: # of holecards should be either < 4, 4 or 7 - 5 and 6 should be impossible for anyone who is not a hero"))
|
||||
log.warning(_("join_holcards: holecards(%s): %s") %(player, holecards))
|
||||
return holecards
|
||||
|
||||
|
||||
|
@ -1513,9 +1532,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(_("FpdbError in printing Hand object"))
|
||||
|
||||
ret = "Total pot %s%.2f" % (self.sym, self.total)
|
||||
if len(self.pots) < 2:
|
||||
|
|
|
@ -41,9 +41,17 @@ import Hand
|
|||
from Exceptions import FpdbParseError
|
||||
import Configuration
|
||||
|
||||
import gettext
|
||||
gettext.install('fpdb')
|
||||
|
||||
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 pygtk
|
||||
import gtk
|
||||
|
@ -123,7 +131,7 @@ Otherwise, finish at EOF.
|
|||
|
||||
starttime = time.time()
|
||||
if not self.sanityCheck():
|
||||
log.warning("Failed sanity check")
|
||||
log.warning(_("Failed sanity check"))
|
||||
return
|
||||
|
||||
try:
|
||||
|
@ -131,14 +139,14 @@ Otherwise, finish at EOF.
|
|||
self.numErrors = 0
|
||||
if self.follow:
|
||||
#TODO: See how summary files can be handled on the fly (here they should be rejected as before)
|
||||
log.info("Tailing '%s'" % self.in_path)
|
||||
log.info(_("Tailing '%s'") % self.in_path)
|
||||
for handText in self.tailHands():
|
||||
try:
|
||||
self.processHand(handText)
|
||||
self.numHands += 1
|
||||
except FpdbParseError, e:
|
||||
self.numErrors += 1
|
||||
log.warning("HHC.start(follow): processHand failed: Exception msg: '%s'" % e)
|
||||
log.warning(_("HHC.start(follow): processHand failed: Exception msg: '%s'") % e)
|
||||
log.debug(handText)
|
||||
else:
|
||||
handsList = self.allHandsAsList()
|
||||
|
@ -152,22 +160,22 @@ Otherwise, finish at EOF.
|
|||
self.processedHands.append(self.processHand(handText))
|
||||
except FpdbParseError, e:
|
||||
self.numErrors += 1
|
||||
log.warning("HHC.start(): processHand failed: Exception msg: '%s'" % e)
|
||||
log.warning(_("HHC.start(): processHand failed: Exception msg: '%s'") % e)
|
||||
log.debug(handText)
|
||||
self.numHands = len(handsList)
|
||||
endtime = time.time()
|
||||
log.info("Read %d hands (%d failed) in %.3f seconds" % (self.numHands, self.numErrors, endtime - starttime))
|
||||
log.info(_("Read %d hands (%d failed) in %.3f seconds") % (self.numHands, self.numErrors, endtime - starttime))
|
||||
else:
|
||||
self.parsedObjectType = "Summary"
|
||||
summaryParsingStatus = self.readSummaryInfo(handsList)
|
||||
endtime = time.time()
|
||||
if summaryParsingStatus :
|
||||
log.info("Summary file '%s' correctly parsed (took %.3f seconds)" % (self.in_path, endtime - starttime))
|
||||
log.info(_("Summary file '%s' correctly parsed (took %.3f seconds)") % (self.in_path, endtime - starttime))
|
||||
else :
|
||||
log.warning("Error converting summary file '%s' (took %.3f seconds)" % (self.in_path, endtime - starttime))
|
||||
log.warning(_("Error converting summary file '%s' (took %.3f seconds)") % (self.in_path, endtime - starttime))
|
||||
|
||||
except IOError, ioe:
|
||||
log.exception("Error converting '%s'" % self.in_path)
|
||||
log.exception(_("Error converting '%s'") % self.in_path)
|
||||
finally:
|
||||
if self.out_fh != sys.stdout:
|
||||
self.out_fh.close()
|
||||
|
@ -198,7 +206,7 @@ which it expects to find at self.re_TailSplitHands -- see for e.g. Everleaf.py.
|
|||
time.sleep(interval)
|
||||
fd.seek(where)
|
||||
else:
|
||||
log.debug("%s changed inode numbers from %d to %d" % (self.in_path, fd_results[1], st_results[1]))
|
||||
log.debug(_("%s changed inode numbers from %d to %d") % (self.in_path, fd_results[1], st_results[1]))
|
||||
fd = codecs.open(self.in_path, 'r', self.codepage)
|
||||
fd.seek(where)
|
||||
else:
|
||||
|
@ -243,17 +251,17 @@ which it expects to find at self.re_TailSplitHands -- see for e.g. Everleaf.py.
|
|||
self.obs = self.obs.strip()
|
||||
self.obs = self.obs.replace('\r\n', '\n')
|
||||
if self.starsArchive == True:
|
||||
log.debug("Converting starsArchive format to readable")
|
||||
log.debug(_("Converting starsArchive format to readable"))
|
||||
m = re.compile('^Hand #\d+', re.MULTILINE)
|
||||
self.obs = m.sub('', self.obs)
|
||||
|
||||
if self.ftpArchive == True:
|
||||
log.debug("Converting ftpArchive format to readable")
|
||||
log.debug(_("Converting ftpArchive format to readable"))
|
||||
m = re.compile('^\*\*\*\*\*\*+\s#\s\d+\s\*\*\*\*\*+$', re.MULTILINE)
|
||||
self.obs = m.sub('', self.obs)
|
||||
|
||||
if self.obs is None or self.obs == "":
|
||||
log.info("Read no hands.")
|
||||
log.info(_("Read no hands."))
|
||||
return []
|
||||
return re.split(self.re_SplitHands, self.obs)
|
||||
|
||||
|
@ -264,8 +272,8 @@ which it expects to find at self.re_TailSplitHands -- see for e.g. Everleaf.py.
|
|||
l = None
|
||||
if gametype is None:
|
||||
gametype = "unmatched"
|
||||
# TODO: not ideal, just trying to not error.
|
||||
# TODO: Need to count failed hands.
|
||||
# TODO: not ideal, just trying to not error. Throw ParseException?
|
||||
self.numErrors += 1
|
||||
else:
|
||||
# See if gametype is supported.
|
||||
type = gametype['type']
|
||||
|
@ -281,13 +289,13 @@ 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.info("Unsupported game type: %s" % gametype)
|
||||
log.info(_("Unsupported game type: %s" % gametype))
|
||||
|
||||
if hand:
|
||||
#hand.writeHand(self.out_fh)
|
||||
return hand
|
||||
else:
|
||||
log.info("Unsupported game type: %s" % gametype)
|
||||
log.info(_("Unsupported game type: %s" % gametype))
|
||||
# TODO: pity we don't know the HID at this stage. Log the entire hand?
|
||||
# From the log we can deduce that it is the hand after the one before :)
|
||||
|
||||
|
@ -318,33 +326,104 @@ which it expects to find at self.re_TailSplitHands -- see for e.g. Everleaf.py.
|
|||
or None if we fail to get the info """
|
||||
#TODO: which parts are optional/required?
|
||||
|
||||
# Read any of:
|
||||
# HID HandID
|
||||
# TABLE Table name
|
||||
# SB small blind
|
||||
# BB big blind
|
||||
# GAMETYPE gametype
|
||||
# YEAR MON DAY HR MIN SEC datetime
|
||||
# BUTTON button seat number
|
||||
def readHandInfo(self, hand): abstract
|
||||
"""Read and set information about the hand being dealt, and set the correct
|
||||
variables in the Hand object 'hand
|
||||
|
||||
* hand.startTime - a datetime object
|
||||
* hand.handid - The site identified for the hand - a string.
|
||||
* hand.tablename
|
||||
* hand.buttonpos
|
||||
* hand.maxseats
|
||||
* hand.mixed
|
||||
|
||||
Tournament fields:
|
||||
|
||||
* hand.tourNo - The site identified tournament id as appropriate - a string.
|
||||
* hand.buyin
|
||||
* hand.fee
|
||||
* hand.buyinCurrency
|
||||
* hand.koBounty
|
||||
* hand.isKO
|
||||
* hand.level
|
||||
"""
|
||||
#TODO: which parts are optional/required?
|
||||
|
||||
# Needs to return a list of lists in the format
|
||||
# [['seat#', 'player1name', 'stacksize'] ['seat#', 'player2name', 'stacksize'] [...]]
|
||||
def readPlayerStacks(self, hand): abstract
|
||||
"""This function is for identifying players at the table, and to pass the
|
||||
information on to 'hand' via Hand.addPlayer(seat, name, chips)
|
||||
|
||||
At the time of writing the reference function in the PS converter is:
|
||||
log.debug("readPlayerStacks")
|
||||
m = self.re_PlayerInfo.finditer(hand.handText)
|
||||
for a in m:
|
||||
hand.addPlayer(int(a.group('SEAT')), a.group('PNAME'), a.group('CASH'))
|
||||
|
||||
Which is pretty simple because the hand history format is consistent. Other hh formats aren't so nice.
|
||||
|
||||
This is the appropriate place to identify players that are sitting out and ignore them
|
||||
|
||||
*** NOTE: You may find this is a more appropriate place to set hand.maxseats ***
|
||||
"""
|
||||
|
||||
def compilePlayerRegexs(self): abstract
|
||||
"""Compile dynamic regexes -- these explicitly match known player names and must be updated if a new player joins"""
|
||||
"""Compile dynamic regexes -- compile player dependent regexes.
|
||||
|
||||
Depending on the ambiguity of lines you may need to match, and the complexity of
|
||||
player names - we found that we needed to recompile some regexes for player actions so that they actually contained the player names.
|
||||
|
||||
eg.
|
||||
We need to match the ante line:
|
||||
<Player> antes $1.00
|
||||
|
||||
But <Player> is actually named
|
||||
|
||||
YesI antes $4000 - A perfectly legal playername
|
||||
|
||||
Giving:
|
||||
|
||||
YesI antes $4000 antes $1.00
|
||||
|
||||
Which without care in your regexes most people would match 'YesI' and not 'YesI antes $4000'
|
||||
"""
|
||||
|
||||
# Needs to return a MatchObject with group names identifying the streets into the Hand object
|
||||
# so groups are called by street names 'PREFLOP', 'FLOP', 'STREET2' etc
|
||||
# blinds are done seperately
|
||||
def markStreets(self, hand): abstract
|
||||
"""For dividing the handText into sections.
|
||||
|
||||
The function requires you to pass a MatchObject with groups specifically labeled with
|
||||
the 'correct' street names.
|
||||
|
||||
The Hand object will use the various matches for assigning actions to the correct streets.
|
||||
|
||||
Flop Based Games:
|
||||
PREFLOP, FLOP, TURN, RIVER
|
||||
|
||||
Draw Based Games:
|
||||
PREDEAL, DEAL, DRAWONE, DRAWTWO, DRAWTHREE
|
||||
|
||||
Stud Based Games:
|
||||
ANTES, THIRD, FOURTH, FIFTH, SIXTH, SEVENTH
|
||||
|
||||
The Stars HHC has a good reference implementation
|
||||
"""
|
||||
|
||||
#Needs to return a list in the format
|
||||
# ['player1name', 'player2name', ...] where player1name is the sb and player2name is bb,
|
||||
# addtional players are assumed to post a bb oop
|
||||
def readBlinds(self, hand): abstract
|
||||
"""Function for reading the various blinds from the hand history.
|
||||
|
||||
Pass any small blind to hand.addBlind(<name>, "small blind", <value>)
|
||||
- unless it is a single dead small blind then use:
|
||||
hand.addBlind(<name>, 'secondsb', <value>)
|
||||
Pass any big blind to hand.addBlind(<name>, "big blind", <value>)
|
||||
Pass any play posting both big and small blinds to hand.addBlind(<name>, 'both', <vale>)
|
||||
"""
|
||||
def readAntes(self, hand): abstract
|
||||
"""Function for reading the antes from the hand history and passing the hand.addAnte"""
|
||||
def readBringIn(self, hand): abstract
|
||||
def readButton(self, hand): abstract
|
||||
def readHeroCards(self, hand): abstract
|
||||
|
@ -390,7 +469,7 @@ or None if we fail to get the info """
|
|||
sane = True
|
||||
|
||||
if self.in_path != '-' and self.out_path == self.in_path:
|
||||
print "HH Sanity Check: output and input files are the same, check config"
|
||||
print _("HH Sanity Check: output and input files are the same, check config")
|
||||
sane = False
|
||||
|
||||
|
||||
|
@ -401,18 +480,6 @@ or None if we fail to get the info """
|
|||
self.filetype = filetype
|
||||
self.codepage = codepage
|
||||
|
||||
#This function doesn't appear to be used
|
||||
def splitFileIntoHands(self):
|
||||
hands = []
|
||||
self.obs = self.obs.strip()
|
||||
list = self.re_SplitHands.split(self.obs)
|
||||
list.pop() #Last entry is empty
|
||||
for l in list:
|
||||
# print "'" + l + "'"
|
||||
hands = hands + [Hand.Hand(self.config, self.sitename, self.gametype, l)]
|
||||
# TODO: This looks like it could be replaced with a list comp.. ?
|
||||
return hands
|
||||
|
||||
def __listof(self, x):
|
||||
if isinstance(x, list) or isinstance(x, tuple):
|
||||
return x
|
||||
|
@ -425,7 +492,7 @@ or None if we fail to get the info """
|
|||
if self.filetype == "text":
|
||||
if self.in_path == '-':
|
||||
# read from stdin
|
||||
log.debug("Reading stdin with %s" % self.codepage) # is this necessary? or possible? or what?
|
||||
log.debug(_("Reading stdin with %s") % self.codepage) # is this necessary? or possible? or what?
|
||||
in_fh = codecs.getreader('cp1252')(sys.stdin)
|
||||
else:
|
||||
for kodec in self.__listof(self.codepage):
|
||||
|
@ -433,14 +500,15 @@ or None if we fail to get the info """
|
|||
try:
|
||||
in_fh = codecs.open(self.in_path, 'r', kodec)
|
||||
whole_file = in_fh.read()
|
||||
in_fh.close()
|
||||
self.obs = whole_file[self.index:]
|
||||
self.index = len(whole_file)
|
||||
in_fh.close()
|
||||
break
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
print "unable to read file with any codec in list!", self.in_path
|
||||
print _("unable to read file with any codec in list!"), self.in_path
|
||||
self.obs = ""
|
||||
elif self.filetype == "xml":
|
||||
doc = xml.dom.minidom.parse(filename)
|
||||
self.doc = doc
|
||||
|
@ -593,13 +661,13 @@ def get_out_fh(out_path, parameters):
|
|||
try:
|
||||
os.makedirs(out_dir)
|
||||
except: # we get a WindowsError here in Windows.. pretty sure something else for Linux :D
|
||||
log.error("Unable to create output directory %s for HHC!" % out_dir)
|
||||
print "*** ERROR: UNABLE TO CREATE OUTPUT DIRECTORY", out_dir
|
||||
log.error(_("Unable to create output directory %s for HHC!") % out_dir)
|
||||
print _("*** ERROR: UNABLE TO CREATE OUTPUT DIRECTORY"), out_dir
|
||||
else:
|
||||
log.info("Created directory '%s'" % out_dir)
|
||||
log.info(_("Created directory '%s'") % out_dir)
|
||||
try:
|
||||
return(codecs.open(out_path, 'w', 'utf8'))
|
||||
except:
|
||||
log.error("out_path %s couldn't be opened" % (out_path))
|
||||
log.error(_("out_path %s couldn't be opened") % (out_path))
|
||||
else:
|
||||
return(sys.stdout)
|
||||
|
|
|
@ -41,10 +41,10 @@ from Mucked import Aux_Seats
|
|||
class Hello(Aux_Window):
|
||||
"""A 'Hello World' Aux_Window demo."""
|
||||
def create(self):
|
||||
print "creating Hello"
|
||||
print _("creating Hello")
|
||||
# This demo simply creates a label in a window.
|
||||
self.container = gtk.Window()
|
||||
self.container.add(gtk.Label("Hello World"))
|
||||
self.container.add(gtk.Label(_("Hello World")))
|
||||
# and shows it. There is no functionality.
|
||||
self.container.show_all()
|
||||
|
||||
|
@ -62,7 +62,7 @@ class Hello_plus(Aux_Window):
|
|||
|
||||
# get the site we are playing from the HUD
|
||||
self.site = hud.site
|
||||
print "site =", hud.site # print it to the terminal, to make sure
|
||||
print _("site ="), hud.site # print it to the terminal, to make sure
|
||||
|
||||
# now get our screen name for that site from the configuration
|
||||
# wrap it in a try/except in case screen name isn't set up in the config file
|
||||
|
@ -70,7 +70,7 @@ class Hello_plus(Aux_Window):
|
|||
site_params = self.config.get_site_parameters(self.hud.site)
|
||||
self.hero = site_params['screen_name']
|
||||
except:
|
||||
self.hero = 'YOUR NAME HERE'
|
||||
self.hero = _('YOUR NAME HERE')
|
||||
print "hero =", self.hero
|
||||
|
||||
|
||||
|
@ -101,7 +101,7 @@ class Hello_plus(Aux_Window):
|
|||
|
||||
# Here, we just update the label in our aux_window from the number of
|
||||
# hands played that was updated in the "update_data()" function.
|
||||
self.label.set_text("Hello %s\nYou have played %d hands\n on %s." % (self.hero, self.hands_played, self.site))
|
||||
self.label.set_text(_("Hello %s\nYou have played %d hands\n on %s.") % (self.hero, self.hands_played, self.site))
|
||||
|
||||
class Hello_Seats(Aux_Seats):
|
||||
"""A 'Hello World' Seat_Window demo."""
|
||||
|
|
172
pyfpdb/Hud.py
172
pyfpdb/Hud.py
|
@ -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)
|
||||
|
@ -470,6 +482,9 @@ class Hud:
|
|||
for aux in self.aux_windows:
|
||||
aux.update_card_positions()
|
||||
|
||||
self.reposition_windows()
|
||||
# call reposition_windows, which apparently moves even hidden windows, where this function does not, even though they do the same thing, afaict
|
||||
|
||||
return True
|
||||
|
||||
def on_button_press(self, widget, event):
|
||||
|
@ -510,7 +525,10 @@ class Hud:
|
|||
def debug_stat_windows(self, *args):
|
||||
# print self.table, "\n", self.main_window.window.get_transient_for()
|
||||
for w in self.stat_windows:
|
||||
print self.stat_windows[w].window.window.get_transient_for()
|
||||
try:
|
||||
print self.stat_windows[w].window.window.get_transient_for()
|
||||
except AttributeError:
|
||||
print "this window doesnt have get_transient_for"
|
||||
|
||||
def save_layout(self, *args):
|
||||
new_layout = [(0, 0)] * self.max
|
||||
|
@ -522,7 +540,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):
|
||||
|
@ -531,7 +549,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:
|
||||
|
@ -545,15 +563,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"
|
||||
|
@ -569,7 +587,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:
|
||||
|
@ -618,8 +636,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']
|
||||
|
@ -926,7 +944,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()
|
||||
|
||||
|
@ -934,7 +952,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)
|
||||
|
|
|
@ -22,6 +22,18 @@
|
|||
from imaplib import IMAP4, IMAP4_SSL
|
||||
import PokerStarsSummary
|
||||
|
||||
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
|
||||
|
||||
def splitPokerStarsSummaries(emailText):
|
||||
splitSummaries=emailText.split("\nPokerStars Tournament #")[1:]
|
||||
for i in range(len(splitSummaries)):
|
||||
|
@ -33,16 +45,16 @@ def run(config, db):
|
|||
#print "start of IS.run"
|
||||
server=None
|
||||
#try:
|
||||
#print "useSSL",config.email.useSsl,"host",config.email.host
|
||||
if config.email.useSsl:
|
||||
server = IMAP4_SSL(config.email.host)
|
||||
#print "useSSL",config.useSsl,"host",config.host
|
||||
if config.useSsl:
|
||||
server = IMAP4_SSL(config.host)
|
||||
else:
|
||||
server = IMAP4(config.email.host)
|
||||
response = server.login(config.email.username, config.email.password) #TODO catch authentication error
|
||||
print "response to logging in:",response
|
||||
server = IMAP4(config.host)
|
||||
response = server.login(config.username, config.password) #TODO catch authentication error
|
||||
print _("response to logging in:"),response
|
||||
#print "server.list():",server.list() #prints list of folders
|
||||
|
||||
response = server.select(config.email.folder)
|
||||
response = server.select(config.folder)
|
||||
#print "response to selecting INBOX:",response
|
||||
if response[0]!="OK":
|
||||
raise error #TODO: show error message
|
||||
|
@ -54,8 +66,7 @@ def run(config, db):
|
|||
#print "response to fetch subject:",response
|
||||
if response!="OK":
|
||||
raise error #TODO: show error message
|
||||
if headerData[1].find("Subject: PokerStars Tournament History Request - Last x")!=1:
|
||||
neededMessages.append(("PS", messageNumber))
|
||||
neededMessages.append(("PS", messageNumber))
|
||||
|
||||
if (len(neededMessages)==0):
|
||||
raise error #TODO: show error message
|
||||
|
@ -71,7 +82,7 @@ def run(config, db):
|
|||
#print "finished importing a PS summary with result:",result
|
||||
#TODO: count results and output to shell like hand importer does
|
||||
|
||||
print "completed running Imap import, closing server connection"
|
||||
print _("completed running Imap import, closing server connection")
|
||||
#finally:
|
||||
# try:
|
||||
server.close()
|
||||
|
|
|
@ -324,7 +324,7 @@ class Stud_cards:
|
|||
for k in self.parent.hud.stat_dict.keys():
|
||||
if self.parent.hud.stat_dict[k]['seat'] == seat_no:
|
||||
return self.parent.hud.stat_dict[k]['screen_name']
|
||||
return "No Name"
|
||||
return _("No Name")
|
||||
|
||||
def clear(self):
|
||||
for r in range(0, self.rows):
|
||||
|
|
|
@ -21,130 +21,179 @@
|
|||
import sys
|
||||
import Configuration
|
||||
from HandHistoryConverter import *
|
||||
from decimal import Decimal
|
||||
|
||||
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
|
||||
|
||||
# OnGame HH Format
|
||||
|
||||
#Texas Hold'em $.5-$1 NL (real money), hand #P4-76915775-797
|
||||
#Table Kuopio, 20 Sep 2008 11:59 PM
|
||||
|
||||
#Seat 1: .Lucchess ($4.17 in chips)
|
||||
#Seat 3: Gloff1 ($108 in chips)
|
||||
#Seat 4: far a ($13.54 in chips)
|
||||
#Seat 5: helander2222 ($49.77 in chips)
|
||||
#Seat 6: lopllopl ($62.06 in chips)
|
||||
#Seat 7: crazyhorse6 ($101.91 in chips)
|
||||
#Seat 8: peeci ($25.02 in chips)
|
||||
#Seat 9: Manuelhertz ($49 in chips)
|
||||
#Seat 10: Eurolll ($58.25 in chips)
|
||||
#ANTES/BLINDS
|
||||
#helander2222 posts blind ($0.25), lopllopl posts blind ($0.50).
|
||||
|
||||
#PRE-FLOP
|
||||
#crazyhorse6 folds, peeci folds, Manuelhertz folds, Eurolll calls $0.50, .Lucchess calls $0.50, Gloff1 folds, far a folds, helander2222 folds, lopllopl checks.
|
||||
|
||||
#FLOP [board cards AH,8H,KH ]
|
||||
#lopllopl checks, Eurolll checks, .Lucchess checks.
|
||||
|
||||
#TURN [board cards AH,8H,KH,6S ]
|
||||
#lopllopl checks, Eurolll checks, .Lucchess checks.
|
||||
|
||||
#RIVER [board cards AH,8H,KH,6S,8S ]
|
||||
#lopllopl checks, Eurolll bets $1.25, .Lucchess folds, lopllopl folds.
|
||||
|
||||
#SHOWDOWN
|
||||
#Eurolll wins $2.92.
|
||||
|
||||
#SUMMARY
|
||||
#Dealer: far a
|
||||
#Pot: $3, (including rake: $0.08)
|
||||
#.Lucchess, loses $0.50
|
||||
#Gloff1, loses $0
|
||||
#far a, loses $0
|
||||
#helander2222, loses $0.25
|
||||
#lopllopl, loses $0.50
|
||||
#crazyhorse6, loses $0
|
||||
#peeci, loses $0
|
||||
#Manuelhertz, loses $0
|
||||
#Eurolll, bets $1.75, collects $2.92, net $1.17
|
||||
|
||||
|
||||
class OnGame(HandHistoryConverter):
|
||||
def __init__(self, config, file):
|
||||
print "Initialising OnGame converter class"
|
||||
HandHistoryConverter.__init__(self, config, file, sitename="OnGame") # Call super class init.
|
||||
self.sitename = "OnGame"
|
||||
self.setFileType("text", "cp1252")
|
||||
self.siteId = 5 # Needs to match id entry in Sites database
|
||||
sitename = "OnGame"
|
||||
filetype = "text"
|
||||
codepage = ("utf8", "cp1252")
|
||||
siteId = 5 # Needs to match id entry in Sites database
|
||||
|
||||
substitutions = {
|
||||
'LEGAL_ISO' : "USD|EUR|GBP|CAD|FPP", # legal ISO currency codes
|
||||
'LS' : "\$|\xe2\x82\xac|" # legal currency symbols - Euro(cp1252, utf-8)
|
||||
}
|
||||
|
||||
limits = { 'NO_LIMIT':'nl', 'LIMIT':'fl'}
|
||||
|
||||
games = { # base, category
|
||||
"TEXAS_HOLDEM" : ('hold','holdem'),
|
||||
# 'Omaha' : ('hold','omahahi'),
|
||||
# 'Omaha Hi/Lo' : ('hold','omahahilo'),
|
||||
# 'Razz' : ('stud','razz'),
|
||||
# 'RAZZ' : ('stud','razz'),
|
||||
# '7 Card Stud' : ('stud','studhi'),
|
||||
# '7 Card Stud Hi/Lo' : ('stud','studhilo'),
|
||||
# 'Badugi' : ('draw','badugi'),
|
||||
# 'Triple Draw 2-7 Lowball' : ('draw','27_3draw'),
|
||||
# '5 Card Draw' : ('draw','fivedraw')
|
||||
}
|
||||
|
||||
#self.rexx.setGameInfoRegex('.*Blinds \$?(?P<SB>[.0-9]+)/\$?(?P<BB>[.0-9]+)')
|
||||
self.rexx.setSplitHandRegex('\n\n\n+')
|
||||
# Static regexes
|
||||
re_SplitHands = re.compile(r'End of hand .{2}-\d{7,9}-\d+ \*\*\*\*\*\n')
|
||||
|
||||
#Texas Hold'em $.5-$1 NL (real money), hand #P4-76915775-797
|
||||
#Table Kuopio, 20 Sep 2008 11:59 PM
|
||||
self.rexx.setHandInfoRegex(r"Texas Hold'em \$?(?P<SB>[.0-9]+)-\$?(?P<BB>[.0-9]+) NL \(real money\), hand #(?P<HID>[-A-Z\d]+)\nTable\ (?P<TABLE>[\' \w]+), (?P<DATETIME>\d\d \w+ \d\d\d\d \d\d:\d\d (AM|PM))")
|
||||
# SB BB HID TABLE DAY MON YEAR HR12 MIN AMPM
|
||||
# ***** History for hand R5-75443872-57 *****
|
||||
# Start hand: Wed Aug 18 19:29:10 GMT+0100 2010
|
||||
# Table: someplace [75443872] (LIMIT TEXAS_HOLDEM 0.50/1, Real money)
|
||||
re_HandInfo = re.compile(u"""
|
||||
\*\*\*\*\*\sHistory\sfor\shand\s(?P<HID>[-A-Z\d]+).*
|
||||
Start\shand:\s(?P<DATETIME>.*)
|
||||
Table:\s(?P<TABLE>[\'\w]+)\s\[\d+\]\s\(
|
||||
(
|
||||
(?P<LIMIT>No\sLimit|Limit|LIMIT|Pot\sLimit)\s
|
||||
(?P<GAME>TEXAS_HOLDEM|RAZZ)\s
|
||||
(?P<SB>[.0-9]+)/
|
||||
(?P<BB>[.0-9]+)
|
||||
)?
|
||||
""" % substitutions, re.MULTILINE|re.DOTALL|re.VERBOSE)
|
||||
|
||||
self.rexx.button_re = re.compile('#SUMMARY\nDealer: (?P<BUTTONPNAME>.*)\n')
|
||||
# Wed Aug 18 19:45:30 GMT+0100 2010
|
||||
re_DateTime = re.compile("""
|
||||
[a-zA-Z]{3}\s
|
||||
(?P<M>[a-zA-Z]{3})\s
|
||||
(?P<D>[0-9]{2})\s
|
||||
(?P<H>[0-9]+):(?P<MIN>[0-9]+):(?P<S>[0-9]+)\sGMT
|
||||
(?P<OFFSET>[-+]\d+)\s
|
||||
(?P<Y>[0-9]{4})
|
||||
""", re.MULTILINE|re.VERBOSE)
|
||||
|
||||
#Seat 1: .Lucchess ($4.17 in chips)
|
||||
self.rexx.setPlayerInfoRegex('Seat (?P<SEAT>[0-9]+): (?P<PNAME>.*) \((\$(?P<CASH>[.0-9]+) in chips)\)')
|
||||
# self.rexx.button_re = re.compile('#SUMMARY\nDealer: (?P<BUTTONPNAME>.*)\n')
|
||||
|
||||
#ANTES/BLINDS
|
||||
#helander2222 posts blind ($0.25), lopllopl posts blind ($0.50).
|
||||
self.rexx.setPostSbRegex('(?P<PNAME>.*) posts blind \(\$?(?P<SB>[.0-9]+)\), ')
|
||||
self.rexx.setPostBbRegex('\), (?P<PNAME>.*) posts blind \(\$?(?P<BB>[.0-9]+)\).')
|
||||
self.rexx.setPostBothRegex('.*\n(?P<PNAME>.*): posts small \& big blinds \[\$? (?P<SBBB>[.0-9]+)')
|
||||
self.rexx.setHeroCardsRegex('.*\nDealt\sto\s(?P<PNAME>.*)\s\[ (?P<CARDS>.*) \]')
|
||||
#Seat 1: .Lucchess ($4.17 in chips)
|
||||
re_PlayerInfo = re.compile(u'Seat (?P<SEAT>[0-9]+): (?P<PNAME>.*) \((?P<CASH>[.0-9]+) \)')
|
||||
|
||||
#lopllopl checks, Eurolll checks, .Lucchess checks.
|
||||
self.rexx.setActionStepRegex('(, )?(?P<PNAME>.*?)(?P<ATYPE> bets| checks| raises| calls| folds)( \$(?P<BET>\d*\.?\d*))?( and is all-in)?')
|
||||
def compilePlayerRegexs(self, hand):
|
||||
players = set([player[1] for player in hand.players])
|
||||
if not players <= self.compiledPlayers: # x <= y means 'x is subset of y'
|
||||
# we need to recompile the player regexs.
|
||||
# TODO: should probably rename re_HeroCards and corresponding method,
|
||||
# since they are used to find all cards on lines starting with "Dealt to:"
|
||||
# They still identify the hero.
|
||||
|
||||
#Uchilka shows [ KC,JD ]
|
||||
self.rexx.setShowdownActionRegex('(?P<PNAME>.*) shows \[ (?P<CARDS>.+) \]')
|
||||
#ANTES/BLINDS
|
||||
#helander2222 posts blind ($0.25), lopllopl posts blind ($0.50).
|
||||
player_re = "(?P<PNAME>" + "|".join(map(re.escape, players)) + ")"
|
||||
subst = {'PLYR': player_re, 'CUR': self.sym[hand.gametype['currency']]}
|
||||
re_PostSB = re.compile('(?P<PNAME>.*) posts blind \(\$?(?P<SB>[.0-9]+)\), ')
|
||||
re_PostBB = re.compile('\), (?P<PNAME>.*) posts blind \(\$?(?P<BB>[.0-9]+)\).')
|
||||
re_Antes = re.compile(r"^%(PLYR)s: posts the ante %(CUR)s(?P<ANTE>[.0-9]+)" % subst, re.MULTILINE)
|
||||
re_BringIn = re.compile(r"^%(PLYR)s: brings[- ]in( low|) for %(CUR)s(?P<BRINGIN>[.0-9]+)" % subst, re.MULTILINE)
|
||||
re_PostBoth = re.compile('.*\n(?P<PNAME>.*): posts small \& big blinds \[\$? (?P<SBBB>[.0-9]+)')
|
||||
re_HeroCards = re.compile('.*\nDealt\sto\s(?P<PNAME>.*)\s\[ (?P<CARDS>.*) \]')
|
||||
|
||||
# TODO: read SUMMARY correctly for collected pot stuff.
|
||||
#Uchilka, bets $11.75, collects $23.04, net $11.29
|
||||
self.rexx.setCollectPotRegex('(?P<PNAME>.*), bets.+, collects \$(?P<POT>\d*\.?\d*), net.* ')
|
||||
self.rexx.sits_out_re = re.compile('(?P<PNAME>.*) sits out')
|
||||
self.rexx.compileRegexes()
|
||||
#lopllopl checks, Eurolll checks, .Lucchess checks.
|
||||
re_Action = re.compile('(, )?(?P<PNAME>.*?)(?P<ATYPE> bets| checks| raises| calls| folds)( \$(?P<BET>\d*\.?\d*))?( and is all-in)?')
|
||||
re_Board = re.compile(r"\[board cards (?P<CARDS>.+) \]")
|
||||
|
||||
#Uchilka shows [ KC,JD ]
|
||||
re_ShowdownAction = re.compile('(?P<PNAME>.*) shows \[ (?P<CARDS>.+) \]')
|
||||
|
||||
# TODO: read SUMMARY correctly for collected pot stuff.
|
||||
#Uchilka, bets $11.75, collects $23.04, net $11.29
|
||||
re_CollectPot = re.compile('(?P<PNAME>.*), bets.+, collects \$(?P<POT>\d*\.?\d*), net.* ')
|
||||
re_sitsOut = re.compile('(?P<PNAME>.*) sits out')
|
||||
|
||||
def readSupportedGames(self):
|
||||
pass
|
||||
return [
|
||||
["ring", "hold", "fl"],
|
||||
["ring", "hold", "nl"],
|
||||
]
|
||||
|
||||
def determineGameType(self):
|
||||
# Cheating with this regex, only support nlhe at the moment
|
||||
gametype = ["ring", "hold", "nl"]
|
||||
def determineGameType(self, handText):
|
||||
# Inspect the handText and return the gametype dict
|
||||
# gametype dict is: {'limitType': xxx, 'base': xxx, 'category': xxx}
|
||||
info = {}
|
||||
|
||||
m = self.rexx.hand_info_re.search(self.obs)
|
||||
gametype = gametype + [m.group('SB')]
|
||||
gametype = gametype + [m.group('BB')]
|
||||
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(_("determineGameType: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
|
||||
return gametype
|
||||
mg = m.groupdict()
|
||||
|
||||
info['type'] = 'ring'
|
||||
info['currency'] = 'USD'
|
||||
|
||||
if 'LIMIT' in mg:
|
||||
info['limitType'] = self.limits[mg['LIMIT']]
|
||||
if 'GAME' in mg:
|
||||
(info['base'], info['category']) = self.games[mg['GAME']]
|
||||
if 'SB' in mg:
|
||||
info['sb'] = mg['SB']
|
||||
if 'BB' in mg:
|
||||
info['bb'] = mg['BB']
|
||||
|
||||
return info
|
||||
|
||||
def readHandInfo(self, hand):
|
||||
m = self.rexx.hand_info_re.search(hand.string)
|
||||
hand.handid = m.group('HID')
|
||||
hand.tablename = m.group('TABLE')
|
||||
#hand.buttonpos = self.rexx.button_re.search(hand.string).group('BUTTONPNAME')
|
||||
# These work, but the info is already in the Hand class - should be used for tourneys though.
|
||||
# m.group('SB')
|
||||
# m.group('BB')
|
||||
# m.group('GAMETYPE')
|
||||
info = {}
|
||||
m = self.re_HandInfo.search(hand.handText)
|
||||
|
||||
# Believe Everleaf time is GMT/UTC, no transation necessary
|
||||
# Stars format (Nov 10 2008): 2008/11/07 12:38:49 CET [2008/11/07 7:38:49 ET]
|
||||
# or : 2008/11/07 12:38:49 ET
|
||||
# Not getting it in my HH files yet, so using
|
||||
# 2008/11/10 3:58:52 ET
|
||||
#TODO: Do conversion from GMT to ET
|
||||
#TODO: Need some date functions to convert to different timezones (Date::Manip for perl rocked for this)
|
||||
if m:
|
||||
info.update(m.groupdict())
|
||||
|
||||
hand.startTime = time.strptime(m.group('DATETIME'), "%d %b %Y %I:%M %p")
|
||||
#hand.starttime = "%d/%02d/%02d %d:%02d:%02d ET" %(int(m.group('YEAR')), int(m.group('MON')), int(m.group('DAY')),
|
||||
#int(m.group('HR')), int(m.group('MIN')), int(m.group('SEC')))
|
||||
log.debug("readHandInfo: %s" % info)
|
||||
for key in info:
|
||||
if key == 'DATETIME':
|
||||
#'Wed Aug 18 19:45:30 GMT+0100 2010
|
||||
# %a %b %d %H:%M:%S %z %Y
|
||||
#hand.startTime = time.strptime(m.group('DATETIME'), "%a %b %d %H:%M:%S GMT%z %Y")
|
||||
# Stupid library doesn't seem to support %z (http://docs.python.org/library/time.html?highlight=strptime#time.strptime)
|
||||
# So we need to re-interpret te string to be useful
|
||||
m1 = self.re_DateTime.finditer(info[key])
|
||||
for a in m1:
|
||||
datetimestr = "%s %s %s %s:%s:%s" % (a.group('M'),a.group('D'), a.group('Y'), a.group('H'),a.group('MIN'),a.group('S'))
|
||||
hand.startTime = time.strptime(datetimestr, "%b %d %Y %H:%M:%S")
|
||||
# TODO: Manually adjust time against OFFSET
|
||||
if key == 'HID':
|
||||
hand.handid = info[key]
|
||||
if key == 'TABLE':
|
||||
hand.tablename = info[key]
|
||||
|
||||
# TODO: These
|
||||
hand.buttonpos = 1
|
||||
hand.maxseats = 10
|
||||
hand.mixed = None
|
||||
|
||||
def readPlayerStacks(self, hand):
|
||||
m = self.rexx.player_info_re.finditer(hand.string)
|
||||
players = []
|
||||
m = self.re_PlayerInfo.finditer(hand.handText)
|
||||
for a in m:
|
||||
hand.addPlayer(int(a.group('SEAT')), a.group('PNAME'), a.group('CASH'))
|
||||
|
||||
|
@ -153,34 +202,60 @@ class OnGame(HandHistoryConverter):
|
|||
# This re fails if, say, river is missing; then we don't get the ** that starts the river.
|
||||
#m = re.search('(\*\* Dealing down cards \*\*\n)(?P<PREFLOP>.*?\n\*\*)?( Dealing Flop \*\* \[ (?P<FLOP1>\S\S), (?P<FLOP2>\S\S), (?P<FLOP3>\S\S) \])?(?P<FLOP>.*?\*\*)?( Dealing Turn \*\* \[ (?P<TURN1>\S\S) \])?(?P<TURN>.*?\*\*)?( Dealing River \*\* \[ (?P<RIVER1>\S\S) \])?(?P<RIVER>.*)', hand.string,re.DOTALL)
|
||||
|
||||
m = re.search(r"PRE-FLOP(?P<PREFLOP>.+(?=FLOP)|.+(?=SHOWDOWN))"
|
||||
r"(FLOP (?P<FLOP>\[board cards .+ \].+(?=TURN)|.+(?=SHOWDOWN)))?"
|
||||
r"(TURN (?P<TURN>\[board cards .+ \].+(?=RIVER)|.+(?=SHOWDOWN)))?"
|
||||
r"(RIVER (?P<RIVER>\[board cards .+ \].+(?=SHOWDOWN)))?", hand.string,re.DOTALL)
|
||||
#if hand.gametype['base'] in ("hold"):
|
||||
#elif hand.gametype['base'] in ("stud"):
|
||||
#elif hand.gametype['base'] in ("draw"):
|
||||
# only holdem so far:
|
||||
m = re.search(r"pocket cards(?P<PREFLOP>.+(?=flop)|.+(?=Summary))"
|
||||
r"(flop (?P<FLOP>\[\S\S, \S\S, \S\S\].+(?=turn)|.+(?=Summary)))?"
|
||||
r"(turn (?P<TURN>\[\S\S, \S\S, \S\S\, \S\S\].+(?=river)|.+(?=Summary)))?"
|
||||
r"(river (?P<RIVER>\[\S\S, \S\S, \S\S\, \S\S, \S\S\].+(?=Summary)))?", hand.handText, re.DOTALL)
|
||||
|
||||
hand.addStreets(m)
|
||||
|
||||
#Needs to return a list in the format
|
||||
# ['player1name', 'player2name', ...] where player1name is the sb and player2name is bb,
|
||||
# addtional players are assumed to post a bb oop
|
||||
|
||||
def readButton(self, hand):
|
||||
m = self.re_Button.search(hand.handText)
|
||||
if m:
|
||||
hand.buttonpos = int(m.group('BUTTON'))
|
||||
else:
|
||||
log.info(_('readButton: not found'))
|
||||
|
||||
def readCommunityCards(self, hand, street):
|
||||
self.rexx.board_re = re.compile(r"\[board cards (?P<CARDS>.+) \]")
|
||||
print hand.streets.group(street)
|
||||
if street in ('FLOP','TURN','RIVER'): # a list of streets which get dealt community cards (i.e. all but PREFLOP)
|
||||
m = self.rexx.board_re.search(hand.streets.group(street))
|
||||
m = self.re_Board.search(hand.streets.group(street))
|
||||
hand.setCommunityCards(street, m.group('CARDS').split(','))
|
||||
|
||||
def readBlinds(self, hand):
|
||||
try:
|
||||
m = self.rexx.small_blind_re.search(hand.string)
|
||||
m = self.re_PostSB.search(hand.handText)
|
||||
hand.addBlind(m.group('PNAME'), 'small blind', m.group('SB'))
|
||||
except: # no small blind
|
||||
hand.addBlind(None, None, None)
|
||||
for a in self.rexx.big_blind_re.finditer(hand.string):
|
||||
for a in self.re_PostBB.finditer(hand.handText):
|
||||
hand.addBlind(a.group('PNAME'), 'big blind', a.group('BB'))
|
||||
for a in self.rexx.both_blinds_re.finditer(hand.string):
|
||||
for a in self.re_PostBoth.finditer(hand.handText):
|
||||
hand.addBlind(a.group('PNAME'), 'small & big blinds', a.group('SBBB'))
|
||||
|
||||
def readAntes(self, hand):
|
||||
log.debug(_("reading antes"))
|
||||
m = self.re_Antes.finditer(hand.handText)
|
||||
for player in m:
|
||||
#~ logging.debug("hand.addAnte(%s,%s)" %(player.group('PNAME'), player.group('ANTE')))
|
||||
hand.addAnte(player.group('PNAME'), player.group('ANTE'))
|
||||
|
||||
def readBringIn(self, hand):
|
||||
m = self.re_BringIn.search(hand.handText,re.DOTALL)
|
||||
if m:
|
||||
#~ logging.debug("readBringIn: %s for %s" %(m.group('PNAME'), m.group('BRINGIN')))
|
||||
hand.addBringIn(m.group('PNAME'), m.group('BRINGIN'))
|
||||
|
||||
def readHeroCards(self, hand):
|
||||
m = self.rexx.hero_cards_re.search(hand.string)
|
||||
m = self.re_HeroCards.search(hand.handText)
|
||||
if(m == None):
|
||||
#Not involved in hand
|
||||
hand.involved = False
|
||||
|
@ -193,7 +268,7 @@ class OnGame(HandHistoryConverter):
|
|||
hand.addHoleCards(cards, m.group('PNAME'))
|
||||
|
||||
def readAction(self, hand, street):
|
||||
m = self.rexx.action_re.finditer(hand.streets.group(street))
|
||||
m = self.re_Action.finditer(hand.streets.group(street))
|
||||
for action in m:
|
||||
if action.group('ATYPE') == ' raises':
|
||||
hand.addRaiseTo( street, action.group('PNAME'), action.group('BET') )
|
||||
|
@ -211,13 +286,13 @@ class OnGame(HandHistoryConverter):
|
|||
# TODO: Everleaf does not record uncalled bets.
|
||||
|
||||
def readShowdownActions(self, hand):
|
||||
for shows in self.rexx.showdown_action_re.finditer(hand.string):
|
||||
for shows in self.re_ShowdownAction.finditer(hand.handText):
|
||||
cards = shows.group('CARDS')
|
||||
cards = set(cards.split(','))
|
||||
hand.addShownCards(cards, shows.group('PNAME'))
|
||||
|
||||
def readCollectPot(self,hand):
|
||||
for m in self.rexx.collect_pot_re.finditer(hand.string):
|
||||
for m in self.re_CollectPot.finditer(hand.handText):
|
||||
hand.addCollectPot(player=m.group('PNAME'),pot=m.group('POT'))
|
||||
|
||||
def readShownCards(self,hand):
|
||||
|
|
|
@ -19,35 +19,47 @@ import sys
|
|||
from optparse import OptionParser
|
||||
# http://docs.python.org/library/optparse.html
|
||||
|
||||
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
|
||||
|
||||
def fpdb_options():
|
||||
|
||||
"""Process command line options for fpdb and HUD_main."""
|
||||
parser = OptionParser()
|
||||
parser.add_option("-x", "--errorsToConsole",
|
||||
action="store_true",
|
||||
help="If passed error output will go to the console rather than .")
|
||||
help=_("If passed error output will go to the console rather than ."))
|
||||
parser.add_option("-d", "--databaseName",
|
||||
dest="dbname",
|
||||
help="Overrides the default database name")
|
||||
help=_("Overrides the default database name"))
|
||||
parser.add_option("-c", "--configFile",
|
||||
dest="config", default=None,
|
||||
help="Specifies a configuration file.")
|
||||
help=_("Specifies a configuration file."))
|
||||
parser.add_option("-r", "--rerunPython",
|
||||
action="store_true",
|
||||
help="Indicates program was restarted with a different path (only allowed once).")
|
||||
help=_("Indicates program was restarted with a different path (only allowed once)."))
|
||||
parser.add_option("-i", "--infile",
|
||||
dest="infile", default="Slartibartfast",
|
||||
help="Input file")
|
||||
help=_("Input file"))
|
||||
parser.add_option("-k", "--konverter",
|
||||
dest="hhc", default="PokerStarsToFpdb",
|
||||
help="Module name for Hand History Converter")
|
||||
help=_("Module name for Hand History Converter"))
|
||||
parser.add_option("-l", "--logging",
|
||||
dest = "log_level",
|
||||
choices = ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL', 'EMPTY'),
|
||||
help = "Error logging level. (DEBUG, INFO, WARNING, ERROR, CRITICAL, EMPTY)",
|
||||
help = _("Error logging level:")+" (DEBUG, INFO, WARNING, ERROR, CRITICAL, EMPTY)",
|
||||
default = 'EMPTY')
|
||||
parser.add_option("-v", "--version", action = "store_true",
|
||||
help = "Print version information and exit.")
|
||||
help = _("Print version information and exit."))
|
||||
|
||||
(options, argv) = parser.parse_args()
|
||||
return (options, argv)
|
||||
|
@ -58,5 +70,5 @@ if __name__== "__main__":
|
|||
print "database name =", options.dbname
|
||||
print "config file =", options.config
|
||||
|
||||
print "press enter to end"
|
||||
print _("press enter to end")
|
||||
sys.stdin.readline()
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import urllib2, re
|
||||
import pprint
|
||||
from BeautifulSoup import BeautifulSoup
|
||||
|
@ -6,7 +7,7 @@ from BeautifulSoup import BeautifulSoup
|
|||
playername = ''
|
||||
|
||||
if playername == '':
|
||||
print "You need to manually enter the playername"
|
||||
print _("You need to manually enter the playername")
|
||||
exit(0)
|
||||
|
||||
page = urllib2.urlopen("http://www.pocketfives.com/poker-scores/%s/" %playername)
|
||||
|
|
|
@ -21,6 +21,18 @@
|
|||
import sys
|
||||
from collections import defaultdict
|
||||
|
||||
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
|
||||
|
||||
from Exceptions import FpdbParseError
|
||||
from HandHistoryConverter import *
|
||||
|
||||
|
@ -96,7 +108,7 @@ class PartyPoker(HandHistoryConverter):
|
|||
re_NoSmallBlind = re.compile(
|
||||
'^There is no Small Blind in this hand as the Big Blind '
|
||||
'of the previous hand left the table', re.MULTILINE)
|
||||
|
||||
re_20BBmin = re.compile(r"Table 20BB Min")
|
||||
|
||||
def allHandsAsList(self):
|
||||
list = HandHistoryConverter.allHandsAsList(self)
|
||||
|
@ -185,6 +197,7 @@ class PartyPoker(HandHistoryConverter):
|
|||
|
||||
info = {}
|
||||
m = self._getGameType(handText)
|
||||
m_20BBmin = self.re_20BBmin.search(handText)
|
||||
if m is None:
|
||||
return None
|
||||
|
||||
|
@ -199,16 +212,16 @@ class PartyPoker(HandHistoryConverter):
|
|||
|
||||
for expectedField in ['LIMIT', 'GAME']:
|
||||
if mg[expectedField] is None:
|
||||
raise FpdbParseError( "Cannot fetch field '%s'" % expectedField)
|
||||
raise FpdbParseError(_("Cannot fetch field '%s'") % expectedField)
|
||||
try:
|
||||
info['limitType'] = limits[mg['LIMIT'].strip()]
|
||||
except:
|
||||
raise FpdbParseError("Unknown limit '%s'" % mg['LIMIT'])
|
||||
raise FpdbParseError(_("Unknown limit '%s'") % mg['LIMIT'])
|
||||
|
||||
try:
|
||||
(info['base'], info['category']) = games[mg['GAME']]
|
||||
except:
|
||||
raise FpdbParseError("Unknown game type '%s'" % mg['GAME'])
|
||||
raise FpdbParseError(_("Unknown game type '%s'") % mg['GAME'])
|
||||
|
||||
if 'TOURNO' in mg:
|
||||
info['type'] = 'tour'
|
||||
|
@ -216,7 +229,18 @@ class PartyPoker(HandHistoryConverter):
|
|||
info['type'] = 'ring'
|
||||
|
||||
if info['type'] == 'ring':
|
||||
info['sb'], info['bb'] = ringBlinds(mg['RINGLIMIT'])
|
||||
if m_20BBmin is None:
|
||||
bb = float(mg['RINGLIMIT'])/100.0
|
||||
else:
|
||||
bb = float(mg['RINGLIMIT'])/40.0
|
||||
|
||||
if bb == 0.25:
|
||||
sb = 0.10
|
||||
else:
|
||||
sb = bb/2.0
|
||||
|
||||
info['bb'] = "%.2f" % (bb)
|
||||
info['sb'] = "%.2f" % (sb)
|
||||
info['currency'] = currencies[mg['CURRENCY']]
|
||||
else:
|
||||
info['sb'] = clearMoneyString(mg['SB'])
|
||||
|
@ -231,17 +255,17 @@ class PartyPoker(HandHistoryConverter):
|
|||
try:
|
||||
info.update(self.re_Hid.search(hand.handText).groupdict())
|
||||
except:
|
||||
raise FpdbParseError("Cannot read HID for current hand")
|
||||
raise FpdbParseError(_("Cannot read HID for current hand"))
|
||||
|
||||
try:
|
||||
info.update(self.re_HandInfo.search(hand.handText,re.DOTALL).groupdict())
|
||||
except:
|
||||
raise FpdbParseError("Cannot read Handinfo for current hand", hid = info['HID'])
|
||||
raise FpdbParseError(_("Cannot read Handinfo for current hand"), hid = info['HID'])
|
||||
|
||||
try:
|
||||
info.update(self._getGameType(hand.handText).groupdict())
|
||||
except:
|
||||
raise FpdbParseError("Cannot read GameType for current hand", hid = info['HID'])
|
||||
raise FpdbParseError(_("Cannot read GameType for current hand"), hid = info['HID'])
|
||||
|
||||
|
||||
m = self.re_CountedSeats.search(hand.handText)
|
||||
|
@ -291,9 +315,9 @@ class PartyPoker(HandHistoryConverter):
|
|||
if key == 'TABLE':
|
||||
hand.tablename = info[key]
|
||||
if key == 'MTTTABLE':
|
||||
if info[key] != None:
|
||||
hand.tablename = info[key]
|
||||
hand.tourNo = info['TABLE']
|
||||
if info[key] != None:
|
||||
hand.tablename = info[key]
|
||||
hand.tourNo = info['TABLE']
|
||||
if key == 'BUTTON':
|
||||
hand.buttonpos = info[key]
|
||||
if key == 'TOURNO':
|
||||
|
@ -324,7 +348,7 @@ class PartyPoker(HandHistoryConverter):
|
|||
if m:
|
||||
hand.buttonpos = int(m.group('BUTTON'))
|
||||
else:
|
||||
log.info('readButton: not found')
|
||||
log.info(_('readButton: not found'))
|
||||
|
||||
def readPlayerStacks(self, hand):
|
||||
log.debug("readPlayerStacks")
|
||||
|
@ -452,7 +476,7 @@ class PartyPoker(HandHistoryConverter):
|
|||
hand.addCheck( street, playerName )
|
||||
else:
|
||||
raise FpdbParseError(
|
||||
"Unimplemented readAction: '%s' '%s'" % (playerName,actionType,),
|
||||
_("Unimplemented readAction: '%s' '%s'") % (playerName,actionType,),
|
||||
hid = hand.hid, )
|
||||
|
||||
def readShowdownActions(self, hand):
|
||||
|
@ -483,13 +507,6 @@ class PartyPoker(HandHistoryConverter):
|
|||
print 'party', 'getTableTitleRe', table_number
|
||||
return table_name
|
||||
|
||||
|
||||
def ringBlinds(ringLimit):
|
||||
"Returns blinds for current limit in cash games"
|
||||
ringLimit = float(clearMoneyString(ringLimit))
|
||||
if ringLimit == 5.: ringLimit = 4.
|
||||
return ('%.2f' % (ringLimit/200.), '%.2f' % (ringLimit/100.) )
|
||||
|
||||
def clearMoneyString(money):
|
||||
"Renders 'numbers' like '1 200' and '2,000'"
|
||||
return money.replace(' ', '').replace(',', '')
|
||||
|
@ -502,9 +519,9 @@ def renderCards(string):
|
|||
|
||||
if __name__ == "__main__":
|
||||
parser = OptionParser()
|
||||
parser.add_option("-i", "--input", dest="ipath", help="parse input hand history")
|
||||
parser.add_option("-o", "--output", dest="opath", help="output translation to", default="-")
|
||||
parser.add_option("-f", "--follow", dest="follow", help="follow (tail -f) the input", action="store_true", default=False)
|
||||
parser.add_option("-i", "--input", dest="ipath", help=_("parse input hand history"))
|
||||
parser.add_option("-o", "--output", dest="opath", help=_("output translation to"), default="-")
|
||||
parser.add_option("-f", "--follow", dest="follow", help=_("follow (tail -f) the input"), action="store_true", default=False)
|
||||
parser.add_option("-q", "--quiet",
|
||||
action="store_const", const=logging.CRITICAL, dest="verbosity", default=logging.INFO)
|
||||
parser.add_option("-v", "--verbose",
|
||||
|
|
|
@ -69,7 +69,7 @@ class PokerStarsSummary(TourneySummary):
|
|||
elif lines[1].find("FPP")!=-1:
|
||||
self.currency="PSFP"
|
||||
else:
|
||||
raise FpdbParseError("didn't recognise buyin currency in:"+lines[1])
|
||||
raise FpdbParseError(_("didn't recognise buyin currency in:")+lines[1])
|
||||
|
||||
if self.currency=="USD" or self.currency=="EUR":
|
||||
result=self.re_BuyInFee.search(lines[1])
|
||||
|
@ -109,7 +109,7 @@ class PokerStarsSummary(TourneySummary):
|
|||
useET=False
|
||||
result=self.re_DateTime.search(lines[currentLine])
|
||||
if not result:
|
||||
print "in not result starttime"
|
||||
print _("in not result starttime")
|
||||
useET=True
|
||||
result=self.re_DateTimeET.search(lines[currentLine])
|
||||
result=result.groupdict()
|
||||
|
|
|
@ -24,6 +24,18 @@ import sys
|
|||
from HandHistoryConverter import *
|
||||
from decimal import Decimal
|
||||
|
||||
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
|
||||
|
||||
# PokerStars HH Format
|
||||
|
||||
class PokerStars(HandHistoryConverter):
|
||||
|
@ -44,12 +56,21 @@ class PokerStars(HandHistoryConverter):
|
|||
|
||||
# translations from captured groups to fpdb info strings
|
||||
Lim_Blinds = { '0.04': ('0.01', '0.02'), '0.10': ('0.02', '0.05'), '0.20': ('0.05', '0.10'),
|
||||
'0.40': ('0.10', '0.20'), '0.50': ('0.10', '0.25'), '1.00': ('0.25', '0.50'),
|
||||
'2.00': ('0.50', '1.00'), '2': ('0.50', '1.00'), '4' : ('1.00', '2.00'),
|
||||
'4.00': ('1.00', '2.00'), '6': ('1.00', '3.00'), '6.00': ('1.00', '3.00'),
|
||||
'10.00': ('2.00', '5.00'), '20.00': ('5.00', '10.00'), '30.00': ('10.00', '15.00'),
|
||||
'60.00': ('15.00', '30.00'), '100.00': ('25.00', '50.00'), '200.00': ('50.00', '100.00'),
|
||||
'400.00': ('100.00', '200.00'), '1000.00': ('250.00', '500.00')}
|
||||
'0.40': ('0.10', '0.20'), '0.50': ('0.10', '0.25'),
|
||||
'1.00': ('0.25', '0.50'), '1': ('0.25', '0.50'),
|
||||
'2.00': ('0.50', '1.00'), '2': ('0.50', '1.00'),
|
||||
'4.00': ('1.00', '2.00'), '4': ('1.00', '2.00'),
|
||||
'6.00': ('1.00', '3.00'), '6': ('1.00', '3.00'),
|
||||
'8.00': ('2.00', '4.00'), '8': ('2.00', '4.00'),
|
||||
'10.00': ('2.00', '5.00'), '10': ('2.00', '5.00'),
|
||||
'20.00': ('5.00', '10.00'), '20': ('5.00', '10.00'),
|
||||
'30.00': ('10.00', '15.00'), '30': ('10.00', '15.00'),
|
||||
'60.00': ('15.00', '30.00'), '60': ('15.00', '30.00'),
|
||||
'100.00': ('25.00', '50.00'), '100': ('25.00', '50.00'),
|
||||
'200.00': ('50.00', '100.00'), '200': ('50.00', '100.00'),
|
||||
'400.00': ('100.00', '200.00'), '400': ('100.00', '200.00'),
|
||||
'1000.00': ('250.00', '500.00'),'1000': ('250.00', '500.00')
|
||||
}
|
||||
|
||||
limits = { 'No Limit':'nl', 'Pot Limit':'pl', 'Limit':'fl', 'LIMIT':'fl' }
|
||||
games = { # base, category
|
||||
|
@ -72,9 +93,9 @@ class PokerStars(HandHistoryConverter):
|
|||
(Tournament\s\# # open paren of tournament info
|
||||
(?P<TOURNO>\d+),\s
|
||||
# here's how I plan to use LS
|
||||
(?P<BUYIN>(?P<BIAMT>[%(LS)s\d\.]+)\+(?P<BOUNTY>[%(LS)s\d\.]+)?\+(?P<BIRAKE>[%(LS)s\d\.]+)\s?(?P<TOUR_ISO>%(LEGAL_ISO)s)|Freeroll)\s+)?
|
||||
(?P<BUYIN>(?P<BIAMT>[%(LS)s\d\.]+)?\+?(?P<BIRAKE>[%(LS)s\d\.]+)?\+?(?P<BOUNTY>[%(LS)s\d\.]+)?\s?(?P<TOUR_ISO>%(LEGAL_ISO)s)?|Freeroll)\s+)?
|
||||
# close paren of tournament info
|
||||
(?P<MIXED>HORSE|8\-Game|HOSE)?\s?\(?
|
||||
(?P<MIXED>HORSE|8\-Game|HOSE|Mixed PLH/PLO)?\s?\(?
|
||||
(?P<GAME>Hold\'em|Razz|RAZZ|7\sCard\sStud|7\sCard\sStud\sHi/Lo|Omaha|Omaha\sHi/Lo|Badugi|Triple\sDraw\s2\-7\sLowball|5\sCard\sDraw)\s
|
||||
(?P<LIMIT>No\sLimit|Limit|LIMIT|Pot\sLimit)\)?,?\s
|
||||
(-\s)?
|
||||
|
@ -165,9 +186,9 @@ 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("determineGameType: Raising FpdbParseError")
|
||||
raise FpdbParseError("Unable to recognise gametype from: '%s'" % tmp)
|
||||
log.error(_("determineGameType: Unable to recognise gametype from: '%s'") % tmp)
|
||||
log.error(_("determineGameType: Raising FpdbParseError"))
|
||||
raise FpdbParseError(_("Unable to recognise gametype from: '%s'") % tmp)
|
||||
|
||||
mg = m.groupdict()
|
||||
# I don't think this is doing what we think. mg will always have all
|
||||
|
@ -195,9 +216,9 @@ 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("determineGameType: Raising FpdbParseError")
|
||||
raise FpdbParseError("Lim_Blinds has no lookup for '%s'" % mg['BB'])
|
||||
log.error(_("determineGameType: 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'])
|
||||
|
||||
return info
|
||||
|
||||
|
@ -249,14 +270,28 @@ class PokerStars(HandHistoryConverter):
|
|||
hand.buyinCurrency="PSFP"
|
||||
else:
|
||||
#FIXME: handle other currencies, FPP, play money
|
||||
raise FpdbParseError("failed to detect currency")
|
||||
raise FpdbParseError(_("failed to detect currency"))
|
||||
|
||||
if hand.buyinCurrency=="USD" or hand.buyinCurrency=="EUR":
|
||||
hand.buyin = int(100*Decimal(info['BIAMT'][1:]))
|
||||
hand.fee = int(100*Decimal(info['BIRAKE'][1:]))
|
||||
# TODO: Bounty is in key 'BOUNTY'
|
||||
elif hand.buyinCurrency=="PSFP":
|
||||
hand.buyin = int(Decimal(info[key][0:-3]))
|
||||
info['BIAMT'] = info['BIAMT'].strip(u'$€FPP')
|
||||
|
||||
if hand.buyinCurrency!="PSFP":
|
||||
if info['BOUNTY'] != None:
|
||||
# There is a bounty, Which means we need to switch BOUNTY and BIRAKE values
|
||||
tmp = info['BOUNTY']
|
||||
info['BOUNTY'] = info['BIRAKE']
|
||||
info['BIRAKE'] = tmp
|
||||
info['BOUNTY'] = info['BOUNTY'].strip(u'$€') # Strip here where it isn't 'None'
|
||||
hand.koBounty = int(100*Decimal(info['BOUNTY']))
|
||||
hand.isKO = True
|
||||
else:
|
||||
hand.isKO = False
|
||||
|
||||
info['BIRAKE'] = info['BIRAKE'].strip(u'$€')
|
||||
|
||||
hand.buyin = int(100*Decimal(info['BIAMT']))
|
||||
hand.fee = int(100*Decimal(info['BIRAKE']))
|
||||
else:
|
||||
hand.buyin = int(Decimal(info['BIAMT']))
|
||||
hand.fee = 0
|
||||
if key == 'LEVEL':
|
||||
hand.level = info[key]
|
||||
|
@ -282,7 +317,7 @@ class PokerStars(HandHistoryConverter):
|
|||
if m:
|
||||
hand.buttonpos = int(m.group('BUTTON'))
|
||||
else:
|
||||
log.info('readButton: not found')
|
||||
log.info(_('readButton: not found'))
|
||||
|
||||
def readPlayerStacks(self, hand):
|
||||
log.debug("readPlayerStacks")
|
||||
|
@ -320,7 +355,7 @@ class PokerStars(HandHistoryConverter):
|
|||
hand.setCommunityCards(street, m.group('CARDS').split(' '))
|
||||
|
||||
def readAntes(self, hand):
|
||||
log.debug("reading antes")
|
||||
log.debug(_("reading antes"))
|
||||
m = self.re_Antes.finditer(hand.handText)
|
||||
for player in m:
|
||||
#~ logging.debug("hand.addAnte(%s,%s)" %(player.group('PNAME'), player.group('ANTE')))
|
||||
|
@ -402,7 +437,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):
|
||||
|
@ -429,9 +464,9 @@ class PokerStars(HandHistoryConverter):
|
|||
|
||||
if __name__ == "__main__":
|
||||
parser = OptionParser()
|
||||
parser.add_option("-i", "--input", dest="ipath", help="parse input hand history", default="regression-test-files/stars/horse/HH20090226 Natalie V - $0.10-$0.20 - HORSE.txt")
|
||||
parser.add_option("-o", "--output", dest="opath", help="output translation to", default="-")
|
||||
parser.add_option("-f", "--follow", dest="follow", help="follow (tail -f) the input", action="store_true", default=False)
|
||||
parser.add_option("-i", "--input", dest="ipath", help=_("parse input hand history"), default="regression-test-files/stars/horse/HH20090226 Natalie V - $0.10-$0.20 - HORSE.txt")
|
||||
parser.add_option("-o", "--output", dest="opath", help=_("output translation to"), default="-")
|
||||
parser.add_option("-f", "--follow", dest="follow", help=_("follow (tail -f) the input"), action="store_true", default=False)
|
||||
#parser.add_option("-q", "--quiet", action="store_const", const=logging.CRITICAL, dest="verbosity", default=logging.INFO)
|
||||
#parser.add_option("-v", "--verbose", action="store_const", const=logging.INFO, dest="verbosity")
|
||||
#parser.add_option("--vv", action="store_const", const=logging.DEBUG, dest="verbosity")
|
||||
|
|
293
pyfpdb/SQL.py
293
pyfpdb/SQL.py
|
@ -108,6 +108,51 @@ class Sql:
|
|||
self.query['createSettingsTable'] = """CREATE TABLE Settings
|
||||
(version INTEGER NOT NULL) """
|
||||
|
||||
################################
|
||||
# Create RawHands (this table is all but identical with RawTourneys)
|
||||
################################
|
||||
if db_server == 'mysql':
|
||||
self.query['createRawHands'] = """CREATE TABLE RawHands (
|
||||
id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, PRIMARY KEY (id),
|
||||
handId BIGINT NOT NULL,
|
||||
rawHand TEXT NOT NULL,
|
||||
complain BOOLEAN NOT NULL DEFAULT FALSE)
|
||||
ENGINE=INNODB"""
|
||||
elif db_server == 'postgresql':
|
||||
self.query['createRawHands'] = """CREATE TABLE RawHands (
|
||||
id BIGSERIAL, PRIMARY KEY (id),
|
||||
handId BIGINT NOT NULL,
|
||||
rawHand TEXT NOT NULL,
|
||||
complain BOOLEAN NOT NULL DEFAULT FALSE)"""
|
||||
elif db_server == 'sqlite':
|
||||
self.query['createRawHands'] = """CREATE TABLE RawHands (
|
||||
id INTEGER PRIMARY KEY,
|
||||
handId BIGINT NOT NULL,
|
||||
rawHand TEXT NOT NULL,
|
||||
complain BOOLEAN NOT NULL DEFAULT FALSE)"""
|
||||
|
||||
################################
|
||||
# Create RawTourneys (this table is all but identical with RawHands)
|
||||
################################
|
||||
if db_server == 'mysql':
|
||||
self.query['createRawTourneys'] = """CREATE TABLE RawTourneys (
|
||||
id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, PRIMARY KEY (id),
|
||||
tourneyId BIGINT NOT NULL,
|
||||
rawTourney TEXT NOT NULL,
|
||||
complain BOOLEAN NOT NULL DEFAULT FALSE)
|
||||
ENGINE=INNODB"""
|
||||
elif db_server == 'postgresql':
|
||||
self.query['createRawTourneys'] = """CREATE TABLE RawTourneys (
|
||||
id BIGSERIAL, PRIMARY KEY (id),
|
||||
tourneyId BIGINT NOT NULL,
|
||||
rawTourney TEXT NOT NULL,
|
||||
complain BOOLEAN NOT NULL DEFAULT FALSE)"""
|
||||
elif db_server == 'sqlite':
|
||||
self.query['createRawTourneys'] = """CREATE TABLE RawTourneys (
|
||||
id INTEGER PRIMARY KEY,
|
||||
tourneyId BIGINT NOT NULL,
|
||||
rawTourney TEXT NOT NULL,
|
||||
complain BOOLEAN NOT NULL DEFAULT FALSE)"""
|
||||
|
||||
################################
|
||||
# Create Sites
|
||||
|
@ -137,21 +182,21 @@ class Sql:
|
|||
if db_server == 'mysql':
|
||||
self.query['createBackingsTable'] = """CREATE TABLE Backings (
|
||||
id SMALLINT UNSIGNED AUTO_INCREMENT NOT NULL, PRIMARY KEY (id),
|
||||
tourneysPlayerId BIGINT UNSIGNED NOT NULL, FOREIGN KEY (tourneysPlayerId) REFERENCES TourneysPlayers(id),
|
||||
tourneysPlayersId BIGINT UNSIGNED NOT NULL, FOREIGN KEY (tourneysPlayersId) REFERENCES TourneysPlayers(id),
|
||||
playerId INT UNSIGNED NOT NULL, FOREIGN KEY (playerId) REFERENCES Players(id),
|
||||
buyInPercentage FLOAT UNSIGNED NOT NULL,
|
||||
payOffPercentage FLOAT UNSIGNED NOT NULL) ENGINE=INNODB"""
|
||||
elif db_server == 'postgresql':
|
||||
self.query['createBackingsTable'] = """CREATE TABLE Backings (
|
||||
id BIGSERIAL, PRIMARY KEY (id),
|
||||
tourneysPlayerId INT NOT NULL, FOREIGN KEY (tourneysPlayerId) REFERENCES TourneysPlayers(id),
|
||||
tourneysPlayersId INT NOT NULL, FOREIGN KEY (tourneysPlayersId) REFERENCES TourneysPlayers(id),
|
||||
playerId INT NOT NULL, FOREIGN KEY (playerId) REFERENCES Players(id),
|
||||
buyInPercentage FLOAT NOT NULL,
|
||||
payOffPercentage FLOAT NOT NULL)"""
|
||||
elif db_server == 'sqlite':
|
||||
self.query['createBackingsTable'] = """CREATE TABLE Backings (
|
||||
id INTEGER PRIMARY KEY,
|
||||
tourneysPlayerId INT NOT NULL,
|
||||
tourneysPlayersId INT NOT NULL,
|
||||
playerId INT NOT NULL,
|
||||
buyInPercentage REAL UNSIGNED NOT NULL,
|
||||
payOffPercentage REAL UNSIGNED NOT NULL)"""
|
||||
|
@ -543,6 +588,7 @@ class Sql:
|
|||
position CHAR(1),
|
||||
seatNo SMALLINT NOT NULL,
|
||||
sitout BOOLEAN NOT NULL,
|
||||
wentAllInOnStreet SMALLINT,
|
||||
|
||||
card1 smallint NOT NULL, /* 0=none, 1-13=2-Ah 14-26=2-Ad 27-39=2-Ac 40-52=2-As */
|
||||
card2 smallint NOT NULL,
|
||||
|
@ -659,6 +705,7 @@ class Sql:
|
|||
position CHAR(1),
|
||||
seatNo SMALLINT NOT NULL,
|
||||
sitout BOOLEAN NOT NULL,
|
||||
wentAllInOnStreet SMALLINT,
|
||||
|
||||
card1 smallint NOT NULL, /* 0=none, 1-13=2-Ah 14-26=2-Ad 27-39=2-Ac 40-52=2-As */
|
||||
card2 smallint NOT NULL,
|
||||
|
@ -774,6 +821,7 @@ class Sql:
|
|||
position TEXT,
|
||||
seatNo INT NOT NULL,
|
||||
sitout BOOLEAN NOT NULL,
|
||||
wentAllInOnStreet INT,
|
||||
|
||||
card1 INT NOT NULL, /* 0=none, 1-13=2-Ah 14-26=2-Ad 27-39=2-Ac 40-52=2-As */
|
||||
card2 INT NOT NULL,
|
||||
|
@ -915,7 +963,7 @@ class Sql:
|
|||
commentTs timestamp without time zone)"""
|
||||
elif db_server == 'sqlite':
|
||||
self.query['createTourneysPlayersTable'] = """CREATE TABLE TourneysPlayers (
|
||||
id INT PRIMARY KEY,
|
||||
id INTEGER PRIMARY KEY,
|
||||
tourneyId INT,
|
||||
playerId INT,
|
||||
rank INT,
|
||||
|
@ -960,7 +1008,7 @@ class Sql:
|
|||
commentTs timestamp without time zone)"""
|
||||
elif db_server == 'sqlite':
|
||||
self.query['createHandsActionsTable'] = """CREATE TABLE HandsActions (
|
||||
id INT PRIMARY KEY,
|
||||
id INTEGER PRIMARY KEY,
|
||||
handsPlayerId BIGINT,
|
||||
street SMALLINT,
|
||||
actionNo SMALLINT,
|
||||
|
@ -1333,8 +1381,6 @@ class Sql:
|
|||
and (p.siteId = %s or %s = -1)
|
||||
"""
|
||||
|
||||
self.query['getSiteId'] = """SELECT id from Sites where name = %s"""
|
||||
|
||||
self.query['get_stats_from_hand'] = """
|
||||
SELECT hc.playerId AS player_id,
|
||||
hp.seatNo AS seat,
|
||||
|
@ -1397,6 +1443,7 @@ class Sql:
|
|||
sum(hc.foldToStreet4CBChance) AS f_cb_opp_4,
|
||||
sum(hc.foldToStreet4CBDone) AS f_cb_4,
|
||||
sum(hc.totalProfit) AS net,
|
||||
sum(gt.bigblind) AS bigblind,
|
||||
sum(hc.street1CheckCallRaiseChance) AS ccr_opp_1,
|
||||
sum(hc.street1CheckCallRaiseDone) AS ccr_1,
|
||||
sum(hc.street2CheckCallRaiseChance) AS ccr_opp_2,
|
||||
|
@ -1425,6 +1472,7 @@ class Sql:
|
|||
INNER JOIN HudCache hc ON ( hc.PlayerId = hp.PlayerId+0
|
||||
AND hc.gametypeId+0 = h.gametypeId+0)
|
||||
INNER JOIN Players p ON (p.id = hp.PlayerId+0)
|
||||
INNER JOIN Gametypes gt ON (gt.id = hc.gametypeId)
|
||||
WHERE h.id = %s
|
||||
AND hc.styleKey > %s
|
||||
/* styleKey is currently 'd' (for date) followed by a yyyymmdd
|
||||
|
@ -1496,6 +1544,7 @@ class Sql:
|
|||
sum(hc.foldToStreet4CBChance) AS f_cb_opp_4,
|
||||
sum(hc.foldToStreet4CBDone) AS f_cb_4,
|
||||
sum(hc.totalProfit) AS net,
|
||||
sum(gt.bigblind) AS bigblind,
|
||||
sum(hc.street1CheckCallRaiseChance) AS ccr_opp_1,
|
||||
sum(hc.street1CheckCallRaiseDone) AS ccr_1,
|
||||
sum(hc.street2CheckCallRaiseChance) AS ccr_opp_2,
|
||||
|
@ -1523,6 +1572,7 @@ class Sql:
|
|||
INNER JOIN HandsPlayers hp ON (hp.handId = h.id)
|
||||
INNER JOIN HudCache hc ON (hc.playerId = hp.playerId)
|
||||
INNER JOIN Players p ON (p.id = hc.playerId)
|
||||
INNER JOIN Gametypes gt ON (gt.id = hc.gametypeId)
|
||||
WHERE h.id = %s
|
||||
AND ( /* 2 separate parts for hero and opponents */
|
||||
( hp.playerId != %s
|
||||
|
@ -1622,6 +1672,7 @@ class Sql:
|
|||
cast(hp2.foldToStreet4CBChance as <signed>integer) AS f_cb_opp_4,
|
||||
cast(hp2.foldToStreet4CBDone as <signed>integer) AS f_cb_4,
|
||||
cast(hp2.totalProfit as <signed>integer) AS net,
|
||||
cast(gt.bigblind as <signed>integer) AS bigblind,
|
||||
cast(hp2.street1CheckCallRaiseChance as <signed>integer) AS ccr_opp_1,
|
||||
cast(hp2.street1CheckCallRaiseDone as <signed>integer) AS ccr_1,
|
||||
cast(hp2.street2CheckCallRaiseChance as <signed>integer) AS ccr_opp_2,
|
||||
|
@ -1651,6 +1702,7 @@ class Sql:
|
|||
INNER JOIN HandsPlayers hp ON (h.id = hp.handId) /* players in this hand */
|
||||
INNER JOIN HandsPlayers hp2 ON (hp2.playerId+0 = hp.playerId+0 AND (hp2.handId = h2.id+0)) /* other hands by these players */
|
||||
INNER JOIN Players p ON (p.id = hp2.PlayerId+0)
|
||||
INNER JOIN Gametypes gt ON (gt.id = h2.gametypeId)
|
||||
WHERE hp.handId = %s
|
||||
/* check activeseats once this data returned (don't want to do that here as it might
|
||||
assume a session ended just because the number of seats dipped for a few hands)
|
||||
|
@ -1724,6 +1776,7 @@ class Sql:
|
|||
cast(hp2.foldToStreet4CBChance as <signed>integer) AS f_cb_opp_4,
|
||||
cast(hp2.foldToStreet4CBDone as <signed>integer) AS f_cb_4,
|
||||
cast(hp2.totalProfit as <signed>integer) AS net,
|
||||
cast(gt.bigblind as <signed>integer) AS bigblind,
|
||||
cast(hp2.street1CheckCallRaiseChance as <signed>integer) AS ccr_opp_1,
|
||||
cast(hp2.street1CheckCallRaiseDone as <signed>integer) AS ccr_1,
|
||||
cast(hp2.street2CheckCallRaiseChance as <signed>integer) AS ccr_opp_2,
|
||||
|
@ -1754,6 +1807,7 @@ class Sql:
|
|||
INNER JOIN HandsPlayers hp2 ON ( hp2.playerId+0 = hp.playerId+0
|
||||
AND hp2.handId = h2.id) /* other hands by these players */
|
||||
INNER JOIN Players p ON (p.id = hp2.PlayerId+0)
|
||||
INNER JOIN Gametypes gt ON (gt.id = h2.gametypeId)
|
||||
WHERE h.id = %s
|
||||
/* check activeseats once this data returned (don't want to do that here as it might
|
||||
assume a session ended just because the number of seats dipped for a few hands)
|
||||
|
@ -1827,6 +1881,7 @@ class Sql:
|
|||
cast(hp2.foldToStreet4CBChance as <signed>integer) AS f_cb_opp_4,
|
||||
cast(hp2.foldToStreet4CBDone as <signed>integer) AS f_cb_4,
|
||||
cast(hp2.totalProfit as <signed>integer) AS net,
|
||||
cast(gt.bigblind as <signed>integer) AS bigblind,
|
||||
cast(hp2.street1CheckCallRaiseChance as <signed>integer) AS ccr_opp_1,
|
||||
cast(hp2.street1CheckCallRaiseDone as <signed>integer) AS ccr_1,
|
||||
cast(hp2.street2CheckCallRaiseChance as <signed>integer) AS ccr_opp_2,
|
||||
|
@ -1857,6 +1912,7 @@ class Sql:
|
|||
INNER JOIN HandsPlayers hp2 ON ( hp2.playerId+0 = hp.playerId+0
|
||||
AND hp2.handId = h2.id) /* other hands by these players */
|
||||
INNER JOIN Players p ON (p.id = hp2.PlayerId+0)
|
||||
INNER JOIN Gametypes gt ON (gt.id = h2.gametypeId)
|
||||
WHERE h.id = %s
|
||||
/* check activeseats once this data returned (don't want to do that here as it might
|
||||
assume a session ended just because the number of seats dipped for a few hands)
|
||||
|
@ -1997,8 +2053,6 @@ class Sql:
|
|||
self.query['getPlayerIdBySite'] = """SELECT id from Players where name = %s AND siteId = %s"""
|
||||
|
||||
# used in *Filters:
|
||||
self.query['getSiteId'] = """SELECT id from Sites where name = %s"""
|
||||
self.query['getGames'] = """SELECT DISTINCT category from Gametypes"""
|
||||
#self.query['getLimits'] = already defined further up
|
||||
self.query['getLimits2'] = """SELECT DISTINCT type, limitType, bigBlind
|
||||
from Gametypes
|
||||
|
@ -2016,6 +2070,7 @@ class Sql:
|
|||
, limitType
|
||||
, bigBlind as bb_or_buyin
|
||||
from Gametypes gt
|
||||
WHERE type = 'ring'
|
||||
order by type, limitType DESC, bb_or_buyin DESC"""
|
||||
|
||||
if db_server == 'mysql':
|
||||
|
@ -2389,7 +2444,7 @@ class Sql:
|
|||
select s.name AS siteName
|
||||
,t.tourneyTypeId AS tourneyTypeId
|
||||
,tt.currency AS currency
|
||||
,(CASE WHEN tt.currency = "USD" THEN tt.buyIn/100.0 ELSE tt.buyIn END) AS buyIn
|
||||
,(CASE WHEN tt.currency = 'USD' THEN tt.buyIn/100.0 ELSE tt.buyIn END) AS buyIn
|
||||
,tt.fee/100.0 AS fee
|
||||
,tt.category AS category
|
||||
,tt.limitType AS limitType
|
||||
|
@ -2397,11 +2452,11 @@ class Sql:
|
|||
,COUNT(1) AS tourneyCount
|
||||
,SUM(CASE WHEN tp.rank > 0 THEN 0 ELSE 1 END) AS unknownRank
|
||||
,SUM(CASE WHEN winnings > 0 THEN 1 ELSE 0 END)/(COUNT(1) - SUM(CASE WHEN tp.rank > 0 THEN 0 ELSE 1 END)) AS itm
|
||||
,SUM(CASE WHEN rank = 1 THEN 1 ELSE 0 END) AS 1st
|
||||
,SUM(CASE WHEN rank = 2 THEN 1 ELSE 0 END) AS 2nd
|
||||
,SUM(CASE WHEN rank = 3 THEN 1 ELSE 0 END) AS 3rd
|
||||
,SUM(CASE WHEN rank = 1 THEN 1 ELSE 0 END) AS _1st
|
||||
,SUM(CASE WHEN rank = 2 THEN 1 ELSE 0 END) AS _2nd
|
||||
,SUM(CASE WHEN rank = 3 THEN 1 ELSE 0 END) AS _3rd
|
||||
,SUM(tp.winnings)/100.0 AS won
|
||||
,SUM(CASE WHEN tt.currency = "USD" THEN (tt.buyIn+tt.fee)/100.0 ELSE tt.buyIn END) AS spent
|
||||
,SUM(CASE WHEN tt.currency = 'USD' THEN (tt.buyIn+tt.fee)/100.0 ELSE tt.buyIn END) AS spent
|
||||
,SUM(tp.winnings)/SUM(tt.buyin+tt.fee)*100.0-100 AS roi
|
||||
,SUM(tp.winnings-(tt.buyin+tt.fee))/100.0/(COUNT(1)-SUM(CASE WHEN tp.rank > 0 THEN 0 ELSE 1 END)) AS profitPerTourney
|
||||
from TourneysPlayers tp
|
||||
|
@ -2416,9 +2471,72 @@ class Sql:
|
|||
,playerName
|
||||
,siteName"""
|
||||
elif db_server == 'postgresql':
|
||||
self.query['tourneyPlayerDetailedStats'] = """TODO"""
|
||||
# sc: itm and profitPerTourney changed to "ELSE 0" to avoid divide by zero error as temp fix
|
||||
# proper fix should use coalesce() or case ... when ... to work in all circumstances
|
||||
self.query['tourneyPlayerDetailedStats'] = """
|
||||
select s.name AS siteName
|
||||
,t.tourneyTypeId AS tourneyTypeId
|
||||
,tt.currency AS currency
|
||||
,(CASE WHEN tt.currency = 'USD' THEN tt.buyIn/100.0 ELSE tt.buyIn END) AS buyIn
|
||||
,tt.fee/100.0 AS fee
|
||||
,tt.category AS category
|
||||
,tt.limitType AS limitType
|
||||
,p.name AS playerName
|
||||
,COUNT(1) AS tourneyCount
|
||||
,SUM(CASE WHEN tp.rank > 0 THEN 0 ELSE 1 END) AS unknownRank
|
||||
,SUM(CASE WHEN winnings > 0 THEN 1 ELSE 0 END)
|
||||
/(COUNT(1) - SUM(CASE WHEN tp.rank > 0 THEN 0 ELSE 0 END)) AS itm
|
||||
,SUM(CASE WHEN rank = 1 THEN 1 ELSE 0 END) AS _1st
|
||||
,SUM(CASE WHEN rank = 2 THEN 1 ELSE 0 END) AS _2nd
|
||||
,SUM(CASE WHEN rank = 3 THEN 1 ELSE 0 END) AS _3rd
|
||||
,SUM(tp.winnings)/100.0 AS won
|
||||
,SUM(CASE WHEN tt.currency = 'USD' THEN (tt.buyIn+tt.fee)/100.0 ELSE tt.buyIn END) AS spent
|
||||
,SUM(tp.winnings)/SUM(tt.buyin+tt.fee)*100.0-100 AS roi
|
||||
,SUM(tp.winnings-(tt.buyin+tt.fee))/100.0
|
||||
/(COUNT(1)-SUM(CASE WHEN tp.rank > 0 THEN 0 ELSE 0 END)) AS profitPerTourney
|
||||
from TourneysPlayers tp
|
||||
inner join Tourneys t on (t.id = tp.tourneyId)
|
||||
inner join TourneyTypes tt on (tt.Id = t.tourneyTypeId)
|
||||
inner join Sites s on (s.Id = tt.siteId)
|
||||
inner join Players p on (p.Id = tp.playerId)
|
||||
where tp.playerId in <nametest> <sitetest>
|
||||
and to_char(t.startTime, 'YYYY-MM-DD HH24:MI:SS') <datestest>
|
||||
group by tourneyTypeId, s.name, playerName, tt.currency, tt.buyin, tt.fee
|
||||
, tt.category, tt.limitType
|
||||
order by tourneyTypeId
|
||||
,playerName
|
||||
,siteName"""
|
||||
elif db_server == 'sqlite':
|
||||
self.query['tourneyPlayerDetailedStats'] = """TODO"""
|
||||
self.query['tourneyPlayerDetailedStats'] = """
|
||||
select s.name AS siteName
|
||||
,t.tourneyTypeId AS tourneyTypeId
|
||||
,tt.currency AS currency
|
||||
,(CASE WHEN tt.currency = 'USD' THEN tt.buyIn/100.0 ELSE tt.buyIn END) AS buyIn
|
||||
,tt.fee/100.0 AS fee
|
||||
,tt.category AS category
|
||||
,tt.limitType AS limitType
|
||||
,p.name AS playerName
|
||||
,COUNT(1) AS tourneyCount
|
||||
,SUM(CASE WHEN tp.rank > 0 THEN 0 ELSE 1 END) AS unknownRank
|
||||
,SUM(CASE WHEN winnings > 0 THEN 1 ELSE 0 END)/(COUNT(1) - SUM(CASE WHEN tp.rank > 0 THEN 0 ELSE 1 END)) AS itm
|
||||
,SUM(CASE WHEN rank = 1 THEN 1 ELSE 0 END) AS _1st
|
||||
,SUM(CASE WHEN rank = 2 THEN 1 ELSE 0 END) AS _2nd
|
||||
,SUM(CASE WHEN rank = 3 THEN 1 ELSE 0 END) AS _3rd
|
||||
,SUM(tp.winnings)/100.0 AS won
|
||||
,SUM(CASE WHEN tt.currency = 'USD' THEN (tt.buyIn+tt.fee)/100.0 ELSE tt.buyIn END) AS spent
|
||||
,SUM(tp.winnings)/SUM(tt.buyin+tt.fee)*100.0-100 AS roi
|
||||
,SUM(tp.winnings-(tt.buyin+tt.fee))/100.0/(COUNT(1)-SUM(CASE WHEN tp.rank > 0 THEN 0 ELSE 1 END)) AS profitPerTourney
|
||||
from TourneysPlayers tp
|
||||
inner join Tourneys t on (t.id = tp.tourneyId)
|
||||
inner join TourneyTypes tt on (tt.Id = t.tourneyTypeId)
|
||||
inner join Sites s on (s.Id = tt.siteId)
|
||||
inner join Players p on (p.Id = tp.playerId)
|
||||
where tp.playerId in <nametest> <sitetest>
|
||||
and datetime(t.startTime) <datestest>
|
||||
group by tourneyTypeId, playerName
|
||||
order by tourneyTypeId
|
||||
,playerName
|
||||
,siteName"""
|
||||
|
||||
if db_server == 'mysql':
|
||||
self.query['playerStats'] = """
|
||||
|
@ -2767,6 +2885,8 @@ class Sql:
|
|||
order by stats.category, stats.limitType, stats.bigBlindDesc desc
|
||||
<orderbyseats>, cast(stats.PlPosition as signed)
|
||||
"""
|
||||
elif db_server == 'sqlite':
|
||||
self.query['playerStatsByPosition'] = ""#TODO
|
||||
else: # assume postgresql
|
||||
self.query['playerStatsByPosition'] = """
|
||||
select /* stats from hudcache */
|
||||
|
@ -2937,7 +3057,7 @@ class Sql:
|
|||
INNER JOIN Players p on (p.Id = hp.playerId)
|
||||
WHERE hp.playerId in <player_test>
|
||||
AND date_format(h.startTime, '%Y-%m-%d') <datestest>
|
||||
AND gt.type is 'ring'
|
||||
AND gt.type LIKE 'ring'
|
||||
ORDER by time"""
|
||||
elif db_server == 'postgresql':
|
||||
self.query['sessionStats'] = """
|
||||
|
@ -2949,7 +3069,7 @@ class Sql:
|
|||
INNER JOIN Players p on (p.Id = hp.playerId)
|
||||
WHERE hp.playerId in <player_test>
|
||||
AND h.startTime <datestest>
|
||||
AND gt.type is 'ring'
|
||||
AND gt.type LIKE 'ring'
|
||||
ORDER by time"""
|
||||
elif db_server == 'sqlite':
|
||||
self.query['sessionStats'] = """
|
||||
|
@ -2978,15 +3098,22 @@ class Sql:
|
|||
,playerId
|
||||
,activeSeats
|
||||
,position
|
||||
,tourneyTypeId
|
||||
<tourney_insert_clause>
|
||||
,styleKey
|
||||
,HDs
|
||||
,wonWhenSeenStreet1
|
||||
,wonWhenSeenStreet2
|
||||
,wonWhenSeenStreet3
|
||||
,wonWhenSeenStreet4
|
||||
,wonAtSD
|
||||
,street0VPI
|
||||
,street0Aggr
|
||||
,street0_3BChance
|
||||
,street0_3BDone
|
||||
,street0_4BChance
|
||||
,street0_4BDone
|
||||
,other3BStreet0
|
||||
,other4BStreet0
|
||||
,street1Seen
|
||||
,street2Seen
|
||||
,street3Seen
|
||||
|
@ -2996,10 +3123,12 @@ class Sql:
|
|||
,street2Aggr
|
||||
,street3Aggr
|
||||
,street4Aggr
|
||||
,otherRaisedStreet0
|
||||
,otherRaisedStreet1
|
||||
,otherRaisedStreet2
|
||||
,otherRaisedStreet3
|
||||
,otherRaisedStreet4
|
||||
,foldToOtherRaisedStreet0
|
||||
,foldToOtherRaisedStreet1
|
||||
,foldToOtherRaisedStreet2
|
||||
,foldToOtherRaisedStreet3
|
||||
|
@ -3068,15 +3197,22 @@ class Sql:
|
|||
when hp.position = '9' then 'E'
|
||||
else 'E'
|
||||
end AS hc_position
|
||||
,t.tourneyTypeId
|
||||
<tourney_select_clause>
|
||||
,date_format(h.startTime, 'd%y%m%d')
|
||||
,count(1)
|
||||
,sum(wonWhenSeenStreet1)
|
||||
,sum(wonWhenSeenStreet2)
|
||||
,sum(wonWhenSeenStreet3)
|
||||
,sum(wonWhenSeenStreet4)
|
||||
,sum(wonAtSD)
|
||||
,sum(street0VPI)
|
||||
,sum(street0Aggr)
|
||||
,sum(street0_3BChance)
|
||||
,sum(street0_3BDone)
|
||||
,sum(street0_4BChance)
|
||||
,sum(street0_4BDone)
|
||||
,sum(other3BStreet0)
|
||||
,sum(other4BStreet0)
|
||||
,sum(street1Seen)
|
||||
,sum(street2Seen)
|
||||
,sum(street3Seen)
|
||||
|
@ -3086,10 +3222,12 @@ class Sql:
|
|||
,sum(street2Aggr)
|
||||
,sum(street3Aggr)
|
||||
,sum(street4Aggr)
|
||||
,sum(otherRaisedStreet0)
|
||||
,sum(otherRaisedStreet1)
|
||||
,sum(otherRaisedStreet2)
|
||||
,sum(otherRaisedStreet3)
|
||||
,sum(otherRaisedStreet4)
|
||||
,sum(foldToOtherRaisedStreet0)
|
||||
,sum(foldToOtherRaisedStreet1)
|
||||
,sum(foldToOtherRaisedStreet2)
|
||||
,sum(foldToOtherRaisedStreet3)
|
||||
|
@ -3142,14 +3280,13 @@ class Sql:
|
|||
,sum(hp.street4Raises)
|
||||
FROM HandsPlayers hp
|
||||
INNER JOIN Hands h ON (h.id = hp.handId)
|
||||
INNER JOIN TourneysPlayers tp ON (tp.id = hp.tourneysPlayersId)
|
||||
INNER JOIN Tourneys t ON (t.id = tp.tourneyId)
|
||||
<tourney_join_clause>
|
||||
<where_clause>
|
||||
GROUP BY h.gametypeId
|
||||
,hp.playerId
|
||||
,h.seats
|
||||
,hc_position
|
||||
,t.tourneyTypeId
|
||||
<tourney_group_clause>
|
||||
,date_format(h.startTime, 'd%y%m%d')
|
||||
"""
|
||||
elif db_server == 'postgresql':
|
||||
|
@ -3159,15 +3296,22 @@ class Sql:
|
|||
,playerId
|
||||
,activeSeats
|
||||
,position
|
||||
,tourneyTypeId
|
||||
<tourney_insert_clause>
|
||||
,styleKey
|
||||
,HDs
|
||||
,wonWhenSeenStreet1
|
||||
,wonWhenSeenStreet2
|
||||
,wonWhenSeenStreet3
|
||||
,wonWhenSeenStreet4
|
||||
,wonAtSD
|
||||
,street0VPI
|
||||
,street0Aggr
|
||||
,street0_3BChance
|
||||
,street0_3BDone
|
||||
,street0_4BChance
|
||||
,street0_4BDone
|
||||
,other3BStreet0
|
||||
,other4BStreet0
|
||||
,street1Seen
|
||||
,street2Seen
|
||||
,street3Seen
|
||||
|
@ -3177,10 +3321,12 @@ class Sql:
|
|||
,street2Aggr
|
||||
,street3Aggr
|
||||
,street4Aggr
|
||||
,otherRaisedStreet0
|
||||
,otherRaisedStreet1
|
||||
,otherRaisedStreet2
|
||||
,otherRaisedStreet3
|
||||
,otherRaisedStreet4
|
||||
,foldToOtherRaisedStreet0
|
||||
,foldToOtherRaisedStreet1
|
||||
,foldToOtherRaisedStreet2
|
||||
,foldToOtherRaisedStreet3
|
||||
|
@ -3249,15 +3395,22 @@ class Sql:
|
|||
when hp.position = '9' then 'E'
|
||||
else 'E'
|
||||
end AS hc_position
|
||||
,t.tourneyTypeId
|
||||
<tourney_select_clause>
|
||||
,'d' || to_char(h.startTime, 'YYMMDD')
|
||||
,count(1)
|
||||
,sum(wonWhenSeenStreet1)
|
||||
,sum(wonWhenSeenStreet2)
|
||||
,sum(wonWhenSeenStreet3)
|
||||
,sum(wonWhenSeenStreet4)
|
||||
,sum(wonAtSD)
|
||||
,sum(CAST(street0VPI as integer))
|
||||
,sum(CAST(street0Aggr as integer))
|
||||
,sum(CAST(street0_3BChance as integer))
|
||||
,sum(CAST(street0_3BDone as integer))
|
||||
,sum(CAST(street0_4BChance as integer))
|
||||
,sum(CAST(street0_4BDone as integer))
|
||||
,sum(CAST(other3BStreet0 as integer))
|
||||
,sum(CAST(other4BStreet0 as integer))
|
||||
,sum(CAST(street1Seen as integer))
|
||||
,sum(CAST(street2Seen as integer))
|
||||
,sum(CAST(street3Seen as integer))
|
||||
|
@ -3267,10 +3420,12 @@ class Sql:
|
|||
,sum(CAST(street2Aggr as integer))
|
||||
,sum(CAST(street3Aggr as integer))
|
||||
,sum(CAST(street4Aggr as integer))
|
||||
,sum(CAST(otherRaisedStreet0 as integer))
|
||||
,sum(CAST(otherRaisedStreet1 as integer))
|
||||
,sum(CAST(otherRaisedStreet2 as integer))
|
||||
,sum(CAST(otherRaisedStreet3 as integer))
|
||||
,sum(CAST(otherRaisedStreet4 as integer))
|
||||
,sum(CAST(foldToOtherRaisedStreet0 as integer))
|
||||
,sum(CAST(foldToOtherRaisedStreet1 as integer))
|
||||
,sum(CAST(foldToOtherRaisedStreet2 as integer))
|
||||
,sum(CAST(foldToOtherRaisedStreet3 as integer))
|
||||
|
@ -3323,14 +3478,13 @@ class Sql:
|
|||
,sum(CAST(hp.street4Raises as integer))
|
||||
FROM HandsPlayers hp
|
||||
INNER JOIN Hands h ON (h.id = hp.handId)
|
||||
INNER JOIN TourneysPlayers tp ON (tp.id = hp.tourneysPlayersId)
|
||||
INNER JOIN Tourneys t ON (t.id = tp.tourneyId)
|
||||
<tourney_join_clause>
|
||||
<where_clause>
|
||||
GROUP BY h.gametypeId
|
||||
,hp.playerId
|
||||
,h.seats
|
||||
,hc_position
|
||||
,t.tourneyTypeId
|
||||
<tourney_group_clause>
|
||||
,to_char(h.startTime, 'YYMMDD')
|
||||
"""
|
||||
else: # assume sqlite
|
||||
|
@ -3340,15 +3494,22 @@ class Sql:
|
|||
,playerId
|
||||
,activeSeats
|
||||
,position
|
||||
,tourneyTypeId
|
||||
<tourney_insert_clause>
|
||||
,styleKey
|
||||
,HDs
|
||||
,wonWhenSeenStreet1
|
||||
,wonWhenSeenStreet2
|
||||
,wonWhenSeenStreet3
|
||||
,wonWhenSeenStreet4
|
||||
,wonAtSD
|
||||
,street0VPI
|
||||
,street0Aggr
|
||||
,street0_3BChance
|
||||
,street0_3BDone
|
||||
,street0_4BChance
|
||||
,street0_4BDone
|
||||
,other3BStreet0
|
||||
,other4BStreet0
|
||||
,street1Seen
|
||||
,street2Seen
|
||||
,street3Seen
|
||||
|
@ -3358,10 +3519,12 @@ class Sql:
|
|||
,street2Aggr
|
||||
,street3Aggr
|
||||
,street4Aggr
|
||||
,otherRaisedStreet0
|
||||
,otherRaisedStreet1
|
||||
,otherRaisedStreet2
|
||||
,otherRaisedStreet3
|
||||
,otherRaisedStreet4
|
||||
,foldToOtherRaisedStreet0
|
||||
,foldToOtherRaisedStreet1
|
||||
,foldToOtherRaisedStreet2
|
||||
,foldToOtherRaisedStreet3
|
||||
|
@ -3430,15 +3593,22 @@ class Sql:
|
|||
when hp.position = '9' then 'E'
|
||||
else 'E'
|
||||
end AS hc_position
|
||||
,t.tourneyTypeId
|
||||
<tourney_select_clause>
|
||||
,'d' || substr(strftime('%Y%m%d', h.startTime),3,7)
|
||||
,count(1)
|
||||
,sum(wonWhenSeenStreet1)
|
||||
,sum(wonWhenSeenStreet2)
|
||||
,sum(wonWhenSeenStreet3)
|
||||
,sum(wonWhenSeenStreet4)
|
||||
,sum(wonAtSD)
|
||||
,sum(CAST(street0VPI as integer))
|
||||
,sum(CAST(street0Aggr as integer))
|
||||
,sum(CAST(street0_3BChance as integer))
|
||||
,sum(CAST(street0_3BDone as integer))
|
||||
,sum(CAST(street0_4BChance as integer))
|
||||
,sum(CAST(street0_4BDone as integer))
|
||||
,sum(CAST(other3BStreet0 as integer))
|
||||
,sum(CAST(other4BStreet0 as integer))
|
||||
,sum(CAST(street1Seen as integer))
|
||||
,sum(CAST(street2Seen as integer))
|
||||
,sum(CAST(street3Seen as integer))
|
||||
|
@ -3448,10 +3618,12 @@ class Sql:
|
|||
,sum(CAST(street2Aggr as integer))
|
||||
,sum(CAST(street3Aggr as integer))
|
||||
,sum(CAST(street4Aggr as integer))
|
||||
,sum(CAST(otherRaisedStreet0 as integer))
|
||||
,sum(CAST(otherRaisedStreet1 as integer))
|
||||
,sum(CAST(otherRaisedStreet2 as integer))
|
||||
,sum(CAST(otherRaisedStreet3 as integer))
|
||||
,sum(CAST(otherRaisedStreet4 as integer))
|
||||
,sum(CAST(foldToOtherRaisedStreet0 as integer))
|
||||
,sum(CAST(foldToOtherRaisedStreet1 as integer))
|
||||
,sum(CAST(foldToOtherRaisedStreet2 as integer))
|
||||
,sum(CAST(foldToOtherRaisedStreet3 as integer))
|
||||
|
@ -3504,14 +3676,13 @@ class Sql:
|
|||
,sum(CAST(hp.street4Raises as integer))
|
||||
FROM HandsPlayers hp
|
||||
INNER JOIN Hands h ON (h.id = hp.handId)
|
||||
INNER JOIN TourneysPlayers tp ON (tp.id = hp.tourneysPlayersId)
|
||||
INNER JOIN Tourneys t ON (t.id = tp.tourneyId)
|
||||
<tourney_join_clause>
|
||||
<where_clause>
|
||||
GROUP BY h.gametypeId
|
||||
,hp.playerId
|
||||
,h.seats
|
||||
,hc_position
|
||||
,t.tourneyTypeId
|
||||
<tourney_group_clause>
|
||||
,'d' || substr(strftime('%Y%m%d', h.startTime),3,7)
|
||||
"""
|
||||
|
||||
|
@ -3528,6 +3699,10 @@ class Sql:
|
|||
street0Aggr,
|
||||
street0_3BChance,
|
||||
street0_3BDone,
|
||||
street0_4BChance,
|
||||
street0_4BDone,
|
||||
other3BStreet0,
|
||||
other4BStreet0,
|
||||
street1Seen,
|
||||
street2Seen,
|
||||
street3Seen,
|
||||
|
@ -3537,15 +3712,20 @@ class Sql:
|
|||
street2Aggr,
|
||||
street3Aggr,
|
||||
street4Aggr,
|
||||
otherRaisedStreet0,
|
||||
otherRaisedStreet1,
|
||||
otherRaisedStreet2,
|
||||
otherRaisedStreet3,
|
||||
otherRaisedStreet4,
|
||||
foldToOtherRaisedStreet0,
|
||||
foldToOtherRaisedStreet1,
|
||||
foldToOtherRaisedStreet2,
|
||||
foldToOtherRaisedStreet3,
|
||||
foldToOtherRaisedStreet4,
|
||||
wonWhenSeenStreet1,
|
||||
wonWhenSeenStreet2,
|
||||
wonWhenSeenStreet3,
|
||||
wonWhenSeenStreet4,
|
||||
wonAtSD,
|
||||
raiseFirstInChance,
|
||||
raisedFirstIn,
|
||||
|
@ -3608,7 +3788,8 @@ class Sql:
|
|||
%s, %s, %s, %s, %s,
|
||||
%s, %s, %s, %s, %s,
|
||||
%s, %s, %s, %s, %s,
|
||||
%s)"""
|
||||
%s, %s, %s, %s, %s,
|
||||
%s, %s, %s, %s, %s)"""
|
||||
|
||||
self.query['update_hudcache'] = """
|
||||
UPDATE HudCache SET
|
||||
|
@ -3617,6 +3798,10 @@ class Sql:
|
|||
street0Aggr=street0Aggr+%s,
|
||||
street0_3BChance=street0_3BChance+%s,
|
||||
street0_3BDone=street0_3BDone+%s,
|
||||
street0_4BChance=street0_4BChance+%s,
|
||||
street0_4BDone=street0_4BDone+%s,
|
||||
other3BStreet0=other3BStreet0+%s,
|
||||
other4BStreet0=other4BStreet0+%s,
|
||||
street1Seen=street1Seen+%s,
|
||||
street2Seen=street2Seen+%s,
|
||||
street3Seen=street3Seen+%s,
|
||||
|
@ -3626,15 +3811,20 @@ class Sql:
|
|||
street2Aggr=street2Aggr+%s,
|
||||
street3Aggr=street3Aggr+%s,
|
||||
street4Aggr=street4Aggr+%s,
|
||||
otherRaisedStreet0=otherRaisedStreet0+%s,
|
||||
otherRaisedStreet1=otherRaisedStreet1+%s,
|
||||
otherRaisedStreet2=otherRaisedStreet2+%s,
|
||||
otherRaisedStreet3=otherRaisedStreet3+%s,
|
||||
otherRaisedStreet4=otherRaisedStreet4+%s,
|
||||
foldToOtherRaisedStreet0=foldToOtherRaisedStreet0+%s,
|
||||
foldToOtherRaisedStreet1=foldToOtherRaisedStreet1+%s,
|
||||
foldToOtherRaisedStreet2=foldToOtherRaisedStreet2+%s,
|
||||
foldToOtherRaisedStreet3=foldToOtherRaisedStreet3+%s,
|
||||
foldToOtherRaisedStreet4=foldToOtherRaisedStreet4+%s,
|
||||
wonWhenSeenStreet1=wonWhenSeenStreet1+%s,
|
||||
wonWhenSeenStreet2=wonWhenSeenStreet2+%s,
|
||||
wonWhenSeenStreet3=wonWhenSeenStreet3+%s,
|
||||
wonWhenSeenStreet4=wonWhenSeenStreet4+%s,
|
||||
wonAtSD=wonAtSD+%s,
|
||||
raiseFirstInChance=raiseFirstInChance+%s,
|
||||
raisedFirstIn=raisedFirstIn+%s,
|
||||
|
@ -3741,6 +3931,7 @@ class Sql:
|
|||
AND type=%s
|
||||
AND category=%s
|
||||
AND limitType=%s
|
||||
AND currency=%s
|
||||
AND smallBlind=%s
|
||||
AND bigBlind=%s
|
||||
"""
|
||||
|
@ -3786,9 +3977,9 @@ class Sql:
|
|||
"""
|
||||
|
||||
self.query['insertTourneyType'] = """INSERT INTO TourneyTypes
|
||||
(siteId, currency, buyin, fee, category, limitType, buyInChips, knockout, rebuy,
|
||||
(siteId, currency, buyin, fee, category, limitType, buyInChips, knockout, koBounty, rebuy,
|
||||
addOn ,speed, shootout, matrix, added, addedCurrency)
|
||||
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
|
||||
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
|
||||
"""
|
||||
|
||||
self.query['getTourneyByTourneyNo'] = """SELECT t.*
|
||||
|
@ -3797,6 +3988,22 @@ class Sql:
|
|||
WHERE tt.siteId=%s AND t.siteTourneyNo=%s
|
||||
"""
|
||||
|
||||
self.query['getTourneyInfo'] = """SELECT tt.*, t.*
|
||||
FROM Tourneys t
|
||||
INNER JOIN TourneyTypes tt ON (t.tourneyTypeId = tt.id)
|
||||
INNER JOIN Sites s ON (tt.siteId = s.id)
|
||||
WHERE s.name=%s AND t.siteTourneyNo=%s
|
||||
"""
|
||||
|
||||
self.query['getTourneyPlayerInfo'] = """SELECT tp.*
|
||||
FROM Tourneys t
|
||||
INNER JOIN TourneyTypes tt ON (t.tourneyTypeId = tt.id)
|
||||
INNER JOIN Sites s ON (tt.siteId = s.id)
|
||||
INNER JOIN TourneysPlayers tp ON (tp.tourneyId = t.id)
|
||||
INNER JOIN Players p ON (p.id = tp.playerId)
|
||||
WHERE s.name=%s AND t.siteTourneyNo=%s AND p.name=%s
|
||||
"""
|
||||
|
||||
self.query['insertTourney'] = """INSERT INTO Tourneys
|
||||
(tourneyTypeId, siteTourneyNo, entries, prizepool,
|
||||
startTime, endTime, tourneyName, matrixIdProcessed,
|
||||
|
@ -3932,6 +4139,9 @@ class Sql:
|
|||
street3CBDone,
|
||||
street4CBDone,
|
||||
wonWhenSeenStreet1,
|
||||
wonWhenSeenStreet2,
|
||||
wonWhenSeenStreet3,
|
||||
wonWhenSeenStreet4,
|
||||
street0Calls,
|
||||
street1Calls,
|
||||
street2Calls,
|
||||
|
@ -3947,10 +4157,16 @@ class Sql:
|
|||
startCards,
|
||||
street0_3BChance,
|
||||
street0_3BDone,
|
||||
street0_4BChance,
|
||||
street0_4BDone,
|
||||
other3BStreet0,
|
||||
other4BStreet0,
|
||||
otherRaisedStreet0,
|
||||
otherRaisedStreet1,
|
||||
otherRaisedStreet2,
|
||||
otherRaisedStreet3,
|
||||
otherRaisedStreet4,
|
||||
foldToOtherRaisedStreet0,
|
||||
foldToOtherRaisedStreet1,
|
||||
foldToOtherRaisedStreet2,
|
||||
foldToOtherRaisedStreet3,
|
||||
|
@ -4001,7 +4217,8 @@ class Sql:
|
|||
%s, %s, %s, %s, %s,
|
||||
%s, %s, %s, %s, %s,
|
||||
%s, %s, %s, %s, %s,
|
||||
%s
|
||||
%s, %s, %s, %s, %s,
|
||||
%s, %s, %s, %s, %s
|
||||
)"""
|
||||
|
||||
################################
|
||||
|
@ -4014,7 +4231,7 @@ class Sql:
|
|||
################################
|
||||
# queries for dumpDatabase
|
||||
################################
|
||||
for table in (u'Autorates', u'Backings', u'Gametypes', u'Hands', u'HandsActions', u'HandsPlayers', u'HudCache', u'Players', u'Settings', u'Sites', u'TourneyTypes', u'Tourneys', u'TourneysPlayers'):
|
||||
for table in (u'Autorates', u'Backings', u'Gametypes', u'Hands', u'HandsActions', u'HandsPlayers', u'HudCache', u'Players', u'RawHands', u'RawTourneys', u'Settings', u'Sites', u'TourneyTypes', u'Tourneys', u'TourneysPlayers'):
|
||||
self.query['get'+table] = u"SELECT * FROM "+table
|
||||
|
||||
################################
|
||||
|
|
299
pyfpdb/Stats.py
299
pyfpdb/Stats.py
|
@ -48,18 +48,34 @@
|
|||
# 6 For each stat you make add a line to the __main__ function to test it.
|
||||
|
||||
# Standard Library modules
|
||||
#import sys
|
||||
import sys
|
||||
|
||||
# pyGTK modules
|
||||
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
|
||||
import Charset
|
||||
|
||||
import logging
|
||||
# logging has been set up in fpdb.py or HUD_main.py, use their settings:
|
||||
log = logging.getLogger("db")
|
||||
|
||||
|
||||
re_Places = re.compile("_[0-9]$")
|
||||
re_Percent = re.compile("%$")
|
||||
|
@ -79,12 +95,23 @@ def do_stat(stat_dict, player = 24, stat = 'vpip'):
|
|||
else:
|
||||
base = stat[0:-2]
|
||||
places = int(stat[-1:])
|
||||
result = eval("%(stat)s(stat_dict, %(player)d)" % {'stat': base, 'player': player})
|
||||
result = (0.0, '0.0', 'notset=0', 'notset=0', '0', 'not set')
|
||||
try:
|
||||
result = eval("%(stat)s(stat_dict, %(player)d)" % {'stat': base, 'player': player})
|
||||
except:
|
||||
pass #
|
||||
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])
|
||||
if match is None:
|
||||
result = (result[0], "%.*f" % (places, result[0]), result[2], result[3], result[4], result[5])
|
||||
else:
|
||||
result = (result[0], "%.*f%%" % (places, 100*result[0]), result[2], result[3], result[4], result[5])
|
||||
try:
|
||||
if match is None:
|
||||
result = (result[0], "%.*f" % (places, result[0]), result[2], result[3], result[4], result[5])
|
||||
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()))
|
||||
raise
|
||||
return result
|
||||
|
||||
# OK, for reference the tuple returned by the stat is:
|
||||
|
@ -102,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."""
|
||||
|
@ -124,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):
|
||||
|
@ -144,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,
|
||||
|
@ -152,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):
|
||||
|
@ -165,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,
|
||||
|
@ -173,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):
|
||||
|
@ -186,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,
|
||||
|
@ -194,11 +221,11 @@ 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):
|
||||
""" Profit won per 100 hands (no decimal places)."""
|
||||
""" Profit won per 100 hands."""
|
||||
stat = 0.0
|
||||
try:
|
||||
stat = float(stat_dict[player]['net'])/float(stat_dict[player]['n'])
|
||||
|
@ -207,18 +234,62 @@ 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),
|
||||
'p=%.0f' % (0),
|
||||
'p/100=%.0f' % (0),
|
||||
'%.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):
|
||||
""" big blinds won per 100 hands."""
|
||||
stat = 0.0
|
||||
try:
|
||||
stat = 100.0 * float(stat_dict[player]['net']) / float(stat_dict[player]['bigblind'])
|
||||
return (stat,
|
||||
'%5.3f' % (stat),
|
||||
'bb100=%5.3f' % (stat),
|
||||
'bb100=%5.3f' % (stat),
|
||||
'(%d,%d)' % (100*stat_dict[player]['net'],stat_dict[player]['bigblind']),
|
||||
_('big blinds/100 hands')
|
||||
)
|
||||
except:
|
||||
log.info("exception calcing bb/100: "+str(stat_dict[player]))
|
||||
return (stat,
|
||||
'%.0f' % (0),
|
||||
'bb100=%.0f' % (0),
|
||||
'bb100=%.0f' % (0),
|
||||
'(%f)' % (0),
|
||||
_('big blinds/100 hands')
|
||||
)
|
||||
|
||||
def BBper100(stat_dict, player):
|
||||
""" Big Bets won per 100 hands."""
|
||||
stat = 0.0
|
||||
try:
|
||||
stat = 50 * float(stat_dict[player]['net']) / float(stat_dict[player]['bigblind'])
|
||||
return (stat,
|
||||
'%5.3f' % (stat),
|
||||
'BB100=%5.3f' % (stat),
|
||||
'BB100=%5.3f' % (stat),
|
||||
'(%d,%d)' % (100*stat_dict[player]['net'],2*stat_dict[player]['bigblind']),
|
||||
_('Big Bets/100 hands')
|
||||
)
|
||||
except:
|
||||
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')
|
||||
)
|
||||
|
||||
def saw_f(stat_dict, player):
|
||||
""" Saw flop/4th."""
|
||||
try:
|
||||
|
@ -230,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
|
||||
|
@ -241,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):
|
||||
|
@ -264,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,
|
||||
|
@ -272,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):
|
||||
|
@ -285,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,
|
||||
|
@ -293,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):
|
||||
|
@ -306,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')
|
||||
|
@ -321,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."""
|
||||
|
@ -341,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."""
|
||||
|
@ -364,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."""
|
||||
|
@ -384,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."""
|
||||
|
@ -405,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."""
|
||||
|
@ -426,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."""
|
||||
|
@ -447,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."""
|
||||
|
@ -468,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."""
|
||||
|
@ -489,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."""
|
||||
|
@ -517,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."""
|
||||
|
@ -547,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."""
|
||||
|
@ -575,22 +627,19 @@ 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):
|
||||
|
||||
""" Flop continuation bet."""
|
||||
""" Continuation bet % = (times made a continuation bet on the flop) * 100 / (number of opportunities to make a continuation bet on the flop) """
|
||||
""" Total continuation bet."""
|
||||
""" Continuation bet % = (times made a continuation bet on any street) * 100 / (number of opportunities to make a continuation bet on any street) """
|
||||
|
||||
stat = 0.0
|
||||
try:
|
||||
|
@ -602,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."""
|
||||
|
@ -623,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."""
|
||||
|
@ -644,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."""
|
||||
|
@ -665,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."""
|
||||
|
@ -686,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."""
|
||||
|
@ -707,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,
|
||||
'%3.1f' % (0) + '%',
|
||||
'ff1=%3.1f' % (0) + '%',
|
||||
'ff_1=%3.1f' % (0) + '%',
|
||||
'(%d/%d)' % (0, 0),
|
||||
'% fold frequency flop/4th'
|
||||
)
|
||||
'NA',
|
||||
'ff1=NA',
|
||||
'ff_1=NA',
|
||||
'(0/0)',
|
||||
_('% fold frequency flop/4th'))
|
||||
|
||||
def ffreq2(stat_dict, player):
|
||||
""" Turn/5th fold frequency."""
|
||||
|
@ -728,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."""
|
||||
|
@ -749,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."""
|
||||
|
@ -770,25 +803,37 @@ 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()
|
||||
misslist = [ "Configuration", "Database", "Charset", "codecs", "encoder"
|
||||
, "do_stat", "do_tip", "GInitiallyUnowned", "gtk", "pygtk"
|
||||
, "re", "re_Percent", "re_Places"
|
||||
]
|
||||
statlist = [ x for x in statlist if x not in dir(sys) ]
|
||||
statlist = [ x for x in statlist if x not in dir(codecs) ]
|
||||
statlist = [ x for x in statlist if x not in misslist ]
|
||||
#print "statlist is", statlist
|
||||
|
||||
c = Configuration.Config()
|
||||
#TODO: restore the below code. somehow it creates a version 119 DB but commenting this out makes it print a stat list
|
||||
#db_connection = Database.Database(c)
|
||||
#h = db_connection.get_last_hand()
|
||||
#stat_dict = db_connection.get_stats_from_hand(h, "ring")
|
||||
db_connection = Database.Database(c)
|
||||
h = db_connection.get_last_hand()
|
||||
stat_dict = db_connection.get_stats_from_hand(h, "ring")
|
||||
|
||||
#for player in stat_dict.keys():
|
||||
for player in stat_dict.keys():
|
||||
print (_("Example stats, player = %s hand = %s:") % (player, h))
|
||||
for attr in statlist:
|
||||
print " ", do_stat(stat_dict, player=player, stat=attr)
|
||||
break
|
||||
#print "player = ", player, do_stat(stat_dict, player = player, stat = 'vpip')
|
||||
#print "player = ", player, do_stat(stat_dict, player = player, stat = 'pfr')
|
||||
#print "player = ", player, do_stat(stat_dict, player = player, stat = 'wtsd')
|
||||
|
@ -818,13 +863,9 @@ 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"
|
||||
for attr in dir():
|
||||
if attr.startswith('__'): continue
|
||||
if attr in ("Configuration", "Database", "GInitiallyUnowned", "gtk", "pygtk",
|
||||
"player", "c", "db_connection", "do_stat", "do_tip", "stat_dict",
|
||||
"h", "re", "re_Percent", "re_Places"): continue
|
||||
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)
|
||||
print
|
||||
|
|
|
@ -29,8 +29,19 @@ import os
|
|||
import sys
|
||||
import re
|
||||
|
||||
# Win32 modules
|
||||
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
|
||||
|
||||
# Win32 modules
|
||||
if os.name == 'nt':
|
||||
import win32gui
|
||||
import win32process
|
||||
|
@ -220,7 +231,7 @@ def discover_nt(c):
|
|||
tw.site = "Full Tilt"
|
||||
else:
|
||||
tw.site = "Unknown"
|
||||
sys.stderr.write("Found unknown table = %s" % tw.title)
|
||||
sys.stderr.write(_("Found unknown table = %s") % tw.title)
|
||||
if tw.site != "Unknown":
|
||||
eval("%s(tw)" % c.supported_sites[tw.site].decoder)
|
||||
else:
|
||||
|
@ -247,7 +258,7 @@ def discover_nt_by_name(c, tablename):
|
|||
if 'Chat:' in titles[hwnd]: continue # Some sites (FTP? PS? Others?) have seperable or seperately constructed chat windows
|
||||
if ' - Table ' in titles[hwnd]: continue # Absolute table Chat window.. sigh. TODO: Can we tell what site we're trying to discover for somehow in here, so i can limit this check just to AP searches?
|
||||
temp = decode_windows(c, titles[hwnd], hwnd)
|
||||
print "attach to window", temp
|
||||
print _("attach to window"), temp
|
||||
return temp
|
||||
return None
|
||||
|
||||
|
@ -434,5 +445,5 @@ if __name__=="__main__":
|
|||
for t in tables.keys():
|
||||
print tables[t]
|
||||
|
||||
print "press enter to continue"
|
||||
print _("press enter to continue")
|
||||
sys.stdin.readline()
|
||||
|
|
|
@ -36,6 +36,18 @@ import gobject
|
|||
import Configuration
|
||||
from HandHistoryConverter import getTableTitleRe
|
||||
|
||||
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
|
||||
|
||||
# get the correct module for the current os
|
||||
if os.name == 'posix':
|
||||
import XTables as Tables
|
||||
|
@ -57,7 +69,7 @@ if __name__=="__main__":
|
|||
self.main_window.connect("destroy", self.client_destroyed)
|
||||
self.label = gtk.Label('Fake Fake Fake Fake\nFake\nFake\nFake')
|
||||
self.main_window.add(self.label)
|
||||
self.main_window.set_title("Fake HUD Main Window")
|
||||
self.main_window.set_title(_("Fake HUD Main Window"))
|
||||
self.main_window.move(table.x + dx, table.y + dy)
|
||||
self.main_window.show_all()
|
||||
table.topify(self)
|
||||
|
@ -80,7 +92,7 @@ if __name__=="__main__":
|
|||
hud.main_window.emit(result, hud)
|
||||
return True
|
||||
|
||||
print "enter table name to find: ",
|
||||
print _("enter table name to find: "),
|
||||
table_name = sys.stdin.readline()
|
||||
if "," in table_name: # tournament
|
||||
print "tournament"
|
||||
|
@ -105,6 +117,6 @@ if __name__=="__main__":
|
|||
fake = fake_hud(table)
|
||||
print "fake =", fake
|
||||
# gobject.timeout_add(100, check_on_table, table, fake)
|
||||
print "calling main"
|
||||
print _("calling main")
|
||||
gtk.main()
|
||||
|
||||
|
|
94
pyfpdb/TestHandsPlayers.py
Normal file
94
pyfpdb/TestHandsPlayers.py
Normal file
|
@ -0,0 +1,94 @@
|
|||
import sys
|
||||
import os
|
||||
import codecs
|
||||
import pprint
|
||||
import PokerStarsToFpdb
|
||||
from Hand import *
|
||||
import Configuration
|
||||
import Database
|
||||
import SQL
|
||||
import fpdb_import
|
||||
|
||||
def error_report( filename, hand, stat, ghash, testhash, player):
|
||||
print "Regression Test Error:"
|
||||
print "\tFile: %s" % filename
|
||||
print "\tStat: %s" % stat
|
||||
print "\tPlayer: %s" % player
|
||||
|
||||
def compare(leaf, importer):
|
||||
filename = leaf
|
||||
#print "DEBUG: fileanme: %s" % filename
|
||||
|
||||
# Test if this is a hand history file
|
||||
if filename.endswith('.txt'):
|
||||
# test if there is a .hp version of the file
|
||||
importer.addBulkImportImportFileOrDir(filename, site="PokerStars")
|
||||
(stored, dups, partial, errs, ttime) = importer.runImport()
|
||||
if os.path.isfile(filename + '.hp'):
|
||||
# Compare them
|
||||
hashfilename = filename + '.hp'
|
||||
|
||||
in_fh = codecs.open(hashfilename, 'r', 'utf8')
|
||||
whole_file = in_fh.read()
|
||||
in_fh.close()
|
||||
|
||||
testhash = eval(whole_file)
|
||||
|
||||
hhc = importer.getCachedHHC()
|
||||
handlist = hhc.getProcessedHands()
|
||||
#We _really_ only want to deal with a single hand here.
|
||||
for hand in handlist:
|
||||
ghash = hand.stats.getHandsPlayers()
|
||||
for p in ghash:
|
||||
#print "DEBUG: player: '%s'" % p
|
||||
pstat = ghash[p]
|
||||
teststat = testhash[p]
|
||||
|
||||
for stat in pstat:
|
||||
#print "pstat[%s][%s]: %s == %s" % (p, stat, pstat[stat], teststat[stat])
|
||||
if pstat[stat] == teststat[stat]:
|
||||
# The stats match - continue
|
||||
pass
|
||||
else:
|
||||
# Stats don't match - Doh!
|
||||
error_report(filename, hand, stat, ghash, testhash, p)
|
||||
|
||||
importer.clearFileList()
|
||||
|
||||
|
||||
|
||||
def walk_testfiles(dir, function, importer):
|
||||
"""Walks a directory, and executes a callback on each file """
|
||||
dir = os.path.abspath(dir)
|
||||
for file in [file for file in os.listdir(dir) if not file in [".",".."]]:
|
||||
nfile = os.path.join(dir,file)
|
||||
if os.path.isdir(nfile):
|
||||
walk_testfiles(nfile, compare, importer)
|
||||
else:
|
||||
compare(nfile, importer)
|
||||
|
||||
def main(argv=None):
|
||||
if argv is None:
|
||||
argv = sys.argv[1:]
|
||||
|
||||
config = Configuration.Config(file = "HUD_config.test.xml")
|
||||
db = Database.Database(config)
|
||||
sql = SQL.Sql(db_server = 'sqlite')
|
||||
settings = {}
|
||||
settings.update(config.get_db_parameters())
|
||||
settings.update(config.get_tv_parameters())
|
||||
settings.update(config.get_import_parameters())
|
||||
settings.update(config.get_default_paths())
|
||||
db.recreate_tables()
|
||||
importer = fpdb_import.Importer(False, settings, config)
|
||||
importer.setDropIndexes("don't drop")
|
||||
importer.setFailOnError(True)
|
||||
importer.setThreads(-1)
|
||||
importer.setCallHud(False)
|
||||
importer.setFakeCacheHHC(True)
|
||||
|
||||
walk_testfiles("regression-test-files/cash/Stars/", compare, importer)
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
|
|
@ -34,8 +34,20 @@ import traceback
|
|||
|
||||
(options, argv) = Options.fpdb_options()
|
||||
|
||||
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
|
||||
|
||||
if not options.errorsToConsole:
|
||||
print "Note: error output is being diverted to fpdb-error-log.txt and HUD-error.txt. Any major error will be reported there _only_."
|
||||
print _("Note: error output is being diverted to fpdb-error-log.txt and HUD-error.txt. Any major error will be reported there _only_.")
|
||||
errorFile = open('tourneyerror.txt', 'w', 0)
|
||||
sys.stderr = errorFile
|
||||
|
||||
|
@ -96,10 +108,10 @@ class Tournament:
|
|||
self.window.show() # isn't there a better way to bring something to the front? not that GTK focus works right anyway, ever
|
||||
else:
|
||||
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
|
||||
print "tournament edit window=", self.window
|
||||
print _("tournament edit window="), self.window
|
||||
self.window.connect("delete_event", self.delete_event)
|
||||
self.window.connect("destroy", self.destroy)
|
||||
self.window.set_title("FPDB Tournament Entry")
|
||||
self.window.set_title(_("FPDB Tournament Entry"))
|
||||
self.window.set_border_width(1)
|
||||
self.window.set_default_size(480,640)
|
||||
self.window.set_resizable(True)
|
||||
|
@ -139,14 +151,14 @@ class ttracker_main(object):
|
|||
self.main_window = gtk.Window()
|
||||
self.main_window.connect("destroy", self.destroy)
|
||||
self.vb = gtk.VBox()
|
||||
self.label = gtk.Label('Closing this window will stop the Tournament Tracker')
|
||||
self.label = gtk.Label(_('Closing this window will stop the Tournament Tracker'))
|
||||
self.vb.add(self.label)
|
||||
self.addbutton = gtk.Button(label="Enter Tournament")
|
||||
self.addbutton = gtk.Button(label=_("Enter Tournament"))
|
||||
self.addbutton.connect("clicked", self.addClicked, "add tournament")
|
||||
self.vb.add(self.addbutton)
|
||||
|
||||
self.main_window.add(self.vb)
|
||||
self.main_window.set_title("FPDB Tournament Tracker")
|
||||
self.main_window.set_title(_("FPDB Tournament Tracker"))
|
||||
self.main_window.show_all()
|
||||
|
||||
def addClicked(self, widget, data): # what is "data"? i'm guessing anything i pass in after the function name in connect() but unsure because the documentation sucks
|
||||
|
@ -157,10 +169,10 @@ class ttracker_main(object):
|
|||
self.tourney_list.append(t)
|
||||
mylabel = gtk.Label("%s - %s - %s - %s - %s %s - %s - %s - %s - %s - %s" % (t.site, t.id, t.starttime, t.endtime, t.structure, t.game, t.buyin, t.fee, t.numrebuys, t.numplayers, t.prizepool))
|
||||
print "new label=", mylabel
|
||||
editbutton = gtk.Button(label="Edit")
|
||||
editbutton = gtk.Button(label=_("Edit"))
|
||||
print "new button=", editbutton
|
||||
editbutton.connect("clicked", t.openwindow)
|
||||
rebuybutton = gtk.Button(label="Rebuy")
|
||||
rebuybutton = gtk.Button(label=_("Rebuy"))
|
||||
rebuybutton.connect("clicked", t.addrebuy)
|
||||
self.vb.add(rebuybutton)
|
||||
self.vb.add(editbutton) # These should probably be put in.. a.. h-box? i don't know..
|
||||
|
@ -259,9 +271,9 @@ class ttracker_main(object):
|
|||
cards['common'] = comm_cards['common']
|
||||
except Exception, err:
|
||||
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
||||
print "db error: skipping "+str(new_hand_id)+" "+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
||||
print _("db error: skipping ")+str(new_hand_id)+" "+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
||||
if new_hand_id: # new_hand_id is none if we had an error prior to the store
|
||||
sys.stderr.write("Database error %s in hand %d. Skipping.\n" % (err, int(new_hand_id)))
|
||||
sys.stderr.write(_("Database error %s in hand %d. Skipping.\n") % (err, int(new_hand_id)))
|
||||
continue
|
||||
|
||||
if type == "tour": # hand is from a tournament
|
||||
|
@ -270,8 +282,8 @@ class ttracker_main(object):
|
|||
(tour_number, tab_number) = mat_obj.group(1, 2)
|
||||
temp_key = tour_number
|
||||
else: # tourney, but can't get number and table
|
||||
print "could not find tournament: skipping "
|
||||
sys.stderr.write("Could not find tournament %d in hand %d. Skipping.\n" % (int(tour_number), int(new_hand_id)))
|
||||
print _("could not find tournament: skipping")
|
||||
sys.stderr.write(_("Could not find tournament %d in hand %d. Skipping.\n") % (int(tour_number), int(new_hand_id)))
|
||||
continue
|
||||
|
||||
else:
|
||||
|
@ -294,15 +306,15 @@ class ttracker_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)
|
||||
sys.stderr.write("table name "+table_name+" not found, skipping.\n")
|
||||
sys.stderr.write(_("table name %s not found, skipping.\n")% table_name)
|
||||
else:
|
||||
self.create_HUD(new_hand_id, tablewindow, temp_key, max, poker_game, stat_dict, cards)
|
||||
self.db_connection.connection.rollback()
|
||||
|
||||
if __name__== "__main__":
|
||||
|
||||
sys.stderr.write("tournament tracker starting\n")
|
||||
sys.stderr.write("Using db name = %s\n" % (options.dbname))
|
||||
sys.stderr.write(_("tournament tracker starting\n"))
|
||||
sys.stderr.write(_("Using db name = %s\n") % (options.dbname))
|
||||
|
||||
# start the HUD_main object
|
||||
hm = ttracker_main(db_name = options.dbname)
|
||||
|
|
|
@ -29,6 +29,17 @@ from time import gmtime, mktime, strftime, strptime
|
|||
import logging #logging has been set up in fpdb.py or HUD_main.py, use their settings:
|
||||
log = logging.getLogger("filter")
|
||||
|
||||
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
|
||||
#import Database
|
||||
|
@ -45,9 +56,9 @@ class TourneyFilters(Filters.Filters):
|
|||
self.conf = db.config
|
||||
self.display = display
|
||||
|
||||
self.filterText = {'playerstitle':'Hero:', 'sitestitle':'Sites:', 'seatstitle':'Number of Players:',
|
||||
'seatsbetween':'Between:', 'seatsand':'And:', 'datestitle':'Date:',
|
||||
'tourneyTypesTitle':'Tourney Type'}
|
||||
self.filterText = {'playerstitle':_('Hero:'), 'sitestitle':_('Sites:'), 'seatstitle':_('Number of Players:'),
|
||||
'seatsbetween':_('Between:'), 'seatsand':_('And:'), 'datestitle':_('Date:'),
|
||||
'tourneyTypesTitle':_('Tourney Type')}
|
||||
|
||||
gen = self.conf.get_general_params()
|
||||
self.day_start = 0
|
||||
|
@ -74,7 +85,7 @@ class TourneyFilters(Filters.Filters):
|
|||
self.numTourneys = int(w.get_text())
|
||||
except:
|
||||
self.numTourneys = 0
|
||||
print "setting numTourneys:", self.numTourneys
|
||||
print _("setting numTourneys:"), self.numTourneys
|
||||
#end def __set_num_tourneys
|
||||
|
||||
def __toggle_box(self, widget, entry): #identical with Filters
|
||||
|
@ -102,7 +113,7 @@ class TourneyFilters(Filters.Filters):
|
|||
if len(result) == 1:
|
||||
self.siteid[site] = result[0][0]
|
||||
else:
|
||||
print "Either 0 or more than one site matched (%s) - EEK" % site
|
||||
print _("Either 0 or more than one site matched (%s) - EEK") % site
|
||||
|
||||
# For use in date ranges.
|
||||
self.start_date = gtk.Entry(max=12)
|
||||
|
|
|
@ -30,6 +30,19 @@ import operator
|
|||
import time,datetime
|
||||
from copy import deepcopy
|
||||
from Exceptions import *
|
||||
|
||||
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 pprint
|
||||
import DerivedStats
|
||||
import Card
|
||||
|
@ -118,59 +131,59 @@ class TourneySummary(object):
|
|||
|
||||
def __str__(self):
|
||||
#TODO : Update
|
||||
vars = ( ("SITE", self.siteName),
|
||||
("START TIME", self.startTime),
|
||||
("END TIME", self.endTime),
|
||||
("TOURNEY NAME", self.tourneyName),
|
||||
("TOURNEY NO", self.tourNo),
|
||||
("TOURNEY TYPE ID", self.tourneyTypeId),
|
||||
("TOURNEY ID", self.tourneyId),
|
||||
("BUYIN", self.buyin),
|
||||
("FEE", self.fee),
|
||||
("CURRENCY", self.currency),
|
||||
("HERO", self.hero),
|
||||
("MAXSEATS", self.maxseats),
|
||||
("ENTRIES", self.entries),
|
||||
("SPEED", self.speed),
|
||||
("PRIZE POOL", self.prizepool),
|
||||
("STARTING CHIP COUNT", self.buyInChips),
|
||||
("MIXED", self.mixed),
|
||||
("REBUY", self.isRebuy),
|
||||
("ADDON", self.isAddOn),
|
||||
("KO", self.isKO),
|
||||
("MATRIX", self.isMatrix),
|
||||
("MATRIX ID PROCESSED", self.matrixIdProcessed),
|
||||
("SHOOTOUT", self.isShootout),
|
||||
("MATRIX MATCH ID", self.matrixMatchId),
|
||||
("SUB TOURNEY BUY IN", self.subTourneyBuyin),
|
||||
("SUB TOURNEY FEE", self.subTourneyFee),
|
||||
("REBUY CHIPS", self.rebuyChips),
|
||||
("ADDON CHIPS", self.addOnChips),
|
||||
("REBUY COST", self.rebuyCost),
|
||||
("ADDON COST", self.addOnCost),
|
||||
("TOTAL REBUYS", self.totalRebuyCount),
|
||||
("TOTAL ADDONS", self.totalAddOnCount),
|
||||
("KO BOUNTY", self.koBounty),
|
||||
("TOURNEY COMMENT", self.tourneyComment),
|
||||
("SNG", self.isSng),
|
||||
("SATELLITE", self.isSatellite),
|
||||
("DOUBLE OR NOTHING", self.isDoubleOrNothing),
|
||||
("GUARANTEE", self.guarantee),
|
||||
("ADDED", self.added),
|
||||
("ADDED CURRENCY", self.addedCurrency),
|
||||
("COMMENT", self.comment),
|
||||
("COMMENT TIMESTAMP", self.commentTs)
|
||||
vars = ( (_("SITE"), self.siteName),
|
||||
(_("START TIME"), self.startTime),
|
||||
(_("END TIME"), self.endTime),
|
||||
(_("TOURNEY NAME"), self.tourneyName),
|
||||
(_("TOURNEY NO"), self.tourNo),
|
||||
(_("TOURNEY TYPE ID"), self.tourneyTypeId),
|
||||
(_("TOURNEY ID"), self.tourneyId),
|
||||
(_("BUYIN"), self.buyin),
|
||||
(_("FEE"), self.fee),
|
||||
(_("CURRENCY"), self.currency),
|
||||
(_("HERO"), self.hero),
|
||||
(_("MAXSEATS"), self.maxseats),
|
||||
(_("ENTRIES"), self.entries),
|
||||
(_("SPEED"), self.speed),
|
||||
(_("PRIZE POOL"), self.prizepool),
|
||||
(_("STARTING CHIP COUNT"), self.buyInChips),
|
||||
(_("MIXED"), self.mixed),
|
||||
(_("REBUY"), self.isRebuy),
|
||||
(_("ADDON"), self.isAddOn),
|
||||
(_("KO"), self.isKO),
|
||||
(_("MATRIX"), self.isMatrix),
|
||||
(_("MATRIX ID PROCESSED"), self.matrixIdProcessed),
|
||||
(_("SHOOTOUT"), self.isShootout),
|
||||
(_("MATRIX MATCH ID"), self.matrixMatchId),
|
||||
(_("SUB TOURNEY BUY IN"), self.subTourneyBuyin),
|
||||
(_("SUB TOURNEY FEE"), self.subTourneyFee),
|
||||
(_("REBUY CHIPS"), self.rebuyChips),
|
||||
(_("ADDON CHIPS"), self.addOnChips),
|
||||
(_("REBUY COST"), self.rebuyCost),
|
||||
(_("ADDON COST"), self.addOnCost),
|
||||
(_("TOTAL REBUYS"), self.totalRebuyCount),
|
||||
(_("TOTAL ADDONS"), self.totalAddOnCount),
|
||||
(_("KO BOUNTY"), self.koBounty),
|
||||
(_("TOURNEY COMMENT"), self.tourneyComment),
|
||||
(_("SNG"), self.isSng),
|
||||
(_("SATELLITE"), self.isSatellite),
|
||||
(_("DOUBLE OR NOTHING"), self.isDoubleOrNothing),
|
||||
(_("GUARANTEE"), self.guarantee),
|
||||
(_("ADDED"), self.added),
|
||||
(_("ADDED CURRENCY"), self.addedCurrency),
|
||||
(_("COMMENT"), self.comment),
|
||||
(_("COMMENT TIMESTAMP"), self.commentTs)
|
||||
)
|
||||
|
||||
structs = ( ("PLAYER IDS", self.playerIds),
|
||||
("PLAYERS", self.players),
|
||||
("TOURNEYS PLAYERS IDS", self.tourneysPlayersIds),
|
||||
("RANKS", self.ranks),
|
||||
("WINNINGS", self.winnings),
|
||||
("WINNINGS CURRENCY", self.winningsCurrency),
|
||||
("COUNT REBUYS", self.rebuyCounts),
|
||||
("COUNT ADDONS", self.addOnCounts),
|
||||
("NB OF KO", self.koCounts)
|
||||
structs = ( (_("PLAYER IDS"), self.playerIds),
|
||||
(_("PLAYERS"), self.players),
|
||||
(_("TOURNEYS PLAYERS IDS"), self.tourneysPlayersIds),
|
||||
(_("RANKS"), self.ranks),
|
||||
(_("WINNINGS"), self.winnings),
|
||||
(_("WINNINGS CURRENCY"), self.winningsCurrency),
|
||||
(_("COUNT REBUYS"), self.rebuyCounts),
|
||||
(_("COUNT ADDONS"), self.addOnCounts),
|
||||
(_("NB OF KO"), self.koCounts)
|
||||
)
|
||||
str = ''
|
||||
for (name, var) in vars:
|
||||
|
@ -217,7 +230,7 @@ class TourneySummary(object):
|
|||
self.tourneysPlayersIds = self.db.createOrUpdateTourneysPlayers(self, "TS")
|
||||
self.db.commit()
|
||||
|
||||
logging.debug("Tourney Insert/Update done")
|
||||
logging.debug(_("Tourney Insert/Update done"))
|
||||
|
||||
# TO DO : Return what has been done (tourney created, updated, nothing)
|
||||
# ?? stored = 1 if tourney is fully created / duplicates = 1, if everything was already here and correct / partial=1 if some things were already here (between tourney, tourneysPlayers and handsPlayers)
|
||||
|
@ -237,7 +250,7 @@ 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)
|
||||
"""
|
||||
log.debug("addPlayer: rank:%s - name : '%s' - Winnings (%s)" % (rank, name, winnings))
|
||||
log.debug(_("addPlayer: rank:%s - name : '%s' - Winnings (%s)") % (rank, name, winnings))
|
||||
self.players.append(name)
|
||||
if rank:
|
||||
self.ranks.update( { name : Decimal(rank) } )
|
||||
|
@ -264,7 +277,7 @@ winnings (decimal) the money the player ended the tourney with (can be 0, or
|
|||
#end def addPlayer
|
||||
|
||||
def incrementPlayerWinnings(self, name, additionnalWinnings):
|
||||
log.debug("incrementPlayerWinnings: name : '%s' - Add Winnings (%s)" % (name, additionnalWinnings))
|
||||
log.debug(_("incrementPlayerWinnings: name : '%s' - Add Winnings (%s)") % (name, additionnalWinnings))
|
||||
oldWins = 0
|
||||
if self.winnings.has_key(name):
|
||||
oldWins = self.winnings[name]
|
||||
|
|
|
@ -67,10 +67,10 @@ class Table(Table_Window):
|
|||
|
||||
try:
|
||||
if self.window == None:
|
||||
log.error( "Window %s not found. Skipping." % search_string )
|
||||
log.error(_("Window %s not found. Skipping.") % search_string )
|
||||
return None
|
||||
except AttributeError:
|
||||
log.error( "self.window doesn't exist? why?" )
|
||||
log.error(_("self.window doesn't exist? why?"))
|
||||
return None
|
||||
|
||||
(x, y, width, height) = win32gui.GetWindowRect(hwnd)
|
||||
|
|
1
pyfpdb/create-mo-files.sh
Executable file
1
pyfpdb/create-mo-files.sh
Executable file
|
@ -0,0 +1 @@
|
|||
python /usr/share/doc/python-2.7/examples/Tools/i18n/msgfmt.py --output-file=locale/hu/LC_MESSAGES/fpdb.mo locale/fpdb-hu_HU.po
|
2
pyfpdb/create-po-file.sh
Executable file
2
pyfpdb/create-po-file.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
python /usr/share/doc/python-2.7/examples/Tools/i18n/pygettext.py --output-dir=locale --default-domain=fpdb --output=fpdb-en_GB.po *.py*
|
||||
|
356
pyfpdb/fpdb.pyw
356
pyfpdb/fpdb.pyw
|
@ -20,28 +20,40 @@ import sys
|
|||
import re
|
||||
import Queue
|
||||
|
||||
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
|
||||
|
||||
# if path is set to use an old version of python look for a new one:
|
||||
# (does this work in linux?)
|
||||
if os.name == 'nt' and sys.version[0:3] not in ('2.5', '2.6') and '-r' not in sys.argv:
|
||||
if os.name == 'nt' and sys.version[0:3] not in ('2.5', '2.6', '2.7') and '-r' not in sys.argv:
|
||||
#print "old path =", os.environ['PATH']
|
||||
dirs = re.split(os.pathsep, os.environ['PATH'])
|
||||
# remove any trailing / or \ chars from dirs:
|
||||
dirs = [re.sub('[\\/]$','',p) for p in dirs]
|
||||
# remove any dirs containing 'python' apart from those ending in 'python25', 'python26' or 'python':
|
||||
dirs = [p for p in dirs if not re.search('python', p, re.I) or re.search('python25$', p, re.I) or re.search('python26$', p, re.I)]
|
||||
dirs = [p for p in dirs if not re.search('python', p, re.I) or re.search('python25$', p, re.I) or re.search('python26$', p, re.I) or re.search('python27$', p, re.I)]
|
||||
tmppath = ";".join(dirs)
|
||||
#print "new path =", tmppath
|
||||
if re.search('python', tmppath, re.I):
|
||||
os.environ['PATH'] = tmppath
|
||||
print "Python " + sys.version[0:3] + ' - press return to continue\n'
|
||||
print "Python " + sys.version[0:3] + _(' - press return to continue\n')
|
||||
sys.stdin.readline()
|
||||
if os.name=='nt':
|
||||
os.execvpe('pythonw.exe', ('pythonw.exe', 'fpdb.pyw', '-r'), os.environ) # first arg is ignored (name of program being run)
|
||||
else:
|
||||
os.execvpe('python', ('python', 'fpdb.pyw', '-r'), os.environ) # first arg is ignored (name of program being run)
|
||||
else:
|
||||
print "\npython 2.5 not found, please install python 2.5 or 2.6 for fpdb\n"
|
||||
raw_input("Press ENTER to continue.")
|
||||
print _("\npython 2.5 not found, please install python 2.5, 2.6 or 2.7 for fpdb\n")
|
||||
raw_input(_("Press ENTER to continue."))
|
||||
exit()
|
||||
else:
|
||||
pass
|
||||
|
@ -52,8 +64,8 @@ if os.name == 'nt':
|
|||
import win32api
|
||||
import win32con
|
||||
except ImportError:
|
||||
print "We appear to be running in Windows, but the Windows Python Extensions are not loading. Please install the PYWIN32 package from http://sourceforge.net/projects/pywin32/"
|
||||
raw_input("Press ENTER to continue.")
|
||||
print _("We appear to be running in Windows, but the Windows Python Extensions are not loading. Please install the PYWIN32 package from http://sourceforge.net/projects/pywin32/")
|
||||
raw_input(_("Press ENTER to continue."))
|
||||
exit()
|
||||
|
||||
print "Python " + sys.version[0:3] + '...'
|
||||
|
@ -74,8 +86,8 @@ try:
|
|||
import gtk
|
||||
import pango
|
||||
except:
|
||||
print "Unable to load PYGTK modules required for GUI. Please install PyCairo, PyGObject, and PyGTK from www.pygtk.org."
|
||||
raw_input("Press ENTER to continue.")
|
||||
print _("Unable to load PYGTK modules required for GUI. Please install PyCairo, PyGObject, and PyGTK from www.pygtk.org.")
|
||||
raw_input(_("Press ENTER to continue."))
|
||||
exit()
|
||||
|
||||
import interlocks
|
||||
|
@ -103,9 +115,10 @@ import GuiPrefs
|
|||
import GuiLogView
|
||||
import GuiDatabase
|
||||
import GuiBulkImport
|
||||
import ImapFetcher
|
||||
import GuiImapFetcher
|
||||
import GuiRingPlayerStats
|
||||
import GuiTourneyPlayerStats
|
||||
import GuiTourneyViewer
|
||||
import GuiPositionalStats
|
||||
import GuiAutoImport
|
||||
import GuiGraphViewer
|
||||
|
@ -116,7 +129,7 @@ import Configuration
|
|||
import Exceptions
|
||||
import Stats
|
||||
|
||||
VERSION = "0.20.902 plus git"
|
||||
VERSION = "0.20.904 plus git"
|
||||
|
||||
|
||||
class fpdb:
|
||||
|
@ -228,23 +241,22 @@ class fpdb:
|
|||
self.quit(widget)
|
||||
|
||||
def dia_about(self, widget, data=None):
|
||||
#self.warning_box("About FPDB:\n\nFPDB was originally created by a guy named Steffen, sometime in 2008, \nand is mostly worked on these days by people named Eratosthenes, s0rrow, _mt, EricBlade, sqlcoder, and other strange people.\n\n", "ABOUT FPDB")
|
||||
dia = gtk.AboutDialog()
|
||||
dia.set_name("Free Poker Database (FPDB)")
|
||||
dia.set_version(VERSION)
|
||||
dia.set_copyright("Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, sqlcoder, Bostik, and others")
|
||||
dia.set_comments("")
|
||||
dia.set_license("This program is licensed under the AGPL3, see agpl-3.0.txt in the fpdb installation directory")
|
||||
dia.set_copyright(_("Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, sqlcoder, Bostik, and others"))
|
||||
dia.set_comments(_("You are free to change, and distribute original or changed versions of fpdb within the rules set out by the license"))
|
||||
dia.set_license(_("Please see fpdb's start screen for license information"))
|
||||
dia.set_website("http://fpdb.sourceforge.net/")
|
||||
|
||||
dia.set_authors(['Steffen', 'Eratosthenes', 'Carl Gherardi',
|
||||
'Eric Blade', '_mt', 'sqlcoder', 'Bostik', 'and others'])
|
||||
'Eric Blade', '_mt', 'sqlcoder', 'Bostik', _('and others')])
|
||||
dia.set_program_name("Free Poker Database (FPDB)")
|
||||
|
||||
db_version = ""
|
||||
#if self.db is not None:
|
||||
# db_version = self.db.get_version()
|
||||
nums = [ ('Operating System', os.name)
|
||||
nums = [ (_('Operating System'), os.name)
|
||||
, ('Python', sys.version[0:3])
|
||||
, ('GTK+', '.'.join([str(x) for x in gtk.gtk_version]))
|
||||
, ('PyGTK', '.'.join([str(x) for x in gtk.pygtk_version]))
|
||||
|
@ -264,24 +276,24 @@ class fpdb:
|
|||
view.show()
|
||||
dia.vbox.pack_end(view, True, True, 2)
|
||||
|
||||
l = gtk.Label("Your config file is: "+self.config.file)
|
||||
l = gtk.Label(_("Your config file is: ")+self.config.file)
|
||||
l.set_alignment(0.5, 0.5)
|
||||
l.show()
|
||||
dia.vbox.pack_end(l, True, True, 2)
|
||||
|
||||
l = gtk.Label('Version Information:')
|
||||
l = gtk.Label(_('Version Information:'))
|
||||
l.set_alignment(0.5, 0.5)
|
||||
l.show()
|
||||
dia.vbox.pack_end(l, True, True, 2)
|
||||
|
||||
dia.run()
|
||||
dia.destroy()
|
||||
log.debug("Threads: ")
|
||||
log.debug(_("Threads: "))
|
||||
for t in self.threads:
|
||||
log.debug("........." + str(t.__class__))
|
||||
|
||||
def dia_preferences(self, widget, data=None):
|
||||
dia = gtk.Dialog("Preferences",
|
||||
dia = gtk.Dialog(_("Preferences"),
|
||||
self.window,
|
||||
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||
(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
|
||||
|
@ -299,8 +311,7 @@ class fpdb:
|
|||
dia.destroy()
|
||||
else:
|
||||
dia.destroy() # destroy prefs before raising warning, otherwise parent is dia rather than self.window
|
||||
self.warning_box("Updated preferences have not been loaded because "
|
||||
+ "windows are open. Re-start fpdb to load them.")
|
||||
self.warning_box(_("Updated preferences have not been loaded because windows are open. Re-start fpdb to load them."))
|
||||
else:
|
||||
dia.destroy()
|
||||
|
||||
|
@ -310,7 +321,7 @@ class fpdb:
|
|||
if len(self.tab_names) == 1:
|
||||
if self.obtain_global_lock("dia_maintain_dbs"): # returns true if successful
|
||||
# only main tab has been opened, open dialog
|
||||
dia = gtk.Dialog("Maintain Databases",
|
||||
dia = gtk.Dialog(_("Maintain Databases"),
|
||||
self.window,
|
||||
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||
(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
|
||||
|
@ -320,27 +331,26 @@ class fpdb:
|
|||
prefs = GuiDatabase.GuiDatabase(self.config, self.window, dia)
|
||||
response = dia.run()
|
||||
if response == gtk.RESPONSE_ACCEPT:
|
||||
log.info('saving updated db data')
|
||||
log.info(_('saving updated db data'))
|
||||
# save updated config
|
||||
self.config.save()
|
||||
self.load_profile()
|
||||
for name in self.config.supported_databases: #db_ip/db_user/db_pass/db_server
|
||||
log.info('fpdb: name,desc='+name+','+self.config.supported_databases[name].db_desc)
|
||||
else:
|
||||
log.info('guidb response was '+str(response))
|
||||
log.info(_('guidb response was ')+str(response))
|
||||
|
||||
self.release_global_lock()
|
||||
|
||||
dia.destroy()
|
||||
else:
|
||||
self.warning_box("Cannot open Database Maintenance window because "
|
||||
+ "other windows have been opened. Re-start fpdb to use this option.")
|
||||
self.warning_box(_("Cannot open Database Maintenance window because other windows have been opened. Re-start fpdb to use this option."))
|
||||
|
||||
def dia_database_stats(self, widget, data=None):
|
||||
self.warning_box(str="Number of Hands: "+str(self.db.getHandCount())+
|
||||
"\nNumber of Tourneys: "+str(self.db.getTourneyCount())+
|
||||
"\nNumber of TourneyTypes: "+str(self.db.getTourneyTypeCount()),
|
||||
diatitle="Database Statistics")
|
||||
self.warning_box(str=_("Number of Hands: ")+str(self.db.getHandCount())+
|
||||
_("\nNumber of Tourneys: ")+str(self.db.getTourneyCount())+
|
||||
_("\nNumber of TourneyTypes: ")+str(self.db.getTourneyTypeCount()),
|
||||
diatitle=_("Database Statistics"))
|
||||
#end def dia_database_stats
|
||||
|
||||
def diaHudConfigurator(self, widget, data=None):
|
||||
|
@ -349,13 +359,13 @@ class fpdb:
|
|||
self.hudConfiguratorColumns=None
|
||||
self.hudConfiguratorGame=None
|
||||
|
||||
diaSelections = gtk.Dialog("HUD Configurator - choose category",
|
||||
diaSelections = gtk.Dialog(_("HUD Configurator - choose category"),
|
||||
self.window,
|
||||
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||
(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(_("Please select the game category for which you want to configure HUD stats:"))
|
||||
diaSelections.vbox.add(label)
|
||||
label.show()
|
||||
|
||||
|
@ -407,25 +417,25 @@ class fpdb:
|
|||
"""shows dialogue with Table of ComboBoxes to allow choosing of HUD stats"""
|
||||
#TODO: add notices to hud configurator: no duplicates, no empties, display options
|
||||
#TODO: show explanation of what each stat means
|
||||
diaHudTable = gtk.Dialog("HUD Configurator - please choose your stats",
|
||||
diaHudTable = gtk.Dialog(_("HUD Configurator - please choose your stats"),
|
||||
self.window,
|
||||
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||
(gtk.STOCK_SAVE, gtk.RESPONSE_ACCEPT,
|
||||
gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT))
|
||||
|
||||
label=gtk.Label("Please choose the stats you wish to use in the below table.")
|
||||
label=gtk.Label(_("Please choose the stats you wish to use in the below table."))
|
||||
diaHudTable.vbox.add(label)
|
||||
label.show()
|
||||
|
||||
label=gtk.Label("Note that you may not select any stat more than once or it will crash.")
|
||||
label=gtk.Label(_("Note that you may not select any stat more than once or it will crash."))
|
||||
diaHudTable.vbox.add(label)
|
||||
label.show()
|
||||
|
||||
label=gtk.Label("It is not currently possible to select \"empty\" or anything else to that end.")
|
||||
label=gtk.Label(_("It is not currently possible to select \"empty\" or anything else to that end."))
|
||||
diaHudTable.vbox.add(label)
|
||||
label.show()
|
||||
|
||||
label=gtk.Label("To configure things like colouring you will still have to manually edit your HUD_config.xml.")
|
||||
label=gtk.Label(_("To configure things like colouring you will still have to manually edit your HUD_config.xml."))
|
||||
diaHudTable.vbox.add(label)
|
||||
label.show()
|
||||
|
||||
|
@ -503,9 +513,6 @@ class fpdb:
|
|||
dumpFile.close()
|
||||
#end def dia_database_stats
|
||||
|
||||
def dia_licensing(self, widget, data=None):
|
||||
self.warning_box("Unimplemented: Licensing")
|
||||
|
||||
def dia_load_profile(self, widget, data=None):
|
||||
"""Dialogue to select a file to load a profile from"""
|
||||
if self.obtain_global_lock("fpdb.dia_load_profile"): # returns true if successful
|
||||
|
@ -535,9 +542,9 @@ class fpdb:
|
|||
|
||||
#lock_released = False
|
||||
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 deleting and recreating tables")
|
||||
diastring = "Please confirm that you want to (re-)create the tables. If there already are tables in the database " \
|
||||
+self.db.database+" on "+self.db.host+" they will be deleted.\nThis may take a while."
|
||||
buttons=(gtk.BUTTONS_YES_NO), message_format=_("Confirm deleting and recreating tables"))
|
||||
diastring = _("Please confirm that you want to (re-)create the tables. If there already are tables in the database ") \
|
||||
+self.db.database+" on "+self.db.host+_(" they will be deleted.\nThis may take a while.")
|
||||
dia_confirm.format_secondary_text(diastring)#todo: make above string with bold for db, host and deleted
|
||||
# disable windowclose, do not want the the underlying processing interrupted mid-process
|
||||
dia_confirm.set_deletable(False)
|
||||
|
@ -562,14 +569,14 @@ class fpdb:
|
|||
# self.fdb_lock.fdb.recreate_tables()
|
||||
elif response == gtk.RESPONSE_NO:
|
||||
self.release_global_lock()
|
||||
print 'User cancelled recreating tables'
|
||||
print _('User cancelled recreating tables')
|
||||
#if not lock_released:
|
||||
#end def dia_recreate_tables
|
||||
|
||||
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")
|
||||
diastring = "Please confirm that you want to re-create the 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
|
||||
self.dia_confirm.set_deletable(False)
|
||||
|
@ -577,7 +584,7 @@ class fpdb:
|
|||
hb1 = gtk.HBox(True, 1)
|
||||
self.h_start_date = gtk.Entry(max=12)
|
||||
self.h_start_date.set_text( self.db.get_hero_hudcache_start() )
|
||||
lbl = gtk.Label(" Hero's cache starts: ")
|
||||
lbl = gtk.Label(_(" Hero's cache starts: "))
|
||||
btn = gtk.Button()
|
||||
btn.set_image(gtk.image_new_from_stock(gtk.STOCK_INDEX, gtk.ICON_SIZE_BUTTON))
|
||||
btn.connect('clicked', self.__calendar_dialog, self.h_start_date)
|
||||
|
@ -591,7 +598,7 @@ class fpdb:
|
|||
hb2 = gtk.HBox(True, 1)
|
||||
self.start_date = gtk.Entry(max=12)
|
||||
self.start_date.set_text( self.db.get_hero_hudcache_start() )
|
||||
lbl = gtk.Label(" Villains' cache starts: ")
|
||||
lbl = gtk.Label(_(" Villains' cache starts: "))
|
||||
btn = gtk.Button()
|
||||
btn.set_image(gtk.image_new_from_stock(gtk.STOCK_INDEX, gtk.ICON_SIZE_BUTTON))
|
||||
btn.connect('clicked', self.__calendar_dialog, self.start_date)
|
||||
|
@ -604,7 +611,7 @@ class fpdb:
|
|||
|
||||
response = self.dia_confirm.run()
|
||||
if response == gtk.RESPONSE_YES:
|
||||
lbl = gtk.Label(" Rebuilding HUD Cache ... ")
|
||||
lbl = gtk.Label(_(" Rebuilding HUD Cache ... "))
|
||||
self.dia_confirm.vbox.add(lbl)
|
||||
lbl.show()
|
||||
while gtk.events_pending():
|
||||
|
@ -612,7 +619,7 @@ class fpdb:
|
|||
|
||||
self.db.rebuild_hudcache( self.h_start_date.get_text(), self.start_date.get_text() )
|
||||
elif response == gtk.RESPONSE_NO:
|
||||
print 'User cancelled rebuilding hud cache'
|
||||
print _('User cancelled rebuilding hud cache')
|
||||
|
||||
self.dia_confirm.destroy()
|
||||
|
||||
|
@ -624,8 +631,8 @@ class fpdb:
|
|||
,flags=gtk.DIALOG_DESTROY_WITH_PARENT
|
||||
,type=gtk.MESSAGE_WARNING
|
||||
,buttons=(gtk.BUTTONS_YES_NO)
|
||||
,message_format="Confirm rebuilding database indexes")
|
||||
diastring = "Please confirm that you want to rebuild the database indexes."
|
||||
,message_format=_("Confirm rebuilding database indexes"))
|
||||
diastring = _("Please confirm that you want to rebuild the database indexes.")
|
||||
self.dia_confirm.format_secondary_text(diastring)
|
||||
# disable windowclose, do not want the the underlying processing interrupted mid-process
|
||||
self.dia_confirm.set_deletable(False)
|
||||
|
@ -633,24 +640,24 @@ class fpdb:
|
|||
response = self.dia_confirm.run()
|
||||
if response == gtk.RESPONSE_YES:
|
||||
#FIXME these progress messages do not seem to work in *nix
|
||||
lbl = gtk.Label(" Rebuilding Indexes ... ")
|
||||
lbl = gtk.Label(_(" Rebuilding Indexes ... "))
|
||||
self.dia_confirm.vbox.add(lbl)
|
||||
lbl.show()
|
||||
while gtk.events_pending():
|
||||
gtk.main_iteration_do(False)
|
||||
self.db.rebuild_indexes()
|
||||
|
||||
lbl.set_text(" Cleaning Database ... ")
|
||||
lbl.set_text(_(" Cleaning Database ... "))
|
||||
while gtk.events_pending():
|
||||
gtk.main_iteration_do(False)
|
||||
self.db.vacuumDB()
|
||||
|
||||
lbl.set_text(" Analyzing Database ... ")
|
||||
lbl.set_text(_(" Analyzing Database ... "))
|
||||
while gtk.events_pending():
|
||||
gtk.main_iteration_do(False)
|
||||
self.db.analyzeDB()
|
||||
elif response == gtk.RESPONSE_NO:
|
||||
print 'User cancelled rebuilding db indexes'
|
||||
print _('User cancelled rebuilding db indexes')
|
||||
|
||||
self.dia_confirm.destroy()
|
||||
|
||||
|
@ -711,13 +718,13 @@ class fpdb:
|
|||
d.set_destroy_with_parent(True)
|
||||
d.set_modal(True)
|
||||
|
||||
d.set_title('Pick a date')
|
||||
d.set_title(_('Pick a date'))
|
||||
|
||||
vb = gtk.VBox()
|
||||
cal = gtk.Calendar()
|
||||
vb.pack_start(cal, expand=False, padding=0)
|
||||
|
||||
btn = gtk.Button('Done')
|
||||
btn = gtk.Button(_('Done'))
|
||||
btn.connect('clicked', self.__get_date, cal, entry, d)
|
||||
|
||||
vb.pack_start(btn, expand=False, padding=4)
|
||||
|
@ -744,18 +751,13 @@ class fpdb:
|
|||
win.destroy()
|
||||
self.dia_confirm.set_modal(True)
|
||||
|
||||
def dia_regression_test(self, widget, data=None):
|
||||
self.warning_box("Unimplemented: Regression Test")
|
||||
#self.obtain_global_lock("dia_regression_test")
|
||||
#self.release_global_lock()
|
||||
|
||||
def dia_save_profile(self, widget, data=None):
|
||||
self.warning_box("Unimplemented: Save Profile (try saving a HUD layout, that should do it)")
|
||||
self.warning_box(_("Unimplemented: Save Profile (try saving a HUD layout, that should do it)"))
|
||||
|
||||
def diaSetupWizard(self, path):
|
||||
diaSetupWizard = gtk.Dialog(title="Fatal Error - Config File Missing", parent=None, flags=0, buttons=(gtk.STOCK_QUIT,gtk.RESPONSE_OK))
|
||||
diaSetupWizard = gtk.Dialog(title=_("Fatal Error - Config File Missing"), parent=None, flags=0, buttons=(gtk.STOCK_QUIT,gtk.RESPONSE_OK))
|
||||
|
||||
label = gtk.Label("Please copy the config file from the docs folder to:")
|
||||
label = gtk.Label(_("Please copy the config file from the docs folder to:"))
|
||||
diaSetupWizard.vbox.add(label)
|
||||
label.show()
|
||||
|
||||
|
@ -763,7 +765,7 @@ class fpdb:
|
|||
diaSetupWizard.vbox.add(label)
|
||||
label.show()
|
||||
|
||||
label = gtk.Label("and edit it according to the install documentation at http://fpdb.sourceforge.net")
|
||||
label = gtk.Label(_("and edit it according to the install documentation at http://fpdb.sourceforge.net"))
|
||||
diaSetupWizard.vbox.add(label)
|
||||
label.show()
|
||||
|
||||
|
@ -786,7 +788,7 @@ class fpdb:
|
|||
<menu action="import">
|
||||
<menuitem action="sethharchive"/>
|
||||
<menuitem action="bulkimp"/>
|
||||
<menuitem action="imapsummaries"/>
|
||||
<menuitem action="imapimport"/>
|
||||
<menuitem action="autoimp"/>
|
||||
</menu>
|
||||
<menu action="viewers">
|
||||
|
@ -795,6 +797,7 @@ class fpdb:
|
|||
<menuitem action="graphs"/>
|
||||
<menuitem action="ringplayerstats"/>
|
||||
<menuitem action="tourneyplayerstats"/>
|
||||
<menuitem action="tourneyviewer"/>
|
||||
<menuitem action="posnstats"/>
|
||||
<menuitem action="sessionstats"/>
|
||||
</menu>
|
||||
|
@ -810,7 +813,6 @@ class fpdb:
|
|||
<menuitem action="Logs"/>
|
||||
<separator/>
|
||||
<menuitem action="About"/>
|
||||
<menuitem action="License"/>
|
||||
</menu>
|
||||
</menubar>
|
||||
</ui>"""
|
||||
|
@ -820,36 +822,36 @@ class fpdb:
|
|||
actiongroup = gtk.ActionGroup('UIManagerExample')
|
||||
|
||||
# Create actions
|
||||
actiongroup.add_actions([('main', None, '_Main'),
|
||||
('Quit', gtk.STOCK_QUIT, '_Quit', None, 'Quit the Program', self.quit),
|
||||
('LoadProf', None, '_Load Profile (broken)', '<control>L', 'Load your profile', self.dia_load_profile),
|
||||
('SaveProf', None, '_Save Profile (todo)', '<control>S', 'Save your profile', self.dia_save_profile),
|
||||
('Preferences', None, 'Pre_ferences', '<control>F', 'Edit your preferences', self.dia_preferences),
|
||||
('import', None, '_Import'),
|
||||
('sethharchive', None, '_Set HandHistory Archive Directory', None, 'Set HandHistory Archive Directory', self.select_hhArchiveBase),
|
||||
('bulkimp', None, '_Bulk Import', '<control>B', 'Bulk Import', self.tab_bulk_import),
|
||||
('imapsummaries', None, '_Import Tourney Summaries through eMail/IMAP', '<control>I', 'Auto Import and HUD', self.import_imap_summaries),
|
||||
('viewers', None, '_Viewers'),
|
||||
('autoimp', None, '_Auto Import and HUD', '<control>A', 'Auto Import and HUD', self.tab_auto_import),
|
||||
('hudConfigurator', None, '_HUD Configurator', '<control>H', 'HUD Configurator', self.diaHudConfigurator),
|
||||
('graphs', None, '_Graphs', '<control>G', 'Graphs', self.tabGraphViewer),
|
||||
('ringplayerstats', None, 'Ring _Player Stats (tabulated view)', '<control>P', 'Ring Player Stats (tabulated view)', self.tab_ring_player_stats),
|
||||
('tourneyplayerstats', None, '_Tourney Player Stats (tabulated view, mysql only)', '<control>T', 'Tourney Player Stats (tabulated view, mysql only)', self.tab_tourney_player_stats),
|
||||
('posnstats', None, 'P_ositional Stats (tabulated view)', '<control>O', 'Positional Stats (tabulated view)', self.tab_positional_stats),
|
||||
('sessionstats', None, 'Session Stats', None, 'Session Stats', self.tab_session_stats),
|
||||
('database', None, '_Database'),
|
||||
('maintaindbs', None, '_Maintain Databases', None, 'Maintain Databases', self.dia_maintain_dbs),
|
||||
('createtabs', None, 'Create or Recreate _Tables', None, 'Create or Recreate Tables ', self.dia_recreate_tables),
|
||||
('rebuildhudcache', None, 'Rebuild HUD Cache', None, 'Rebuild HUD Cache', self.dia_recreate_hudcache),
|
||||
('rebuildindexes', None, 'Rebuild DB Indexes', None, 'Rebuild DB Indexes', self.dia_rebuild_indexes),
|
||||
('databasestats', None, '_Statistics', None, 'View Database Statistics', self.dia_database_stats),
|
||||
('dumptofile', None, 'Dump Database to Textfile (takes ALOT of time)', None, 'Dump Database to Textfile (takes ALOT of time)', self.dia_dump_db),
|
||||
('help', None, '_Help'),
|
||||
('Logs', None, '_Log Messages', None, 'Log and Debug Messages', self.dia_logs),
|
||||
('About', None, 'A_bout', None, 'About the program', self.dia_about),
|
||||
('License', None, '_License and Copying (todo)', None, 'License and Copying', self.dia_licensing),
|
||||
actiongroup.add_actions([('main', None, _('_Main')),
|
||||
('Quit', gtk.STOCK_QUIT, _('_Quit'), None, 'Quit the Program', self.quit),
|
||||
('LoadProf', None, _('_Load Profile (broken)'), _('<control>L'), 'Load your profile', self.dia_load_profile),
|
||||
('SaveProf', None, _('_Save Profile (todo)'), _('<control>S'), 'Save your profile', self.dia_save_profile),
|
||||
('Preferences', None, _('Pre_ferences'), _('<control>F'), 'Edit your preferences', self.dia_preferences),
|
||||
('import', None, _('_Import')),
|
||||
('sethharchive', None, _('_Set HandHistory Archive Directory'), None, 'Set HandHistory Archive Directory', self.select_hhArchiveBase),
|
||||
('bulkimp', None, _('_Bulk Import'), _('<control>B'), 'Bulk Import', self.tab_bulk_import),
|
||||
('imapimport', None, _('_Import through eMail/IMAP'), _('<control>I'), 'Import through eMail/IMAP', self.tab_imap_import),
|
||||
('viewers', None, _('_Viewers')),
|
||||
('autoimp', None, _('_Auto Import and HUD'), _('<control>A'), 'Auto Import and HUD', self.tab_auto_import),
|
||||
('hudConfigurator', None, _('_HUD Configurator'), _('<control>H'), 'HUD Configurator', self.diaHudConfigurator),
|
||||
('graphs', None, _('_Graphs'), _('<control>G'), 'Graphs', self.tabGraphViewer),
|
||||
('ringplayerstats', None, _('Ring _Player Stats (tabulated view)'), _('<control>P'), 'Ring Player Stats (tabulated view)', self.tab_ring_player_stats),
|
||||
('tourneyplayerstats', None, _('_Tourney Player Stats (tabulated view)'), _('<control>T'), 'Tourney Player Stats (tabulated view, mysql only)', self.tab_tourney_player_stats),
|
||||
('tourneyviewer', None, _('Tourney _Viewer'), None, 'Tourney Viewer)', self.tab_tourney_viewer_stats),
|
||||
('posnstats', None, _('P_ositional Stats (tabulated view, not on sqlite)'), _('<control>O'), 'Positional Stats (tabulated view)', self.tab_positional_stats),
|
||||
('sessionstats', None, _('Session Stats'), None, 'Session Stats', self.tab_session_stats),
|
||||
('database', None, _('_Database')),
|
||||
('maintaindbs', None, _('_Maintain Databases'), None, 'Maintain Databases', self.dia_maintain_dbs),
|
||||
('createtabs', None, _('Create or Recreate _Tables'), None, 'Create or Recreate Tables ', self.dia_recreate_tables),
|
||||
('rebuildhudcache', None, _('Rebuild HUD Cache'), None, 'Rebuild HUD Cache', self.dia_recreate_hudcache),
|
||||
('rebuildindexes', None, _('Rebuild DB Indexes'), None, 'Rebuild DB Indexes', self.dia_rebuild_indexes),
|
||||
('databasestats', None, _('_Statistics'), None, 'View Database Statistics', self.dia_database_stats),
|
||||
('dumptofile', None, _('Dump Database to Textfile (takes ALOT of time)'), None, 'Dump Database to Textfile (takes ALOT of time)', self.dia_dump_db),
|
||||
('help', None, _('_Help')),
|
||||
('Logs', None, _('_Log Messages'), None, 'Log and Debug Messages', self.dia_logs),
|
||||
('About', None, _('A_bout, License, Copying'), None, 'About the program', self.dia_about),
|
||||
])
|
||||
actiongroup.get_action('Quit').set_property('short-label', '_Quit')
|
||||
actiongroup.get_action('Quit').set_property('short-label', _('_Quit'))
|
||||
|
||||
uimanager.insert_action_group(actiongroup, 0)
|
||||
merge_id = uimanager.add_ui_from_string(fpdbmenu)
|
||||
|
@ -860,27 +862,23 @@ class fpdb:
|
|||
return menubar
|
||||
#end def get_menu
|
||||
|
||||
def import_imap_summaries(self, widget, data=None):
|
||||
result=ImapFetcher.run(self.config, self.db)
|
||||
#print "import imap summaries result:", result
|
||||
#end def import_imap_summaries
|
||||
|
||||
def load_profile(self, create_db = False):
|
||||
"""Loads profile from the provided path name."""
|
||||
self.config = Configuration.Config(file=options.config, dbname=options.dbname)
|
||||
if self.config.file_error:
|
||||
self.warning_box( "There is an error in your config file\n" + self.config.file
|
||||
+ "\n\nError is: " + str(self.config.file_error)
|
||||
, diatitle="CONFIG FILE ERROR" )
|
||||
self.warning_box(_("There is an error in your config file\n") + self.config.file
|
||||
+ _("\n\nError is: ") + str(self.config.file_error)
|
||||
, diatitle=_("CONFIG FILE ERROR"))
|
||||
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
|
||||
+ "Edit your screen_name and hand history path in the supported_sites "
|
||||
+ "section of the Preferences window (Main menu) before trying to import hands.")
|
||||
self.info_box(_("Config file")
|
||||
, _("has been created at:\n%s.\n") % self.config.file
|
||||
+ _("Edit your screen_name and hand history path in the supported_sites ")
|
||||
+ _("section of the Preferences window (Main menu) before trying to import hands."))
|
||||
self.settings = {}
|
||||
self.settings['global_lock'] = self.lock
|
||||
if (os.sep=="/"):
|
||||
|
@ -894,7 +892,7 @@ class fpdb:
|
|||
self.settings.update(self.config.get_import_parameters())
|
||||
self.settings.update(self.config.get_default_paths())
|
||||
|
||||
if self.db is not None and self.db.connected:
|
||||
if self.db is not None and self.db.is_connected():
|
||||
self.db.disconnect()
|
||||
|
||||
self.sql = SQL.Sql(db_server = self.settings['db-server'])
|
||||
|
@ -903,20 +901,22 @@ 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?"
|
||||
err_msg = _("MySQL Server reports: Access denied. Are your permissions set correctly?")
|
||||
except Exceptions.FpdbMySQLNoDatabase:
|
||||
err_msg = "MySQL client reports: 2002 or 2003 error. Unable to connect - " \
|
||||
+ "Please check that the MySQL service has been started"
|
||||
err_msg = _("MySQL client reports: 2002 or 2003 error. Unable to connect - ") \
|
||||
+ _("Please check that the MySQL service has been started")
|
||||
except Exceptions.FpdbPostgresqlAccessDenied:
|
||||
err_msg = "Postgres Server reports: Access denied. Are your permissions set correctly?"
|
||||
err_msg = _("Postgres Server reports: Access denied. Are your permissions set correctly?")
|
||||
except Exceptions.FpdbPostgresqlNoDatabase:
|
||||
err_msg = "Postgres client reports: Unable to connect - " \
|
||||
+ "Please check that the Postgres service has been started"
|
||||
err_msg = _("Postgres client reports: Unable to connect - ") \
|
||||
+ _("Please check that the Postgres service has been started")
|
||||
if err_msg is not None:
|
||||
self.db = None
|
||||
self.warning_box(err_msg)
|
||||
if self.db is not None and not self.db.is_connected():
|
||||
self.db = None
|
||||
|
||||
# except FpdbMySQLFailedError:
|
||||
# self.warning_box("Unable to connect to MySQL! Is the MySQL server running?!", "FPDB ERROR")
|
||||
|
@ -935,17 +935,17 @@ class fpdb:
|
|||
# sys.stderr.write("Failed to connect to %s database with username %s." % (self.settings['db-server'], self.settings['db-user']))
|
||||
|
||||
if self.db is not None and self.db.wrongDbVersion:
|
||||
diaDbVersionWarning = gtk.Dialog(title="Strong Warning - Invalid database version", parent=None, flags=0, buttons=(gtk.STOCK_OK,gtk.RESPONSE_OK))
|
||||
diaDbVersionWarning = gtk.Dialog(title=_("Strong Warning - Invalid database version"), parent=None, flags=0, buttons=(gtk.STOCK_OK,gtk.RESPONSE_OK))
|
||||
|
||||
label = gtk.Label("An invalid DB version or missing tables have been detected.")
|
||||
label = gtk.Label(_("An invalid DB version or missing tables have been detected."))
|
||||
diaDbVersionWarning.vbox.add(label)
|
||||
label.show()
|
||||
|
||||
label = gtk.Label("This error is not necessarily fatal but it is strongly recommended that you recreate the tables by using the Database menu.")
|
||||
label = gtk.Label(_("This error is not necessarily fatal but it is strongly recommended that you recreate the tables by using the Database menu."))
|
||||
diaDbVersionWarning.vbox.add(label)
|
||||
label.show()
|
||||
|
||||
label = gtk.Label("Not doing this will likely lead to misbehaviour including fpdb crashes, corrupt data etc.")
|
||||
label = gtk.Label(_("Not doing this will likely lead to misbehaviour including fpdb crashes, corrupt data etc."))
|
||||
diaDbVersionWarning.vbox.add(label)
|
||||
label.show()
|
||||
|
||||
|
@ -957,24 +957,21 @@ class fpdb:
|
|||
self.main_vbox.pack_end(self.status_bar, False, True, 0)
|
||||
self.status_bar.show()
|
||||
|
||||
if self.db is not None and self.db.connected:
|
||||
self.status_bar.set_text("Status: Connected to %s database named %s on host %s"
|
||||
if self.db is not None and self.db.is_connected():
|
||||
self.status_bar.set_text(_("Status: Connected to %s database named %s on host %s")
|
||||
% (self.db.get_backend_name(),self.db.database, self.db.host))
|
||||
# rollback to make sure any locks are cleared:
|
||||
self.db.rollback()
|
||||
|
||||
self.validate_config()
|
||||
|
||||
def not_implemented(self, widget, data=None):
|
||||
self.warning_box("Unimplemented menu entry")
|
||||
|
||||
def obtain_global_lock(self, source):
|
||||
ret = self.lock.acquire(source=source) # will return false if lock is already held
|
||||
if ret:
|
||||
print "\nGlobal lock taken by", source
|
||||
print _("\nGlobal lock taken by"), source
|
||||
self.lockTakenBy=source
|
||||
else:
|
||||
print "\nFailed to get global lock, it is currently held by", source
|
||||
print _("\nFailed to get global lock, it is currently held by"), source
|
||||
return ret
|
||||
# need to release it later:
|
||||
# self.lock.release()
|
||||
|
@ -984,19 +981,19 @@ class fpdb:
|
|||
#FIXME get two "quitting normally" messages, following the addition of the self.window.destroy() call
|
||||
# ... because self.window.destroy() leads to self.destroy() which calls this!
|
||||
if not self.quitting:
|
||||
print "Quitting normally"
|
||||
print _("Quitting normally")
|
||||
self.quitting = True
|
||||
# TODO: check if current settings differ from profile, if so offer to save or abort
|
||||
|
||||
if self.db!=None:
|
||||
if self.db.backend==self.db.MYSQL_INNODB:
|
||||
try:
|
||||
if self.db is not None and self.db.connected():
|
||||
if self.db is not None and self.db.is_connected():
|
||||
self.db.disconnect()
|
||||
except _mysql_exceptions.OperationalError: # oh, damn, we're already disconnected
|
||||
pass
|
||||
else:
|
||||
if self.db is not None and self.db.connected():
|
||||
if self.db is not None and self.db.is_connected():
|
||||
self.db.disconnect()
|
||||
else:
|
||||
pass
|
||||
|
@ -1008,69 +1005,86 @@ class fpdb:
|
|||
def release_global_lock(self):
|
||||
self.lock.release()
|
||||
self.lockTakenBy=None
|
||||
print "Global lock released.\n"
|
||||
print _("Global lock released.\n")
|
||||
|
||||
def tab_auto_import(self, widget, data=None):
|
||||
"""opens the auto import tab"""
|
||||
new_aimp_thread = GuiAutoImport.GuiAutoImport(self.settings, self.config, self.sql, self.window)
|
||||
self.threads.append(new_aimp_thread)
|
||||
aimp_tab=new_aimp_thread.get_vbox()
|
||||
self.add_and_display_tab(aimp_tab, "Auto Import")
|
||||
self.add_and_display_tab(aimp_tab, _("Auto Import"))
|
||||
|
||||
def tab_bulk_import(self, widget, data=None):
|
||||
"""opens a tab for bulk importing"""
|
||||
new_import_thread = GuiBulkImport.GuiBulkImport(self.settings, self.config, self.sql)
|
||||
self.threads.append(new_import_thread)
|
||||
bulk_tab=new_import_thread.get_vbox()
|
||||
self.add_and_display_tab(bulk_tab, "Bulk Import")
|
||||
self.add_and_display_tab(bulk_tab, _("Bulk Import"))
|
||||
|
||||
def tab_imap_import(self, widget, data=None):
|
||||
new_thread = GuiImapFetcher.GuiImapFetcher(self.config, self.db, self.sql, self.window)
|
||||
self.threads.append(new_thread)
|
||||
tab=new_thread.get_vbox()
|
||||
self.add_and_display_tab(tab, _("eMail Import"))
|
||||
#end def tab_import_imap_summaries
|
||||
|
||||
def tab_ring_player_stats(self, widget, data=None):
|
||||
new_ps_thread = GuiRingPlayerStats.GuiRingPlayerStats(self.config, self.sql, self.window)
|
||||
self.threads.append(new_ps_thread)
|
||||
ps_tab=new_ps_thread.get_vbox()
|
||||
self.add_and_display_tab(ps_tab, "Ring Player Stats")
|
||||
self.add_and_display_tab(ps_tab, _("Ring Player Stats"))
|
||||
|
||||
def tab_tourney_player_stats(self, widget, data=None):
|
||||
new_ps_thread = GuiTourneyPlayerStats.GuiTourneyPlayerStats(self.config, self.db, self.sql, self.window)
|
||||
self.threads.append(new_ps_thread)
|
||||
ps_tab=new_ps_thread.get_vbox()
|
||||
self.add_and_display_tab(ps_tab, "Tourney Player Stats")
|
||||
self.add_and_display_tab(ps_tab, _("Tourney Player Stats"))
|
||||
|
||||
def tab_tourney_viewer_stats(self, widget, data=None):
|
||||
new_thread = GuiTourneyViewer.GuiTourneyViewer(self.config, self.db, self.sql, self.window)
|
||||
self.threads.append(new_thread)
|
||||
tab=new_thread.get_vbox()
|
||||
self.add_and_display_tab(tab, _("Tourney Viewer"))
|
||||
|
||||
def tab_positional_stats(self, widget, data=None):
|
||||
new_ps_thread = GuiPositionalStats.GuiPositionalStats(self.config, self.sql)
|
||||
self.threads.append(new_ps_thread)
|
||||
ps_tab=new_ps_thread.get_vbox()
|
||||
self.add_and_display_tab(ps_tab, "Positional Stats")
|
||||
self.add_and_display_tab(ps_tab, _("Positional Stats"))
|
||||
|
||||
def tab_session_stats(self, widget, data=None):
|
||||
new_ps_thread = GuiSessionViewer.GuiSessionViewer(self.config, self.sql, self.window)
|
||||
self.threads.append(new_ps_thread)
|
||||
ps_tab=new_ps_thread.get_vbox()
|
||||
self.add_and_display_tab(ps_tab, "Session Stats")
|
||||
self.add_and_display_tab(ps_tab, _("Session Stats"))
|
||||
|
||||
def tab_main_help(self, widget, data=None):
|
||||
"""Displays a tab with the main fpdb help screen"""
|
||||
mh_tab=gtk.Label("""Welcome to Fpdb!
|
||||
mh_tab=gtk.Label(_("""Fpdb needs translators!
|
||||
If you speak another language and have a few minutes or more to spare get in touch by emailing steffen@schaumburger.info
|
||||
|
||||
Welcome to Fpdb!
|
||||
To be notified of new snapshots and releases go to https://lists.sourceforge.net/lists/listinfo/fpdb-announce and subscribe.
|
||||
If you want to follow development more closely go to https://lists.sourceforge.net/lists/listinfo/fpdb-main and subscribe.
|
||||
|
||||
This program is currently in an alpha-state, so our database format is still sometimes changed.
|
||||
You should therefore always keep your hand history files so that you can re-import after an update, if necessary.
|
||||
|
||||
For documentation please visit our website at http://fpdb.sourceforge.net/.
|
||||
For documentation please visit our website/wiki at http://fpdb.sourceforge.net/.
|
||||
If you need help click on Contact - Get Help on our website.
|
||||
Please note that default.conf is no longer needed nor used, all configuration now happens in HUD_config.xml.
|
||||
|
||||
This program is free/libre open source software licensed partially under the AGPL3, and partially under GPL2 or later.
|
||||
You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt and gpl-3.0.txt in the fpdb installation directory.""")
|
||||
self.add_and_display_tab(mh_tab, "Help")
|
||||
The Windows installer package includes code licensed under the MIT license.
|
||||
You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt, gpl-3.0.txt and mit.txt in the fpdb installation directory."""))
|
||||
self.add_and_display_tab(mh_tab, _("Help"))
|
||||
|
||||
def tabGraphViewer(self, widget, data=None):
|
||||
"""opens a graph viewer tab"""
|
||||
new_gv_thread = GuiGraphViewer.GuiGraphViewer(self.sql, self.config, self.window)
|
||||
self.threads.append(new_gv_thread)
|
||||
gv_tab = new_gv_thread.get_vbox()
|
||||
self.add_and_display_tab(gv_tab, "Graphs")
|
||||
self.add_and_display_tab(gv_tab, _("Graphs"))
|
||||
|
||||
def __init__(self):
|
||||
# no more than 1 process can this lock at a time:
|
||||
|
@ -1079,6 +1093,7 @@ You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt and gpl-3.0.txt
|
|||
self.status_bar = None
|
||||
self.quitting = False
|
||||
|
||||
self.visible = False
|
||||
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
|
||||
self.window.connect("delete_event", self.delete_event)
|
||||
self.window.connect("destroy", self.destroy)
|
||||
|
@ -1116,12 +1131,13 @@ You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt and gpl-3.0.txt
|
|||
self.tab_main_help(None, None)
|
||||
|
||||
self.window.show()
|
||||
self.visible = True # Flip on
|
||||
self.load_profile(create_db = True)
|
||||
|
||||
if not options.errorsToConsole:
|
||||
fileName = os.path.join(self.config.dir_log, 'fpdb-errors.txt')
|
||||
print "\nNote: error output is being diverted to fpdb-errors.txt and HUD-errors.txt in:\n" \
|
||||
+ self.config.dir_log + "\nAny major error will be reported there _only_.\n"
|
||||
print _("\nNote: error output is being diverted to fpdb-errors.txt and HUD-errors.txt in:\n") \
|
||||
+ self.config.dir_log + _("\nAny major error will be reported there _only_.\n")
|
||||
errorFile = open(fileName, 'w', 0)
|
||||
sys.stderr = errorFile
|
||||
|
||||
|
@ -1149,23 +1165,33 @@ You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt and gpl-3.0.txt
|
|||
self.statusIcon.set_visible(True)
|
||||
|
||||
self.window.connect('window-state-event', self.window_state_event_cb)
|
||||
sys.stderr.write("fpdb starting ...")
|
||||
sys.stderr.write(_("fpdb starting ..."))
|
||||
|
||||
|
||||
def __iconify(self):
|
||||
self.visible = False
|
||||
self.window.set_skip_taskbar_hint(True)
|
||||
self.window.set_skip_pager_hint(True)
|
||||
|
||||
def __deiconify(self):
|
||||
self.visible = True
|
||||
self.window.set_skip_taskbar_hint(False)
|
||||
self.window.set_skip_pager_hint(False)
|
||||
|
||||
def window_state_event_cb(self, window, event):
|
||||
# Deal with iconification first
|
||||
if event.changed_mask & gtk.gdk.WINDOW_STATE_ICONIFIED:
|
||||
# -20 = GWL_EXSTYLE can't find it in the pywin32 libs
|
||||
#bits = win32api.GetWindowLong(self.window.window.handle, -20)
|
||||
#bits = bits ^ (win32con.WS_EX_TOOLWINDOW | win32con.WS_EX_APPWINDOW)
|
||||
|
||||
#win32api.SetWindowLong(self.window.window.handle, -20, bits)
|
||||
|
||||
if event.new_window_state & gtk.gdk.WINDOW_STATE_ICONIFIED:
|
||||
self.window.hide()
|
||||
self.window.set_skip_taskbar_hint(True)
|
||||
self.window.set_skip_pager_hint(True)
|
||||
self.__iconify()
|
||||
else:
|
||||
self.window.set_skip_taskbar_hint(False)
|
||||
self.window.set_skip_pager_hint(False)
|
||||
self.__deiconify()
|
||||
if not event.new_window_state & gtk.gdk.WINDOW_STATE_WITHDRAWN:
|
||||
return True
|
||||
# And then the tray icon click
|
||||
if event.new_window_state & gtk.gdk.WINDOW_STATE_WITHDRAWN:
|
||||
self.__iconify()
|
||||
else:
|
||||
self.__deiconify()
|
||||
# Tell GTK not to propagate this signal any further
|
||||
return True
|
||||
|
||||
|
@ -1183,11 +1209,9 @@ You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt and gpl-3.0.txt
|
|||
def statusicon_activate(self, widget, data = None):
|
||||
# Let's allow the tray icon to toggle window visibility, the way
|
||||
# most other apps work
|
||||
shown = self.window.get_property('visible')
|
||||
if shown:
|
||||
if self.visible:
|
||||
self.window.hide()
|
||||
else:
|
||||
self.window.show()
|
||||
self.window.present()
|
||||
|
||||
def info_box(self, str1, str2):
|
||||
|
@ -1198,7 +1222,7 @@ You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt and gpl-3.0.txt
|
|||
diapath.destroy()
|
||||
return response
|
||||
|
||||
def warning_box(self, str, diatitle="FPDB WARNING"):
|
||||
def warning_box(self, str, diatitle=_("FPDB WARNING")):
|
||||
diaWarning = gtk.Dialog(title=diatitle, parent=self.window, flags=gtk.DIALOG_DESTROY_WITH_PARENT, buttons=(gtk.STOCK_OK,gtk.RESPONSE_OK))
|
||||
|
||||
label = gtk.Label(str)
|
||||
|
@ -1217,7 +1241,7 @@ You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt and gpl-3.0.txt
|
|||
hhdir = hhbase
|
||||
if not os.path.isdir(hhdir):
|
||||
diapath = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_WARNING, buttons=(gtk.BUTTONS_YES_NO), message_format="Setup hh dir")
|
||||
diastring = "WARNING: Unable to find output hh directory %s\n\n Press YES to create this directory, or NO to select a new one." % hhdir
|
||||
diastring = _("WARNING: Unable to find output hh directory %s\n\n Press YES to create this directory, or NO to select a new one.") % hhdir
|
||||
diapath.format_secondary_text(diastring)
|
||||
response = diapath.run()
|
||||
diapath.destroy()
|
||||
|
@ -1225,12 +1249,12 @@ You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt and gpl-3.0.txt
|
|||
try:
|
||||
os.makedirs(hhdir)
|
||||
except:
|
||||
self.warning_box("WARNING: Unable to create hand output directory. Importing is not likely to work until this is fixed.")
|
||||
self.warning_box(_("WARNING: Unable to create hand output directory. Importing is not likely to work until this is fixed."))
|
||||
elif response == gtk.RESPONSE_NO:
|
||||
self.select_hhArchiveBase()
|
||||
|
||||
def select_hhArchiveBase(self, widget=None):
|
||||
fc = gtk.FileChooserDialog(title="Select HH Output Directory", parent=None, action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, buttons=(gtk.STOCK_OPEN,gtk.RESPONSE_OK), backend=None)
|
||||
fc = gtk.FileChooserDialog(title=_("Select HH Output Directory"), parent=None, action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, buttons=(gtk.STOCK_OPEN,gtk.RESPONSE_OK), backend=None)
|
||||
fc.run()
|
||||
# TODO: We need to put in a Cancel button, and handle if the user presses that or the "Close" box without selecting anything as a cancel, and return to the prior setting
|
||||
#self.warning_box("You selected %s" % fc.get_filename())
|
||||
|
|
|
@ -35,8 +35,19 @@ log = logging.getLogger("importer")
|
|||
import pygtk
|
||||
import gtk
|
||||
|
||||
# fpdb/FreePokerTools modules
|
||||
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
|
||||
|
||||
# fpdb/FreePokerTools modules
|
||||
import Database
|
||||
import Configuration
|
||||
import Exceptions
|
||||
|
@ -46,14 +57,14 @@ import Exceptions
|
|||
try:
|
||||
import MySQLdb
|
||||
except ImportError:
|
||||
log.debug("Import database module: MySQLdb not found")
|
||||
log.debug(_("Import database module: MySQLdb not found"))
|
||||
else:
|
||||
mysqlLibFound = True
|
||||
|
||||
try:
|
||||
import psycopg2
|
||||
except ImportError:
|
||||
log.debug("Import database module: psycopg2 not found")
|
||||
log.debug(_("Import database module: psycopg2 not found"))
|
||||
else:
|
||||
import psycopg2.extensions
|
||||
psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
|
||||
|
@ -91,6 +102,8 @@ class Importer:
|
|||
self.settings.setdefault("dropIndexes", "don't drop")
|
||||
self.settings.setdefault("dropHudCache", "don't drop")
|
||||
self.settings.setdefault("starsArchive", False)
|
||||
self.settings.setdefault("testData", False)
|
||||
self.settings.setdefault("cacheHHC", False)
|
||||
|
||||
self.writeq = None
|
||||
self.database = Database.Database(self.config, sql = self.sql)
|
||||
|
@ -135,6 +148,15 @@ class Importer:
|
|||
def setStarsArchive(self, value):
|
||||
self.settings['starsArchive'] = value
|
||||
|
||||
def setPrintTestData(self, value):
|
||||
self.settings['testData'] = value
|
||||
|
||||
def setFakeCacheHHC(self, value):
|
||||
self.settings['cacheHHC'] = value
|
||||
|
||||
def getCachedHHC(self):
|
||||
return self.handhistoryconverter
|
||||
|
||||
# def setWatchTime(self):
|
||||
# self.updated = time()
|
||||
|
||||
|
@ -164,9 +186,9 @@ class Importer:
|
|||
self.siteIds[site] = result[0][0]
|
||||
else:
|
||||
if len(result) == 0:
|
||||
log.error("Database ID for %s not found" % site)
|
||||
log.error(_("Database ID for %s not found") % site)
|
||||
else:
|
||||
log.error("[ERROR] More than 1 Database ID found for %s - Multiple currencies not implemented yet" % site)
|
||||
log.error(_("[ERROR] More than 1 Database ID found for %s - Multiple currencies not implemented yet") % site)
|
||||
|
||||
|
||||
# Called from GuiBulkImport to add a file or directory.
|
||||
|
@ -202,7 +224,7 @@ class Importer:
|
|||
#print " adding file ", file
|
||||
self.addImportFile(os.path.join(dir, file), site, filter)
|
||||
else:
|
||||
log.warning("Attempted to add non-directory: '%s' as an import directory" % str(dir))
|
||||
log.warning(_("Attempted to add non-directory: '%s' as an import directory") % str(dir))
|
||||
|
||||
def runImport(self):
|
||||
""""Run full import on self.filelist. This is called from GuiBulkImport.py"""
|
||||
|
@ -212,7 +234,7 @@ class Importer:
|
|||
# Initial setup
|
||||
start = datetime.datetime.now()
|
||||
starttime = time()
|
||||
log.info("Started at %s -- %d files to import. indexes: %s" % (start, len(self.filelist), self.settings['dropIndexes']))
|
||||
log.info(_("Started at %s -- %d files to import. indexes: %s") % (start, len(self.filelist), self.settings['dropIndexes']))
|
||||
if self.settings['dropIndexes'] == 'auto':
|
||||
self.settings['dropIndexes'] = self.calculate_auto2(self.database, 12.0, 500.0)
|
||||
if 'dropHudCache' in self.settings and self.settings['dropHudCache'] == 'auto':
|
||||
|
@ -221,7 +243,7 @@ class Importer:
|
|||
if self.settings['dropIndexes'] == 'drop':
|
||||
self.database.prepareBulkImport()
|
||||
else:
|
||||
log.debug("No need to drop indexes.")
|
||||
log.debug(_("No need to drop indexes."))
|
||||
#print "dropInd =", self.settings['dropIndexes'], " dropHudCache =", self.settings['dropHudCache']
|
||||
|
||||
if self.settings['threads'] <= 0:
|
||||
|
@ -240,10 +262,10 @@ class Importer:
|
|||
(totstored, totdups, totpartial, toterrors) = self.importFiles(self.database, self.writeq)
|
||||
|
||||
if self.writeq.empty():
|
||||
print "writers finished already"
|
||||
print _("writers finished already")
|
||||
pass
|
||||
else:
|
||||
print "waiting for writers to finish ..."
|
||||
print _("waiting for writers to finish ...")
|
||||
#for t in threading.enumerate():
|
||||
# print " "+str(t)
|
||||
#self.writeq.join()
|
||||
|
@ -253,17 +275,17 @@ class Importer:
|
|||
while gtk.events_pending(): # see http://faq.pygtk.org/index.py?req=index for more hints (3.7)
|
||||
gtk.main_iteration(False)
|
||||
sleep(0.5)
|
||||
print " ... writers finished"
|
||||
print _(" ... writers finished")
|
||||
|
||||
# Tidying up after import
|
||||
if self.settings['dropIndexes'] == 'drop':
|
||||
self.database.afterBulkImport()
|
||||
else:
|
||||
print "No need to rebuild indexes."
|
||||
print _("No need to rebuild indexes.")
|
||||
if 'dropHudCache' in self.settings and self.settings['dropHudCache'] == 'drop':
|
||||
self.database.rebuild_hudcache()
|
||||
else:
|
||||
print "No need to rebuild hudcache."
|
||||
print _("No need to rebuild hudcache.")
|
||||
self.database.analyzeDB()
|
||||
endtime = time()
|
||||
return (totstored, totdups, totpartial, toterrors, endtime-starttime)
|
||||
|
@ -288,7 +310,7 @@ class Importer:
|
|||
toterrors += errors
|
||||
|
||||
for i in xrange( self.settings['threads'] ):
|
||||
print "sending finish msg qlen =", q.qsize()
|
||||
print _("sending finish msg qlen ="), q.qsize()
|
||||
db.send_finish_msg(q)
|
||||
|
||||
return (totstored, totdups, totpartial, toterrors)
|
||||
|
@ -414,9 +436,9 @@ class Importer:
|
|||
|
||||
# Load filter, process file, pass returned filename to import_fpdb_file
|
||||
if self.settings['threads'] > 0 and self.writeq is not None:
|
||||
log.info("Converting " + file + " (" + str(q.qsize()) + ")")
|
||||
log.info(_("Converting ") + file + " (" + str(q.qsize()) + ")")
|
||||
else:
|
||||
log.info("Converting " + file)
|
||||
log.info(_("Converting ") + file)
|
||||
hhbase = self.config.get_import_parameters().get("hhArchiveBase")
|
||||
hhbase = os.path.expanduser(hhbase)
|
||||
hhdir = os.path.join(hhbase,site)
|
||||
|
@ -445,14 +467,14 @@ class Importer:
|
|||
if hand is not None:
|
||||
hand.prepInsert(self.database)
|
||||
try:
|
||||
hand.insert(self.database)
|
||||
hand.insert(self.database, printtest = self.settings['testData'])
|
||||
except Exceptions.FpdbHandDuplicate:
|
||||
duplicates += 1
|
||||
else:
|
||||
if self.callHud and hand.dbid_hands != 0:
|
||||
to_hud.append(hand.dbid_hands)
|
||||
else: # TODO: Treat empty as an error, or just ignore?
|
||||
log.error("Hand processed but empty")
|
||||
log.error(_("Hand processed but empty"))
|
||||
|
||||
# Call hudcache update if not in bulk import mode
|
||||
# FIXME: Need to test for bulk import that isn't rebuilding the cache
|
||||
|
@ -464,19 +486,26 @@ class Importer:
|
|||
|
||||
#pipe the Hands.id out to the HUD
|
||||
for hid in to_hud:
|
||||
print "fpdb_import: sending hand to hud", hand.dbid_hands, "pipe =", self.caller.pipe_to_hud
|
||||
self.caller.pipe_to_hud.stdin.write("%s" % (hid) + os.linesep)
|
||||
try:
|
||||
print _("fpdb_import: sending hand to hud"), hand.dbid_hands, "pipe =", self.caller.pipe_to_hud
|
||||
self.caller.pipe_to_hud.stdin.write("%s" % (hid) + os.linesep)
|
||||
except IOError, e:
|
||||
log.error(_("Failed to send hand to HUD: %s") % e)
|
||||
|
||||
errors = getattr(hhc, 'numErrors')
|
||||
stored = getattr(hhc, 'numHands')
|
||||
stored -= duplicates
|
||||
stored -= errors
|
||||
# Really ugly hack to allow testing Hands within the HHC from someone
|
||||
# with only an Importer objec
|
||||
if self.settings['cacheHHC']:
|
||||
self.handhistoryconverter = hhc
|
||||
else:
|
||||
# conversion didn't work
|
||||
# TODO: appropriate response?
|
||||
return (0, 0, 0, 1, time() - ttime)
|
||||
else:
|
||||
log.warning("Unknown filter filter_name:'%s' in filter:'%s'" %(filter_name, filter))
|
||||
log.warning(_("Unknown filter filter_name:'%s' in filter:'%s'") %(filter_name, filter))
|
||||
return (0, 0, 0, 1, time() - ttime)
|
||||
|
||||
ttime = time() - ttime
|
||||
|
@ -487,11 +516,11 @@ class Importer:
|
|||
|
||||
def printEmailErrorMessage(self, errors, filename, line):
|
||||
traceback.print_exc(file=sys.stderr)
|
||||
print "Error No.",errors,", please send the hand causing this to fpdb-main@lists.sourceforge.net so we can fix the problem."
|
||||
print "Filename:", filename
|
||||
print "Here is the first line of the hand so you can identify it. Please mention that the error was a ValueError:"
|
||||
print (_("Error No.%s please send the hand causing this to fpdb-main@lists.sourceforge.net so we can fix the problem.") % errors)
|
||||
print _("Filename:"), filename
|
||||
print _("Here is the first line of the hand so you can identify it. Please mention that the error was a ValueError:")
|
||||
print self.hand[0]
|
||||
print "Hand logged to hand-errors.txt"
|
||||
print _("Hand logged to hand-errors.txt")
|
||||
logfile = open('hand-errors.txt', 'a')
|
||||
for s in self.hand:
|
||||
logfile.write(str(s) + "\n")
|
||||
|
@ -499,4 +528,4 @@ class Importer:
|
|||
logfile.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
print "CLI for fpdb_import is now available as CliFpdb.py"
|
||||
print _("CLI for fpdb_import is now available as CliFpdb.py")
|
||||
|
|
|
@ -46,7 +46,7 @@ class InterProcessLockBase:
|
|||
if source == None:
|
||||
source="Unknown"
|
||||
if self._has_lock: # make sure 2nd acquire in same process fails
|
||||
print "lock already held by:",self.heldBy
|
||||
print _("lock already held by:"),self.heldBy
|
||||
return False
|
||||
while not self._has_lock:
|
||||
try:
|
||||
|
|
BIN
pyfpdb/locale/de/LC_MESSAGES/fpdb.mo
Normal file
BIN
pyfpdb/locale/de/LC_MESSAGES/fpdb.mo
Normal file
Binary file not shown.
2985
pyfpdb/locale/fpdb-en_GB.po
Normal file
2985
pyfpdb/locale/fpdb-en_GB.po
Normal file
File diff suppressed because it is too large
Load Diff
3262
pyfpdb/locale/fpdb-hu_HU.po
Normal file
3262
pyfpdb/locale/fpdb-hu_HU.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
pyfpdb/locale/hu/LC_MESSAGES/fpdb.mo
Normal file
BIN
pyfpdb/locale/hu/LC_MESSAGES/fpdb.mo
Normal file
Binary file not shown.
2
pyfpdb/locale/update-po-files.sh
Executable file
2
pyfpdb/locale/update-po-files.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
msgmerge --update fpdb-hu_HU.po fpdb-en_GB.po
|
||||
|
|
@ -1 +0,0 @@
|
|||
python makeexe.py py2exe
|
|
@ -1,27 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#Copyright 2009-2010 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.
|
||||
#
|
||||
#This program is distributed in the hope that it will be useful,
|
||||
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
#GNU General Public License for more details.
|
||||
#
|
||||
#You should have received a copy of the GNU Affero General Public License
|
||||
#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.
|
||||
|
||||
from distutils.core import setup
|
||||
import py2exe
|
||||
opts = {
|
||||
'py2exe': {
|
||||
'includes': "pango,atk,gobject",
|
||||
}
|
||||
}
|
||||
|
||||
setup(name='Free Poker Database', version='0.12', console=[{"script":"fpdb.py"}])
|
||||
|
|
@ -69,9 +69,18 @@ Py2exe script for fpdb.
|
|||
# See walkthrough in packaging directory for versions used
|
||||
# Updates to this script have broken python 2.5 compatibility (gio module, msvcr71 references now msvcp90)
|
||||
|
||||
# steffeN: Doesnt seem necessary to gettext-ify this, but feel free to if you disagree
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
# get out now if parameter not passed
|
||||
try:
|
||||
sys.argv[1] <> ""
|
||||
except:
|
||||
print "A parameter is required, quitting now"
|
||||
quit()
|
||||
|
||||
from distutils.core import setup
|
||||
import py2exe
|
||||
import glob
|
||||
|
@ -82,7 +91,6 @@ from datetime import date
|
|||
|
||||
origIsSystemDLL = py2exe.build_exe.isSystemDLL
|
||||
def isSystemDLL(pathname):
|
||||
#VisC++ runtime msvcp71.dll removed; py2.6 needs msvcp90.dll which will not be distributed.
|
||||
#dwmapi appears to be vista-specific file, not XP
|
||||
if os.path.basename(pathname).lower() in ("dwmapi.dll"):
|
||||
return 0
|
||||
|
@ -97,7 +105,7 @@ def remove_tree(top):
|
|||
# could delete all your disk files.
|
||||
# sc: Nicked this from somewhere, added the if statement to try
|
||||
# make it a bit safer
|
||||
if top in ('build','dist','gfx') and os.path.basename(os.getcwd()) == 'pyfpdb':
|
||||
if top in ('build','dist','pyfpdb',dist_dirname) and os.path.basename(os.getcwd()) == 'pyfpdb':
|
||||
#print "removing directory '"+top+"' ..."
|
||||
for root, dirs, files in os.walk(top, topdown=False):
|
||||
for name in files:
|
||||
|
@ -114,12 +122,6 @@ def test_and_remove(top):
|
|||
print "Unexpected file '"+top+"' found. Exiting."
|
||||
exit()
|
||||
|
||||
# remove build and dist dirs if they exist
|
||||
test_and_remove('dist')
|
||||
test_and_remove('build')
|
||||
#test_and_remove('gfx')
|
||||
|
||||
|
||||
today = date.today().strftime('%Y%m%d')
|
||||
print "\n" + r"Output will be created in \pyfpdb\ and \fpdb_"+today+'\\'
|
||||
#print "Enter value for XXX (any length): ", # the comma means no newline
|
||||
|
@ -128,12 +130,18 @@ dist_dirname = r'fpdb-' + today + '-exe'
|
|||
dist_dir = r'..\fpdb-' + today + '-exe'
|
||||
print
|
||||
|
||||
test_and_remove(dist_dir)
|
||||
# remove build and dist dirs if they exist
|
||||
test_and_remove('dist')
|
||||
test_and_remove('build')
|
||||
test_and_remove('pyfpdb')
|
||||
|
||||
test_and_remove(dist_dirname)
|
||||
|
||||
|
||||
setup(
|
||||
name = 'fpdb',
|
||||
description = 'Free Poker DataBase',
|
||||
version = '0.20.901',
|
||||
version = '0.20.903',
|
||||
|
||||
windows = [ {'script': 'fpdb.pyw', "icon_resources": [(1, "../gfx/fpdb_large_icon.ico")]},
|
||||
{'script': 'HUD_main.pyw', },
|
||||
|
@ -151,14 +159,14 @@ setup(
|
|||
,'UltimateBetToFpdb', 'Win2dayToFpdb'
|
||||
],
|
||||
'excludes' : ['_tkagg', '_agg2', 'cocoaagg', 'fltkagg'], # surely we need this? '_gtkagg'
|
||||
'dll_excludes': ['libglade-2.0-0.dll', 'libgdk-win32-2.0-0.dll'
|
||||
,'libgobject-2.0-0.dll', 'msvcr90.dll', 'MSVCP90.dll', 'MSVCR90.dll','msvcr90.dll'],
|
||||
'dll_excludes': ['libglade-2.0-0.dll', 'libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll'
|
||||
, 'msvcr90.dll', 'MSVCP90.dll', 'MSVCR90.dll','msvcr90.dll'], # these are vis c / c++ runtimes, and must not be redistributed
|
||||
}
|
||||
},
|
||||
|
||||
# files in 2nd value in tuple are moved to dir named in 1st value
|
||||
#data_files updated for new locations of licences + readme nolonger exists
|
||||
data_files = [('', ['HUD_config.xml.example', 'Cards01.png', 'logging.conf', '../agpl-3.0.txt', '../fdl-1.2.txt', '../gpl-3.0.txt', '../gpl-2.0.txt', '../readme.txt'])
|
||||
data_files = [('', ['HUD_config.xml.example', 'Cards01.png', 'logging.conf', '../agpl-3.0.txt', '../fdl-1.2.txt', '../gpl-3.0.txt', '../gpl-2.0.txt', '../mit.txt', '../readme.txt'])
|
||||
,(dist_dir, [r'..\run_fpdb.bat'])
|
||||
,( dist_dir + r'\gfx', glob.glob(r'..\gfx\*.*') )
|
||||
# line below has problem with fonts subdir ('not a regular file')
|
||||
|
@ -166,25 +174,28 @@ setup(
|
|||
] + matplotlib.get_py2exe_datafiles()
|
||||
)
|
||||
|
||||
|
||||
# rename completed output package as pyfpdb
|
||||
os.rename('dist', 'pyfpdb')
|
||||
|
||||
# these instructions no longer needed:
|
||||
#print '\n' + 'If py2exe was successful add the \\etc \\lib and \\share dirs '
|
||||
#print 'from your gtk dir to \\%s\\pyfpdb\\\n' % dist_dirname
|
||||
#print 'Also copy libgobject-2.0-0.dll and libgdk-win32-2.0-0.dll from <gtk_dir>\\bin'
|
||||
#print 'into there'
|
||||
# pull pytz zoneinfo into pyfpdb package folder
|
||||
src_dir = r'c:\python26\Lib\site-packages\pytz\zoneinfo'
|
||||
src_dir = src_dir.replace('\\', '\\\\')
|
||||
dest_dir = os.path.join(r'pyfpdb', 'zoneinfo')
|
||||
shutil.copytree( src_dir, dest_dir )
|
||||
|
||||
# shunt pyfpdb package over to the distribution folder
|
||||
dest = os.path.join(dist_dirname, 'pyfpdb')
|
||||
#print "try renaming pyfpdb to", dest
|
||||
# print "try renaming pyfpdb to", dest
|
||||
dest = dest.replace('\\', '\\\\')
|
||||
#print "dest is now", dest
|
||||
# print "dest is now", dest
|
||||
os.rename( 'pyfpdb', dest )
|
||||
|
||||
# prompt for gtk location
|
||||
|
||||
print "Enter directory name for GTK (e.g. c:\code\gtk_2.14.7-20090119)\n: ", # the comma means no newline
|
||||
gtk_dir = sys.stdin.readline().rstrip()
|
||||
|
||||
gtk_dir = ""
|
||||
while not os.path.exists(gtk_dir):
|
||||
print "Enter directory name for GTK (e.g. c:\code\gtk_2.14.7-20090119)\n: ", # the comma means no newline
|
||||
gtk_dir = sys.stdin.readline().rstrip()
|
||||
|
||||
print "\ncopying files and dirs from ", gtk_dir, "to", dest.replace('\\\\', '\\'), "..."
|
||||
src = os.path.join(gtk_dir, 'bin', 'libgdk-win32-2.0-0.dll')
|
||||
|
@ -195,7 +206,6 @@ src = os.path.join(gtk_dir, 'bin', 'libgobject-2.0-0.dll')
|
|||
src = src.replace('\\', '\\\\')
|
||||
shutil.copy( src, dest )
|
||||
|
||||
|
||||
src_dir = os.path.join(gtk_dir, 'etc')
|
||||
src_dir = src_dir.replace('\\', '\\\\')
|
||||
dest_dir = os.path.join(dest, 'etc')
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
Full Tilt Poker Game #22488827305: Table Flash - $0.02/$0.05 - No Limit Hold'em - 15:13 ET - Wed, July 21, 2010
|
||||
Seat 1: ronaldd1969 ($2.70)
|
||||
Seat 2: stark00 ($4.41)
|
||||
Seat 3: T0r3x ($12.97)
|
||||
Seat 4: yrthligar ($15)
|
||||
Seat 5: MANUTD ($8.56)
|
||||
Seat 6: gimick ($2)
|
||||
Seat 7: vision ($2.97)
|
||||
Seat 8: shleekom ($2)
|
||||
Seat 9: proud2Bwhack ($8.77)
|
||||
MANUTD posts the small blind of $0.02
|
||||
gimick posts the big blind of $0.05
|
||||
The button is in seat #4
|
||||
*** HOLE CARDS ***
|
||||
Dealt to gimick [Qs 4d]
|
||||
vision folds
|
||||
shleekom folds
|
||||
proud2Bwhack folds
|
||||
ronaldd1969 folds
|
||||
stark00 folds
|
||||
T0r3x folds
|
||||
yrthligar has 8 seconds left to act
|
||||
yrthligar has timed out
|
||||
yrthligar folds
|
||||
MANUTD folds
|
||||
Uncalled bet of $0.03 returned to gimick
|
||||
gimick mucks
|
||||
gimick wins the pot ($0.04)
|
||||
*** SUMMARY ***
|
||||
Total pot $0.04 | Rake $0
|
||||
Seat 1: ronaldd1969 didn't bet (folded)
|
||||
Seat 2: stark00 didn't bet (folded)
|
||||
Seat 3: T0r3x didn't bet (folded)
|
||||
Seat 4: yrthligar (button) didn't bet (folded)
|
||||
Seat 5: MANUTD (small blind) folded before the Flop
|
||||
Seat 6: gimick (big blind) collected ($0.04), mucked
|
||||
Seat 7: vision didn't bet (folded)
|
||||
Seat 8: shleekom didn't bet (folded)
|
||||
Seat 9: proud2Bwhack didn't bet (folded)
|
|
@ -0,0 +1,52 @@
|
|||
Full Tilt Poker Game #22821112219: Table Venice (6 max) - $0.01/$0.02 - No Limit Hold'em - 15:42:59 ET - 2010/08/04
|
||||
Seat 1: gimick ($0.70)
|
||||
Seat 2: player2 ($0.70)
|
||||
Seat 3: player1 ($0.98)
|
||||
Seat 4: player3 ($5.14)
|
||||
Seat 5: player4 ($2)
|
||||
Seat 6: player5 ($0.80)
|
||||
player1 posts the small blind of $0.01
|
||||
player3 posts the big blind of $0.02
|
||||
gimick posts $0.02
|
||||
5 seconds left to act
|
||||
player5 posts $0.02
|
||||
The button is in seat #2
|
||||
*** HOLE CARDS ***
|
||||
Dealt to gimick [Qd Jc]
|
||||
player4 folds
|
||||
player5 checks
|
||||
gimick checks
|
||||
player1 calls $0.01
|
||||
player3 checks
|
||||
*** FLOP *** [3d As 2h]
|
||||
player1 checks
|
||||
player3 checks
|
||||
player5 bets $0.02
|
||||
gimick folds
|
||||
player1 folds
|
||||
gimick is sitting out
|
||||
player3 calls $0.02
|
||||
*** TURN *** [3d As 2h] [4h]
|
||||
player3 checks
|
||||
player5 bets $0.02
|
||||
player3 calls $0.02
|
||||
*** RIVER *** [3d As 2h 4h] [7c]
|
||||
player3 checks
|
||||
player5 bets $0.16
|
||||
player3 folds
|
||||
player3 is sitting out
|
||||
Uncalled bet of $0.16 returned to player5
|
||||
player5 mucks
|
||||
player5 wins the pot ($0.15)
|
||||
*** SUMMARY ***
|
||||
Total pot $0.16 | Rake $0.01
|
||||
Board: [3d As 2h 4h 7c]
|
||||
Seat 1: gimick folded on the Flop
|
||||
Seat 2: player2 (button) is sitting out
|
||||
Seat 3: player1 (small blind) folded on the Flop
|
||||
Seat 4: player3 (big blind) folded on the River
|
||||
Seat 5: player4 didn't bet (folded)
|
||||
Seat 6: player5 collected ($0.15), mucked
|
||||
|
||||
|
||||
|
Binary file not shown.
|
@ -0,0 +1,41 @@
|
|||
***** Hand History For Game 9423586142 *****
|
||||
0.01/0.02 Texas Hold'em Game Table (NL) - Mon Jul 12 13:38:32 EDT 2010
|
||||
Table 20BB Min Speed #1775757 (Real Money) -- Seat 1 is the button
|
||||
Total number of players : 9/9
|
||||
Seat 1: Player1 ($0.95)
|
||||
Seat 2: Player2 ($0.57)
|
||||
Seat 3: Player3 ($0.86)
|
||||
Seat 4: Player4 ($1.71)
|
||||
Seat 5: Player5 ($1.76)
|
||||
Seat 6: Player6 ($0.44)
|
||||
Seat 7: Player7 ($0.76)
|
||||
Seat 8: Player8 ($0.68)
|
||||
Seat 9: Player9 ($0.38)
|
||||
Player2 posts small blind (0.01)
|
||||
Player3 posts big blind (0.02)
|
||||
** Dealing down cards **
|
||||
Dealt to Player5 [ Tc, 9d ]
|
||||
Player5 folds
|
||||
Player6 calls (0.02)
|
||||
Player8 folds
|
||||
Player9 folds
|
||||
Player1 folds
|
||||
Player2 calls (0.01)
|
||||
Player3 raises 0.06 to 0.08
|
||||
Player6 calls (0.06)
|
||||
Player2 folds
|
||||
** Dealing Flop ** : [ 5s, 7h, 6h ]
|
||||
Player3 bets (0.13)
|
||||
Player6 folds
|
||||
** Summary **
|
||||
Main Pot: $0.18 Rake: $0
|
||||
Board: [ 5s 7h 6h ]
|
||||
Player1 balance $0.95, didn't bet (folded)
|
||||
Player2 balance $0.55, lost $0.02 (folded)
|
||||
Player3 balance $0.96, bet $0.21, collected $0.31, net +$0.1
|
||||
Player4 balance $1.71, sits out
|
||||
Player5 balance $1.76, didn't bet (folded)
|
||||
Player6 balance $0.36, lost $0.08 (folded)
|
||||
Player7 balance $0.76, sits out
|
||||
Player8 balance $0.68, didn't bet (folded)
|
||||
Player9 balance $0.38, didn't bet (folded)
|
|
@ -0,0 +1,63 @@
|
|||
Game #9485557849 starts.
|
||||
|
||||
#Game No : 9485557849
|
||||
***** Hand History for Game 9485557849 *****
|
||||
$0.80 USD NL Texas Hold'em - Saturday, July 31, 13:52:16 EDT 2010
|
||||
Table 20BB Min Speed #1770998 (Real Money)
|
||||
Seat 1 is the button
|
||||
Total number of players : 4/9
|
||||
Seat 3: FErki84 ( $1.64 USD )
|
||||
Seat 5: Vandercasses ( $0.01 USD )
|
||||
Seat 9: jeremyho888 ( $1.02 USD )
|
||||
Seat 1: sergeodem ( $1.20 USD )
|
||||
FErki84 posts small blind [$0.01 USD].
|
||||
Vandercasses posts big blind [$0.01 USD].
|
||||
** Dealing down cards **
|
||||
Dealt to FErki84 [ 8h Kc ]
|
||||
jeremyho888 folds
|
||||
sergeodem calls [$0.02 USD]
|
||||
FErki84 calls [$0.01 USD]
|
||||
** Dealing Flop ** [ Td, 7c, 9h ]
|
||||
FErki84 checks
|
||||
sergeodem checks
|
||||
** Dealing Turn ** [ 3h ]
|
||||
FErki84 checks
|
||||
sergeodem checks
|
||||
** Dealing River ** [ Jc ]
|
||||
FErki84 bets [$0.04 USD]
|
||||
sergeodem folds
|
||||
FErki84 shows [ 8h, Kc ]a straight, Seven to Jack.
|
||||
Vandercasses doesn't show [ Ts, Jd ]two pairs, Jacks and Tens.
|
||||
FErki84 wins $0.06 USD from the side pot 1 with a straight, Seven to Jack.
|
||||
FErki84 wins $0.03 USD from the main pot with a straight, Seven to Jack.
|
||||
Vandercasses has left the table.
|
||||
|
||||
Game #9498788316 starts.
|
||||
|
||||
#Game No : 9498788316
|
||||
***** Hand History for Game 9498788316 *****
|
||||
$1.60 USD NL Texas Hold'em - Wednesday, August 04, 15:02:33 EDT 2010
|
||||
Table 20BB Min #1847547 (No DP) (Real Money)
|
||||
Seat 2 is the button
|
||||
Total number of players : 5/6
|
||||
Seat 5: CepguTbIu999 ( $1.60 USD )
|
||||
Seat 1: Daytona_955 ( $2.45 USD )
|
||||
Seat 4: FErki84 ( $2.18 USD )
|
||||
Seat 2: anjl2009 ( $2.80 USD )
|
||||
Seat 3: lukeman2 ( $0.01 USD )
|
||||
lukeman2 posts small blind [$0.01 USD].
|
||||
FErki84 posts big blind [$0.04 USD].
|
||||
** Dealing down cards **
|
||||
Dealt to FErki84 [ 6s 2c ]
|
||||
CepguTbIu999 folds
|
||||
Daytona_955 folds
|
||||
anjl2009 folds
|
||||
** Dealing Flop ** [ 9d, Ah, 3h ]
|
||||
** Dealing Turn ** [ Js ]
|
||||
** Dealing River ** [ Kc ]
|
||||
lukeman2 shows [ 5h, 5s ]a pair of Fives.
|
||||
FErki84 shows [ 6s, 2c ]high card Ace.
|
||||
FErki84 wins $0.03 USD from the side pot 1 with high card, Ace.
|
||||
lukeman2 wins $0.02 USD from the main pot with a pair of Fives.
|
||||
lukeman2 has left the table.
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
Game #9521729454 starts.
|
||||
|
||||
#Game No : 9521729454
|
||||
***** Hand History for Game 9521729454 *****
|
||||
$4 USD NL Texas Hold'em - Wednesday, August 11, 23:21:44 CEST 2010
|
||||
Table Table 178011 (Real Money)
|
||||
Seat 4 is the button
|
||||
Total number of players : 6/9
|
||||
Seat 6: Player1 ( $4 USD )
|
||||
Seat 7: Player2 ( $2.92 USD )
|
||||
Seat 5: Player3 ( $0.74 USD )
|
||||
Seat 3: Player4 ( $4 USD )
|
||||
Seat 4: Player5 ( $2.97 USD )
|
||||
Seat 8: Player6 ( $2 USD )
|
||||
Player3 posts small blind [$0.02 USD].
|
||||
Player7 has joined the table.
|
||||
Player1 posts big blind [$0.04 USD].
|
||||
Player2 posts big blind [$0.04 USD].
|
||||
Player7 posts big blind [$0.04 USD].
|
||||
** Dealing down cards **
|
||||
Dealt to Player1 [ Ad 4c ]
|
||||
marmitt84 has joined the table.
|
||||
Player2 checks
|
||||
samvel1976 has joined the table.
|
||||
Player7 checks
|
||||
Player5 folds
|
||||
Player3 calls [$0.02 USD]
|
||||
Player1 checks
|
||||
** Dealing Flop ** [ 4h, Tc, 3s ]
|
||||
Player3 checks
|
||||
Player1 checks
|
||||
Player2 checks
|
||||
Player7 bets [$0.12 USD]
|
||||
Player3 folds
|
||||
Player1 folds
|
||||
Player2 folds
|
||||
Player7 does not show cards.
|
||||
Player7 wins $0.28 USD
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
PokerStars Game #46290540537: Hold'em Limit ($0.05/$0.10 USD) - 2010/07/03 14:46:30 CET [2010/07/03 8:46:30 ET]
|
||||
Table 'Elektra II' 10-max Seat #6 is the button
|
||||
Seat 1: steffen780 ($2.77 in chips)
|
||||
Seat 2: ialexiv ($1.93 in chips)
|
||||
Seat 4: seregaserg ($2.80 in chips)
|
||||
Seat 5: GREEN373 ($2.38 in chips)
|
||||
Seat 6: Swann99 ($2.93 in chips)
|
||||
Seat 7: ToolTheSheep ($1.22 in chips)
|
||||
Seat 9: bigsergv ($2.26 in chips)
|
||||
Seat 10: garikoitz_22 ($1.69 in chips)
|
||||
ToolTheSheep: posts small blind $0.02
|
||||
Tora-Usagi: is sitting out
|
||||
bigsergv: posts big blind $0.05
|
||||
Ted the Mad: sits out
|
||||
*** HOLE CARDS ***
|
||||
Dealt to steffen780 [8h 3c]
|
||||
garikoitz_22: folds
|
||||
steffen780: folds
|
||||
ialexiv: folds
|
||||
seregaserg: folds
|
||||
GREEN373: folds
|
||||
Swann99: folds
|
||||
ToolTheSheep: folds
|
||||
Uncalled bet ($0.03) returned to bigsergv
|
||||
bigsergv collected $0.04 from pot
|
||||
bigsergv: doesn't show hand
|
||||
*** SUMMARY ***
|
||||
Total pot $0.04 | Rake $0
|
||||
Seat 1: steffen780 folded before Flop (didn't bet)
|
||||
Seat 2: ialexiv folded before Flop (didn't bet)
|
||||
Seat 4: seregaserg folded before Flop (didn't bet)
|
||||
Seat 5: GREEN373 folded before Flop (didn't bet)
|
||||
Seat 6: Swann99 (button) folded before Flop (didn't bet)
|
||||
Seat 7: ToolTheSheep (small blind) folded before Flop
|
||||
Seat 9: bigsergv (big blind) collected ($0.04)
|
||||
Seat 10: garikoitz_22 folded before Flop (didn't bet)
|
||||
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,564 @@
|
|||
{ u'AAALISAAAA': { 'card1': 25,
|
||||
'card2': 17,
|
||||
'card3': 0,
|
||||
'card4': 0,
|
||||
'card5': 0,
|
||||
'card6': 0,
|
||||
'card7': 0,
|
||||
'foldBbToStealChance': False,
|
||||
'foldSbToStealChance': False,
|
||||
'foldToOtherRaisedStreet0': False,
|
||||
'foldToOtherRaisedStreet1': False,
|
||||
'foldToOtherRaisedStreet2': False,
|
||||
'foldToOtherRaisedStreet3': False,
|
||||
'foldToOtherRaisedStreet4': False,
|
||||
'foldToStreet1CBChance': False,
|
||||
'foldToStreet1CBDone': False,
|
||||
'foldToStreet2CBChance': False,
|
||||
'foldToStreet2CBDone': False,
|
||||
'foldToStreet3CBChance': False,
|
||||
'foldToStreet3CBDone': False,
|
||||
'foldToStreet4CBChance': False,
|
||||
'foldToStreet4CBDone': False,
|
||||
'foldedBbToSteal': False,
|
||||
'foldedSbToSteal': False,
|
||||
'other3BStreet0': False,
|
||||
'other4BStreet0': False,
|
||||
'otherRaisedStreet0': False,
|
||||
'otherRaisedStreet1': False,
|
||||
'otherRaisedStreet2': False,
|
||||
'otherRaisedStreet3': False,
|
||||
'otherRaisedStreet4': False,
|
||||
'position': 'S',
|
||||
'raiseFirstInChance': False,
|
||||
'raisedFirstIn': False,
|
||||
'rake': 205,
|
||||
'sawShowdown': True,
|
||||
'seatNo': 3,
|
||||
'sitout': False,
|
||||
'startCards': 147,
|
||||
'startCash': 2020,
|
||||
'street0Aggr': True,
|
||||
'street0Bets': 0,
|
||||
'street0Calls': 0,
|
||||
'street0Raises': 0,
|
||||
'street0VPI': True,
|
||||
'street0_3BChance': True,
|
||||
'street0_3BDone': True,
|
||||
'street0_4BChance': False,
|
||||
'street0_4BDone': False,
|
||||
'street1Aggr': False,
|
||||
'street1Bets': 0,
|
||||
'street1CBChance': False,
|
||||
'street1CBDone': False,
|
||||
'street1Calls': 0,
|
||||
'street1CheckCallRaiseChance': False,
|
||||
'street1CheckCallRaiseDone': False,
|
||||
'street1Raises': 0,
|
||||
'street1Seen': True,
|
||||
'street2Aggr': False,
|
||||
'street2Bets': 0,
|
||||
'street2CBChance': False,
|
||||
'street2CBDone': False,
|
||||
'street2Calls': 0,
|
||||
'street2CheckCallRaiseChance': False,
|
||||
'street2CheckCallRaiseDone': False,
|
||||
'street2Raises': 0,
|
||||
'street2Seen': True,
|
||||
'street3Aggr': False,
|
||||
'street3Bets': 0,
|
||||
'street3CBChance': False,
|
||||
'street3CBDone': False,
|
||||
'street3Calls': 0,
|
||||
'street3CheckCallRaiseChance': False,
|
||||
'street3CheckCallRaiseDone': False,
|
||||
'street3Raises': 0,
|
||||
'street3Seen': True,
|
||||
'street4Aggr': False,
|
||||
'street4Bets': 0,
|
||||
'street4CBChance': False,
|
||||
'street4CBDone': False,
|
||||
'street4Calls': 0,
|
||||
'street4CheckCallRaiseChance': False,
|
||||
'street4CheckCallRaiseDone': False,
|
||||
'street4Raises': 0,
|
||||
'street4Seen': False,
|
||||
'totalProfit': 1915,
|
||||
'tourneyTypeId': None,
|
||||
'tourneysPlayersIds': None,
|
||||
'winnings': 3935,
|
||||
'wonAtSD': 1.0,
|
||||
'wonWhenSeenStreet1': 0.0,
|
||||
'wonWhenSeenStreet2': 0.0,
|
||||
'wonWhenSeenStreet3': 0.0,
|
||||
'wonWhenSeenStreet4': 0.0},
|
||||
u'Arbaz': { 'card1': 0,
|
||||
'card2': 0,
|
||||
'card3': 0,
|
||||
'card4': 0,
|
||||
'card5': 0,
|
||||
'card6': 0,
|
||||
'card7': 0,
|
||||
'foldBbToStealChance': False,
|
||||
'foldSbToStealChance': False,
|
||||
'foldToOtherRaisedStreet0': False,
|
||||
'foldToOtherRaisedStreet1': False,
|
||||
'foldToOtherRaisedStreet2': False,
|
||||
'foldToOtherRaisedStreet3': False,
|
||||
'foldToOtherRaisedStreet4': False,
|
||||
'foldToStreet1CBChance': False,
|
||||
'foldToStreet1CBDone': False,
|
||||
'foldToStreet2CBChance': False,
|
||||
'foldToStreet2CBDone': False,
|
||||
'foldToStreet3CBChance': False,
|
||||
'foldToStreet3CBDone': False,
|
||||
'foldToStreet4CBChance': False,
|
||||
'foldToStreet4CBDone': False,
|
||||
'foldedBbToSteal': False,
|
||||
'foldedSbToSteal': False,
|
||||
'other3BStreet0': False,
|
||||
'other4BStreet0': False,
|
||||
'otherRaisedStreet0': False,
|
||||
'otherRaisedStreet1': False,
|
||||
'otherRaisedStreet2': False,
|
||||
'otherRaisedStreet3': False,
|
||||
'otherRaisedStreet4': False,
|
||||
'position': 'B',
|
||||
'raiseFirstInChance': False,
|
||||
'raisedFirstIn': False,
|
||||
'rake': 0,
|
||||
'sawShowdown': False,
|
||||
'seatNo': 4,
|
||||
'sitout': False,
|
||||
'startCards': 0,
|
||||
'startCash': 2500,
|
||||
'street0Aggr': False,
|
||||
'street0Bets': 0,
|
||||
'street0Calls': 0,
|
||||
'street0Raises': 0,
|
||||
'street0VPI': False,
|
||||
'street0_3BChance': False,
|
||||
'street0_3BDone': False,
|
||||
'street0_4BChance': True,
|
||||
'street0_4BDone': False,
|
||||
'street1Aggr': False,
|
||||
'street1Bets': 0,
|
||||
'street1CBChance': False,
|
||||
'street1CBDone': False,
|
||||
'street1Calls': 0,
|
||||
'street1CheckCallRaiseChance': False,
|
||||
'street1CheckCallRaiseDone': False,
|
||||
'street1Raises': 0,
|
||||
'street1Seen': False,
|
||||
'street2Aggr': False,
|
||||
'street2Bets': 0,
|
||||
'street2CBChance': False,
|
||||
'street2CBDone': False,
|
||||
'street2Calls': 0,
|
||||
'street2CheckCallRaiseChance': False,
|
||||
'street2CheckCallRaiseDone': False,
|
||||
'street2Raises': 0,
|
||||
'street2Seen': False,
|
||||
'street3Aggr': False,
|
||||
'street3Bets': 0,
|
||||
'street3CBChance': False,
|
||||
'street3CBDone': False,
|
||||
'street3Calls': 0,
|
||||
'street3CheckCallRaiseChance': False,
|
||||
'street3CheckCallRaiseDone': False,
|
||||
'street3Raises': 0,
|
||||
'street3Seen': False,
|
||||
'street4Aggr': False,
|
||||
'street4Bets': 0,
|
||||
'street4CBChance': False,
|
||||
'street4CBDone': False,
|
||||
'street4Calls': 0,
|
||||
'street4CheckCallRaiseChance': False,
|
||||
'street4CheckCallRaiseDone': False,
|
||||
'street4Raises': 0,
|
||||
'street4Seen': False,
|
||||
'totalProfit': -25,
|
||||
'tourneyTypeId': None,
|
||||
'tourneysPlayersIds': None,
|
||||
'winnings': 0,
|
||||
'wonAtSD': 0.0,
|
||||
'wonWhenSeenStreet1': 0.0,
|
||||
'wonWhenSeenStreet2': 0.0,
|
||||
'wonWhenSeenStreet3': 0.0,
|
||||
'wonWhenSeenStreet4': 0.0},
|
||||
u'Bl\xe5veis': { 'card1': 0,
|
||||
'card2': 0,
|
||||
'card3': 0,
|
||||
'card4': 0,
|
||||
'card5': 0,
|
||||
'card6': 0,
|
||||
'card7': 0,
|
||||
'foldBbToStealChance': False,
|
||||
'foldSbToStealChance': False,
|
||||
'foldToOtherRaisedStreet0': False,
|
||||
'foldToOtherRaisedStreet1': False,
|
||||
'foldToOtherRaisedStreet2': False,
|
||||
'foldToOtherRaisedStreet3': False,
|
||||
'foldToOtherRaisedStreet4': False,
|
||||
'foldToStreet1CBChance': False,
|
||||
'foldToStreet1CBDone': False,
|
||||
'foldToStreet2CBChance': False,
|
||||
'foldToStreet2CBDone': False,
|
||||
'foldToStreet3CBChance': False,
|
||||
'foldToStreet3CBDone': False,
|
||||
'foldToStreet4CBChance': False,
|
||||
'foldToStreet4CBDone': False,
|
||||
'foldedBbToSteal': False,
|
||||
'foldedSbToSteal': False,
|
||||
'other3BStreet0': False,
|
||||
'other4BStreet0': False,
|
||||
'otherRaisedStreet0': False,
|
||||
'otherRaisedStreet1': False,
|
||||
'otherRaisedStreet2': False,
|
||||
'otherRaisedStreet3': False,
|
||||
'otherRaisedStreet4': False,
|
||||
'position': 1,
|
||||
'raiseFirstInChance': False,
|
||||
'raisedFirstIn': False,
|
||||
'rake': 0,
|
||||
'sawShowdown': False,
|
||||
'seatNo': 1,
|
||||
'sitout': False,
|
||||
'startCards': 0,
|
||||
'startCash': 5510,
|
||||
'street0Aggr': False,
|
||||
'street0Bets': 0,
|
||||
'street0Calls': 0,
|
||||
'street0Raises': 0,
|
||||
'street0VPI': False,
|
||||
'street0_3BChance': True,
|
||||
'street0_3BDone': False,
|
||||
'street0_4BChance': False,
|
||||
'street0_4BDone': False,
|
||||
'street1Aggr': False,
|
||||
'street1Bets': 0,
|
||||
'street1CBChance': False,
|
||||
'street1CBDone': False,
|
||||
'street1Calls': 0,
|
||||
'street1CheckCallRaiseChance': False,
|
||||
'street1CheckCallRaiseDone': False,
|
||||
'street1Raises': 0,
|
||||
'street1Seen': False,
|
||||
'street2Aggr': False,
|
||||
'street2Bets': 0,
|
||||
'street2CBChance': False,
|
||||
'street2CBDone': False,
|
||||
'street2Calls': 0,
|
||||
'street2CheckCallRaiseChance': False,
|
||||
'street2CheckCallRaiseDone': False,
|
||||
'street2Raises': 0,
|
||||
'street2Seen': False,
|
||||
'street3Aggr': False,
|
||||
'street3Bets': 0,
|
||||
'street3CBChance': False,
|
||||
'street3CBDone': False,
|
||||
'street3Calls': 0,
|
||||
'street3CheckCallRaiseChance': False,
|
||||
'street3CheckCallRaiseDone': False,
|
||||
'street3Raises': 0,
|
||||
'street3Seen': False,
|
||||
'street4Aggr': False,
|
||||
'street4Bets': 0,
|
||||
'street4CBChance': False,
|
||||
'street4CBDone': False,
|
||||
'street4Calls': 0,
|
||||
'street4CheckCallRaiseChance': False,
|
||||
'street4CheckCallRaiseDone': False,
|
||||
'street4Raises': 0,
|
||||
'street4Seen': False,
|
||||
'totalProfit': 0,
|
||||
'tourneyTypeId': None,
|
||||
'tourneysPlayersIds': None,
|
||||
'winnings': 0,
|
||||
'wonAtSD': 0.0,
|
||||
'wonWhenSeenStreet1': 0.0,
|
||||
'wonWhenSeenStreet2': 0.0,
|
||||
'wonWhenSeenStreet3': 0.0,
|
||||
'wonWhenSeenStreet4': 0.0},
|
||||
u'Kinewma': { 'card1': 0,
|
||||
'card2': 0,
|
||||
'card3': 0,
|
||||
'card4': 0,
|
||||
'card5': 0,
|
||||
'card6': 0,
|
||||
'card7': 0,
|
||||
'foldBbToStealChance': False,
|
||||
'foldSbToStealChance': False,
|
||||
'foldToOtherRaisedStreet0': False,
|
||||
'foldToOtherRaisedStreet1': False,
|
||||
'foldToOtherRaisedStreet2': False,
|
||||
'foldToOtherRaisedStreet3': False,
|
||||
'foldToOtherRaisedStreet4': False,
|
||||
'foldToStreet1CBChance': False,
|
||||
'foldToStreet1CBDone': False,
|
||||
'foldToStreet2CBChance': False,
|
||||
'foldToStreet2CBDone': False,
|
||||
'foldToStreet3CBChance': False,
|
||||
'foldToStreet3CBDone': False,
|
||||
'foldToStreet4CBChance': False,
|
||||
'foldToStreet4CBDone': False,
|
||||
'foldedBbToSteal': False,
|
||||
'foldedSbToSteal': False,
|
||||
'other3BStreet0': False,
|
||||
'other4BStreet0': False,
|
||||
'otherRaisedStreet0': False,
|
||||
'otherRaisedStreet1': False,
|
||||
'otherRaisedStreet2': False,
|
||||
'otherRaisedStreet3': False,
|
||||
'otherRaisedStreet4': False,
|
||||
'position': 0,
|
||||
'raiseFirstInChance': False,
|
||||
'raisedFirstIn': False,
|
||||
'rake': 0,
|
||||
'sawShowdown': False,
|
||||
'seatNo': 2,
|
||||
'sitout': False,
|
||||
'startCards': 0,
|
||||
'startCash': 3140,
|
||||
'street0Aggr': False,
|
||||
'street0Bets': 0,
|
||||
'street0Calls': 0,
|
||||
'street0Raises': 0,
|
||||
'street0VPI': False,
|
||||
'street0_3BChance': True,
|
||||
'street0_3BDone': False,
|
||||
'street0_4BChance': False,
|
||||
'street0_4BDone': False,
|
||||
'street1Aggr': False,
|
||||
'street1Bets': 0,
|
||||
'street1CBChance': False,
|
||||
'street1CBDone': False,
|
||||
'street1Calls': 0,
|
||||
'street1CheckCallRaiseChance': False,
|
||||
'street1CheckCallRaiseDone': False,
|
||||
'street1Raises': 0,
|
||||
'street1Seen': False,
|
||||
'street2Aggr': False,
|
||||
'street2Bets': 0,
|
||||
'street2CBChance': False,
|
||||
'street2CBDone': False,
|
||||
'street2Calls': 0,
|
||||
'street2CheckCallRaiseChance': False,
|
||||
'street2CheckCallRaiseDone': False,
|
||||
'street2Raises': 0,
|
||||
'street2Seen': False,
|
||||
'street3Aggr': False,
|
||||
'street3Bets': 0,
|
||||
'street3CBChance': False,
|
||||
'street3CBDone': False,
|
||||
'street3Calls': 0,
|
||||
'street3CheckCallRaiseChance': False,
|
||||
'street3CheckCallRaiseDone': False,
|
||||
'street3Raises': 0,
|
||||
'street3Seen': False,
|
||||
'street4Aggr': False,
|
||||
'street4Bets': 0,
|
||||
'street4CBChance': False,
|
||||
'street4CBDone': False,
|
||||
'street4Calls': 0,
|
||||
'street4CheckCallRaiseChance': False,
|
||||
'street4CheckCallRaiseDone': False,
|
||||
'street4Raises': 0,
|
||||
'street4Seen': False,
|
||||
'totalProfit': 0,
|
||||
'tourneyTypeId': None,
|
||||
'tourneysPlayersIds': None,
|
||||
'winnings': 0,
|
||||
'wonAtSD': 0.0,
|
||||
'wonWhenSeenStreet1': 0.0,
|
||||
'wonWhenSeenStreet2': 0.0,
|
||||
'wonWhenSeenStreet3': 0.0,
|
||||
'wonWhenSeenStreet4': 0.0},
|
||||
u'bys7': { 'card1': 0,
|
||||
'card2': 0,
|
||||
'card3': 0,
|
||||
'card4': 0,
|
||||
'card5': 0,
|
||||
'card6': 0,
|
||||
'card7': 0,
|
||||
'foldBbToStealChance': False,
|
||||
'foldSbToStealChance': False,
|
||||
'foldToOtherRaisedStreet0': False,
|
||||
'foldToOtherRaisedStreet1': False,
|
||||
'foldToOtherRaisedStreet2': False,
|
||||
'foldToOtherRaisedStreet3': False,
|
||||
'foldToOtherRaisedStreet4': False,
|
||||
'foldToStreet1CBChance': False,
|
||||
'foldToStreet1CBDone': False,
|
||||
'foldToStreet2CBChance': False,
|
||||
'foldToStreet2CBDone': False,
|
||||
'foldToStreet3CBChance': False,
|
||||
'foldToStreet3CBDone': False,
|
||||
'foldToStreet4CBChance': False,
|
||||
'foldToStreet4CBDone': False,
|
||||
'foldedBbToSteal': False,
|
||||
'foldedSbToSteal': False,
|
||||
'other3BStreet0': False,
|
||||
'other4BStreet0': False,
|
||||
'otherRaisedStreet0': False,
|
||||
'otherRaisedStreet1': False,
|
||||
'otherRaisedStreet2': False,
|
||||
'otherRaisedStreet3': False,
|
||||
'otherRaisedStreet4': False,
|
||||
'position': 2,
|
||||
'raiseFirstInChance': False,
|
||||
'raisedFirstIn': False,
|
||||
'rake': 0,
|
||||
'sawShowdown': False,
|
||||
'seatNo': 6,
|
||||
'sitout': False,
|
||||
'startCards': 0,
|
||||
'startCash': 4135,
|
||||
'street0Aggr': False,
|
||||
'street0Bets': 0,
|
||||
'street0Calls': 1,
|
||||
'street0Raises': 0,
|
||||
'street0VPI': True,
|
||||
'street0_3BChance': True,
|
||||
'street0_3BDone': False,
|
||||
'street0_4BChance': False,
|
||||
'street0_4BDone': False,
|
||||
'street1Aggr': False,
|
||||
'street1Bets': 0,
|
||||
'street1CBChance': False,
|
||||
'street1CBDone': False,
|
||||
'street1Calls': 0,
|
||||
'street1CheckCallRaiseChance': False,
|
||||
'street1CheckCallRaiseDone': False,
|
||||
'street1Raises': 0,
|
||||
'street1Seen': False,
|
||||
'street2Aggr': False,
|
||||
'street2Bets': 0,
|
||||
'street2CBChance': False,
|
||||
'street2CBDone': False,
|
||||
'street2Calls': 0,
|
||||
'street2CheckCallRaiseChance': False,
|
||||
'street2CheckCallRaiseDone': False,
|
||||
'street2Raises': 0,
|
||||
'street2Seen': False,
|
||||
'street3Aggr': False,
|
||||
'street3Bets': 0,
|
||||
'street3CBChance': False,
|
||||
'street3CBDone': False,
|
||||
'street3Calls': 0,
|
||||
'street3CheckCallRaiseChance': False,
|
||||
'street3CheckCallRaiseDone': False,
|
||||
'street3Raises': 0,
|
||||
'street3Seen': False,
|
||||
'street4Aggr': False,
|
||||
'street4Bets': 0,
|
||||
'street4CBChance': False,
|
||||
'street4CBDone': False,
|
||||
'street4Calls': 0,
|
||||
'street4CheckCallRaiseChance': False,
|
||||
'street4CheckCallRaiseDone': False,
|
||||
'street4Raises': 0,
|
||||
'street4Seen': False,
|
||||
'totalProfit': -75,
|
||||
'tourneyTypeId': None,
|
||||
'tourneysPlayersIds': None,
|
||||
'winnings': 0,
|
||||
'wonAtSD': 0.0,
|
||||
'wonWhenSeenStreet1': 0.0,
|
||||
'wonWhenSeenStreet2': 0.0,
|
||||
'wonWhenSeenStreet3': 0.0,
|
||||
'wonWhenSeenStreet4': 0.0},
|
||||
u's0rrow': { 'card1': 39,
|
||||
'card2': 52,
|
||||
'card3': 0,
|
||||
'card4': 0,
|
||||
'card5': 0,
|
||||
'card6': 0,
|
||||
'card7': 0,
|
||||
'foldBbToStealChance': False,
|
||||
'foldSbToStealChance': False,
|
||||
'foldToOtherRaisedStreet0': False,
|
||||
'foldToOtherRaisedStreet1': False,
|
||||
'foldToOtherRaisedStreet2': False,
|
||||
'foldToOtherRaisedStreet3': False,
|
||||
'foldToOtherRaisedStreet4': False,
|
||||
'foldToStreet1CBChance': False,
|
||||
'foldToStreet1CBDone': False,
|
||||
'foldToStreet2CBChance': False,
|
||||
'foldToStreet2CBDone': False,
|
||||
'foldToStreet3CBChance': False,
|
||||
'foldToStreet3CBDone': False,
|
||||
'foldToStreet4CBChance': False,
|
||||
'foldToStreet4CBDone': False,
|
||||
'foldedBbToSteal': False,
|
||||
'foldedSbToSteal': False,
|
||||
'other3BStreet0': False,
|
||||
'other4BStreet0': False,
|
||||
'otherRaisedStreet0': False,
|
||||
'otherRaisedStreet1': False,
|
||||
'otherRaisedStreet2': False,
|
||||
'otherRaisedStreet3': False,
|
||||
'otherRaisedStreet4': False,
|
||||
'position': 3,
|
||||
'raiseFirstInChance': True,
|
||||
'raisedFirstIn': True,
|
||||
'rake': 0,
|
||||
'sawShowdown': True,
|
||||
'seatNo': 5,
|
||||
'sitout': False,
|
||||
'startCards': 169,
|
||||
'startCash': 2985,
|
||||
'street0Aggr': True,
|
||||
'street0Bets': 0,
|
||||
'street0Calls': 1,
|
||||
'street0Raises': 0,
|
||||
'street0VPI': True,
|
||||
'street0_3BChance': False,
|
||||
'street0_3BDone': False,
|
||||
'street0_4BChance': True,
|
||||
'street0_4BDone': True,
|
||||
'street1Aggr': False,
|
||||
'street1Bets': 0,
|
||||
'street1CBChance': False,
|
||||
'street1CBDone': False,
|
||||
'street1Calls': 0,
|
||||
'street1CheckCallRaiseChance': False,
|
||||
'street1CheckCallRaiseDone': False,
|
||||
'street1Raises': 0,
|
||||
'street1Seen': True,
|
||||
'street2Aggr': False,
|
||||
'street2Bets': 0,
|
||||
'street2CBChance': False,
|
||||
'street2CBDone': False,
|
||||
'street2Calls': 0,
|
||||
'street2CheckCallRaiseChance': False,
|
||||
'street2CheckCallRaiseDone': False,
|
||||
'street2Raises': 0,
|
||||
'street2Seen': True,
|
||||
'street3Aggr': False,
|
||||
'street3Bets': 0,
|
||||
'street3CBChance': False,
|
||||
'street3CBDone': False,
|
||||
'street3Calls': 0,
|
||||
'street3CheckCallRaiseChance': False,
|
||||
'street3CheckCallRaiseDone': False,
|
||||
'street3Raises': 0,
|
||||
'street3Seen': True,
|
||||
'street4Aggr': False,
|
||||
'street4Bets': 0,
|
||||
'street4CBChance': False,
|
||||
'street4CBDone': False,
|
||||
'street4Calls': 0,
|
||||
'street4CheckCallRaiseChance': False,
|
||||
'street4CheckCallRaiseDone': False,
|
||||
'street4Raises': 0,
|
||||
'street4Seen': False,
|
||||
'totalProfit': -2020,
|
||||
'tourneyTypeId': None,
|
||||
'tourneysPlayersIds': None,
|
||||
'winnings': 0,
|
||||
'wonAtSD': 0.0,
|
||||
'wonWhenSeenStreet1': 0.0,
|
||||
'wonWhenSeenStreet2': 0.0,
|
||||
'wonWhenSeenStreet3': 0.0,
|
||||
'wonWhenSeenStreet4': 0.0}}
|
|
@ -0,0 +1,752 @@
|
|||
{ u'Player0': { 'card1': 0,
|
||||
'card2': 0,
|
||||
'card3': 0,
|
||||
'card4': 0,
|
||||
'card5': 0,
|
||||
'card6': 0,
|
||||
'card7': 0,
|
||||
'foldBbToStealChance': False,
|
||||
'foldSbToStealChance': False,
|
||||
'foldToOtherRaisedStreet0': False,
|
||||
'foldToOtherRaisedStreet1': False,
|
||||
'foldToOtherRaisedStreet2': False,
|
||||
'foldToOtherRaisedStreet3': False,
|
||||
'foldToOtherRaisedStreet4': False,
|
||||
'foldToStreet1CBChance': False,
|
||||
'foldToStreet1CBDone': False,
|
||||
'foldToStreet2CBChance': False,
|
||||
'foldToStreet2CBDone': False,
|
||||
'foldToStreet3CBChance': False,
|
||||
'foldToStreet3CBDone': False,
|
||||
'foldToStreet4CBChance': False,
|
||||
'foldToStreet4CBDone': False,
|
||||
'foldedBbToSteal': False,
|
||||
'foldedSbToSteal': False,
|
||||
'other3BStreet0': False,
|
||||
'other4BStreet0': False,
|
||||
'otherRaisedStreet0': False,
|
||||
'otherRaisedStreet1': False,
|
||||
'otherRaisedStreet2': False,
|
||||
'otherRaisedStreet3': False,
|
||||
'otherRaisedStreet4': False,
|
||||
'position': 5,
|
||||
'raiseFirstInChance': True,
|
||||
'raisedFirstIn': False,
|
||||
'rake': 0,
|
||||
'sawShowdown': False,
|
||||
'seatNo': 8,
|
||||
'sitout': False,
|
||||
'startCards': 0,
|
||||
'startCash': 491,
|
||||
'street0Aggr': False,
|
||||
'street0Bets': 0,
|
||||
'street0Calls': 2,
|
||||
'street0Raises': 0,
|
||||
'street0VPI': True,
|
||||
'street0_3BChance': False,
|
||||
'street0_3BDone': False,
|
||||
'street0_4BChance': False,
|
||||
'street0_4BDone': False,
|
||||
'street1Aggr': False,
|
||||
'street1Bets': 0,
|
||||
'street1CBChance': False,
|
||||
'street1CBDone': False,
|
||||
'street1Calls': 0,
|
||||
'street1CheckCallRaiseChance': False,
|
||||
'street1CheckCallRaiseDone': False,
|
||||
'street1Raises': 0,
|
||||
'street1Seen': False,
|
||||
'street2Aggr': False,
|
||||
'street2Bets': 0,
|
||||
'street2CBChance': False,
|
||||
'street2CBDone': False,
|
||||
'street2Calls': 0,
|
||||
'street2CheckCallRaiseChance': False,
|
||||
'street2CheckCallRaiseDone': False,
|
||||
'street2Raises': 0,
|
||||
'street2Seen': False,
|
||||
'street3Aggr': False,
|
||||
'street3Bets': 0,
|
||||
'street3CBChance': False,
|
||||
'street3CBDone': False,
|
||||
'street3Calls': 0,
|
||||
'street3CheckCallRaiseChance': False,
|
||||
'street3CheckCallRaiseDone': False,
|
||||
'street3Raises': 0,
|
||||
'street3Seen': False,
|
||||
'street4Aggr': False,
|
||||
'street4Bets': 0,
|
||||
'street4CBChance': False,
|
||||
'street4CBDone': False,
|
||||
'street4Calls': 0,
|
||||
'street4CheckCallRaiseChance': False,
|
||||
'street4CheckCallRaiseDone': False,
|
||||
'street4Raises': 0,
|
||||
'street4Seen': False,
|
||||
'totalProfit': -24,
|
||||
'tourneyTypeId': None,
|
||||
'tourneysPlayersIds': None,
|
||||
'winnings': 0,
|
||||
'wonAtSD': 0.0,
|
||||
'wonWhenSeenStreet1': 0.0,
|
||||
'wonWhenSeenStreet2': 0.0,
|
||||
'wonWhenSeenStreet3': 0.0,
|
||||
'wonWhenSeenStreet4': 0.0},
|
||||
u'Player1': { 'card1': 15,
|
||||
'card2': 51,
|
||||
'card3': 0,
|
||||
'card4': 0,
|
||||
'card5': 0,
|
||||
'card6': 0,
|
||||
'card7': 0,
|
||||
'foldBbToStealChance': False,
|
||||
'foldSbToStealChance': False,
|
||||
'foldToOtherRaisedStreet0': False,
|
||||
'foldToOtherRaisedStreet1': False,
|
||||
'foldToOtherRaisedStreet2': False,
|
||||
'foldToOtherRaisedStreet3': False,
|
||||
'foldToOtherRaisedStreet4': False,
|
||||
'foldToStreet1CBChance': False,
|
||||
'foldToStreet1CBDone': False,
|
||||
'foldToStreet2CBChance': False,
|
||||
'foldToStreet2CBDone': False,
|
||||
'foldToStreet3CBChance': False,
|
||||
'foldToStreet3CBDone': False,
|
||||
'foldToStreet4CBChance': False,
|
||||
'foldToStreet4CBDone': False,
|
||||
'foldedBbToSteal': False,
|
||||
'foldedSbToSteal': False,
|
||||
'other3BStreet0': False,
|
||||
'other4BStreet0': False,
|
||||
'otherRaisedStreet0': False,
|
||||
'otherRaisedStreet1': False,
|
||||
'otherRaisedStreet2': False,
|
||||
'otherRaisedStreet3': False,
|
||||
'otherRaisedStreet4': False,
|
||||
'position': 2,
|
||||
'raiseFirstInChance': False,
|
||||
'raisedFirstIn': False,
|
||||
'rake': 0,
|
||||
'sawShowdown': False,
|
||||
'seatNo': 2,
|
||||
'sitout': False,
|
||||
'startCards': 25,
|
||||
'startCash': 35,
|
||||
'street0Aggr': False,
|
||||
'street0Bets': 0,
|
||||
'street0Calls': 0,
|
||||
'street0Raises': 0,
|
||||
'street0VPI': False,
|
||||
'street0_3BChance': False,
|
||||
'street0_3BDone': False,
|
||||
'street0_4BChance': True,
|
||||
'street0_4BDone': False,
|
||||
'street1Aggr': False,
|
||||
'street1Bets': 0,
|
||||
'street1CBChance': False,
|
||||
'street1CBDone': False,
|
||||
'street1Calls': 0,
|
||||
'street1CheckCallRaiseChance': False,
|
||||
'street1CheckCallRaiseDone': False,
|
||||
'street1Raises': 0,
|
||||
'street1Seen': False,
|
||||
'street2Aggr': False,
|
||||
'street2Bets': 0,
|
||||
'street2CBChance': False,
|
||||
'street2CBDone': False,
|
||||
'street2Calls': 0,
|
||||
'street2CheckCallRaiseChance': False,
|
||||
'street2CheckCallRaiseDone': False,
|
||||
'street2Raises': 0,
|
||||
'street2Seen': False,
|
||||
'street3Aggr': False,
|
||||
'street3Bets': 0,
|
||||
'street3CBChance': False,
|
||||
'street3CBDone': False,
|
||||
'street3Calls': 0,
|
||||
'street3CheckCallRaiseChance': False,
|
||||
'street3CheckCallRaiseDone': False,
|
||||
'street3Raises': 0,
|
||||
'street3Seen': False,
|
||||
'street4Aggr': False,
|
||||
'street4Bets': 0,
|
||||
'street4CBChance': False,
|
||||
'street4CBDone': False,
|
||||
'street4Calls': 0,
|
||||
'street4CheckCallRaiseChance': False,
|
||||
'street4CheckCallRaiseDone': False,
|
||||
'street4Raises': 0,
|
||||
'street4Seen': False,
|
||||
'totalProfit': 0,
|
||||
'tourneyTypeId': None,
|
||||
'tourneysPlayersIds': None,
|
||||
'winnings': 0,
|
||||
'wonAtSD': 0.0,
|
||||
'wonWhenSeenStreet1': 0.0,
|
||||
'wonWhenSeenStreet2': 0.0,
|
||||
'wonWhenSeenStreet3': 0.0,
|
||||
'wonWhenSeenStreet4': 0.0},
|
||||
u'Player2': { 'card1': 36,
|
||||
'card2': 23,
|
||||
'card3': 0,
|
||||
'card4': 0,
|
||||
'card5': 0,
|
||||
'card6': 0,
|
||||
'card7': 0,
|
||||
'foldBbToStealChance': False,
|
||||
'foldSbToStealChance': False,
|
||||
'foldToOtherRaisedStreet0': False,
|
||||
'foldToOtherRaisedStreet1': False,
|
||||
'foldToOtherRaisedStreet2': False,
|
||||
'foldToOtherRaisedStreet3': False,
|
||||
'foldToOtherRaisedStreet4': False,
|
||||
'foldToStreet1CBChance': False,
|
||||
'foldToStreet1CBDone': False,
|
||||
'foldToStreet2CBChance': False,
|
||||
'foldToStreet2CBDone': False,
|
||||
'foldToStreet3CBChance': False,
|
||||
'foldToStreet3CBDone': False,
|
||||
'foldToStreet4CBChance': False,
|
||||
'foldToStreet4CBDone': False,
|
||||
'foldedBbToSteal': False,
|
||||
'foldedSbToSteal': False,
|
||||
'other3BStreet0': False,
|
||||
'other4BStreet0': False,
|
||||
'otherRaisedStreet0': False,
|
||||
'otherRaisedStreet1': False,
|
||||
'otherRaisedStreet2': False,
|
||||
'otherRaisedStreet3': False,
|
||||
'otherRaisedStreet4': False,
|
||||
'position': 3,
|
||||
'raiseFirstInChance': False,
|
||||
'raisedFirstIn': False,
|
||||
'rake': 0,
|
||||
'sawShowdown': True,
|
||||
'seatNo': 1,
|
||||
'sitout': False,
|
||||
'startCards': 127,
|
||||
'startCash': 426,
|
||||
'street0Aggr': True,
|
||||
'street0Bets': 0,
|
||||
'street0Calls': 1,
|
||||
'street0Raises': 0,
|
||||
'street0VPI': True,
|
||||
'street0_3BChance': True,
|
||||
'street0_3BDone': True,
|
||||
'street0_4BChance': False,
|
||||
'street0_4BDone': False,
|
||||
'street1Aggr': False,
|
||||
'street1Bets': 0,
|
||||
'street1CBChance': False,
|
||||
'street1CBDone': False,
|
||||
'street1Calls': 0,
|
||||
'street1CheckCallRaiseChance': False,
|
||||
'street1CheckCallRaiseDone': False,
|
||||
'street1Raises': 0,
|
||||
'street1Seen': False,
|
||||
'street2Aggr': False,
|
||||
'street2Bets': 0,
|
||||
'street2CBChance': False,
|
||||
'street2CBDone': False,
|
||||
'street2Calls': 0,
|
||||
'street2CheckCallRaiseChance': False,
|
||||
'street2CheckCallRaiseDone': False,
|
||||
'street2Raises': 0,
|
||||
'street2Seen': False,
|
||||
'street3Aggr': False,
|
||||
'street3Bets': 0,
|
||||
'street3CBChance': False,
|
||||
'street3CBDone': False,
|
||||
'street3Calls': 0,
|
||||
'street3CheckCallRaiseChance': False,
|
||||
'street3CheckCallRaiseDone': False,
|
||||
'street3Raises': 0,
|
||||
'street3Seen': False,
|
||||
'street4Aggr': False,
|
||||
'street4Bets': 0,
|
||||
'street4CBChance': False,
|
||||
'street4CBDone': False,
|
||||
'street4Calls': 0,
|
||||
'street4CheckCallRaiseChance': False,
|
||||
'street4CheckCallRaiseDone': False,
|
||||
'street4Raises': 0,
|
||||
'street4Seen': False,
|
||||
'totalProfit': -131,
|
||||
'tourneyTypeId': None,
|
||||
'tourneysPlayersIds': None,
|
||||
'winnings': 0,
|
||||
'wonAtSD': 0.0,
|
||||
'wonWhenSeenStreet1': 0.0,
|
||||
'wonWhenSeenStreet2': 0.0,
|
||||
'wonWhenSeenStreet3': 0.0,
|
||||
'wonWhenSeenStreet4': 0.0},
|
||||
u'Player3': { 'card1': 0,
|
||||
'card2': 0,
|
||||
'card3': 0,
|
||||
'card4': 0,
|
||||
'card5': 0,
|
||||
'card6': 0,
|
||||
'card7': 0,
|
||||
'foldBbToStealChance': False,
|
||||
'foldSbToStealChance': False,
|
||||
'foldToOtherRaisedStreet0': False,
|
||||
'foldToOtherRaisedStreet1': False,
|
||||
'foldToOtherRaisedStreet2': False,
|
||||
'foldToOtherRaisedStreet3': False,
|
||||
'foldToOtherRaisedStreet4': False,
|
||||
'foldToStreet1CBChance': False,
|
||||
'foldToStreet1CBDone': False,
|
||||
'foldToStreet2CBChance': False,
|
||||
'foldToStreet2CBDone': False,
|
||||
'foldToStreet3CBChance': False,
|
||||
'foldToStreet3CBDone': False,
|
||||
'foldToStreet4CBChance': False,
|
||||
'foldToStreet4CBDone': False,
|
||||
'foldedBbToSteal': False,
|
||||
'foldedSbToSteal': False,
|
||||
'other3BStreet0': False,
|
||||
'other4BStreet0': False,
|
||||
'otherRaisedStreet0': False,
|
||||
'otherRaisedStreet1': False,
|
||||
'otherRaisedStreet2': False,
|
||||
'otherRaisedStreet3': False,
|
||||
'otherRaisedStreet4': False,
|
||||
'position': 'B',
|
||||
'raiseFirstInChance': False,
|
||||
'raisedFirstIn': False,
|
||||
'rake': 0,
|
||||
'sawShowdown': False,
|
||||
'seatNo': 7,
|
||||
'sitout': False,
|
||||
'startCards': 0,
|
||||
'startCash': 255,
|
||||
'street0Aggr': False,
|
||||
'street0Bets': 0,
|
||||
'street0Calls': 0,
|
||||
'street0Raises': 0,
|
||||
'street0VPI': False,
|
||||
'street0_3BChance': False,
|
||||
'street0_3BDone': False,
|
||||
'street0_4BChance': True,
|
||||
'street0_4BDone': False,
|
||||
'street1Aggr': False,
|
||||
'street1Bets': 0,
|
||||
'street1CBChance': False,
|
||||
'street1CBDone': False,
|
||||
'street1Calls': 0,
|
||||
'street1CheckCallRaiseChance': False,
|
||||
'street1CheckCallRaiseDone': False,
|
||||
'street1Raises': 0,
|
||||
'street1Seen': False,
|
||||
'street2Aggr': False,
|
||||
'street2Bets': 0,
|
||||
'street2CBChance': False,
|
||||
'street2CBDone': False,
|
||||
'street2Calls': 0,
|
||||
'street2CheckCallRaiseChance': False,
|
||||
'street2CheckCallRaiseDone': False,
|
||||
'street2Raises': 0,
|
||||
'street2Seen': False,
|
||||
'street3Aggr': False,
|
||||
'street3Bets': 0,
|
||||
'street3CBChance': False,
|
||||
'street3CBDone': False,
|
||||
'street3Calls': 0,
|
||||
'street3CheckCallRaiseChance': False,
|
||||
'street3CheckCallRaiseDone': False,
|
||||
'street3Raises': 0,
|
||||
'street3Seen': False,
|
||||
'street4Aggr': False,
|
||||
'street4Bets': 0,
|
||||
'street4CBChance': False,
|
||||
'street4CBDone': False,
|
||||
'street4Calls': 0,
|
||||
'street4CheckCallRaiseChance': False,
|
||||
'street4CheckCallRaiseDone': False,
|
||||
'street4Raises': 0,
|
||||
'street4Seen': False,
|
||||
'totalProfit': -2,
|
||||
'tourneyTypeId': None,
|
||||
'tourneysPlayersIds': None,
|
||||
'winnings': 0,
|
||||
'wonAtSD': 0.0,
|
||||
'wonWhenSeenStreet1': 0.0,
|
||||
'wonWhenSeenStreet2': 0.0,
|
||||
'wonWhenSeenStreet3': 0.0,
|
||||
'wonWhenSeenStreet4': 0.0},
|
||||
u'Player4': { 'card1': 52,
|
||||
'card2': 50,
|
||||
'card3': 0,
|
||||
'card4': 0,
|
||||
'card5': 0,
|
||||
'card6': 0,
|
||||
'card7': 0,
|
||||
'foldBbToStealChance': False,
|
||||
'foldSbToStealChance': False,
|
||||
'foldToOtherRaisedStreet0': False,
|
||||
'foldToOtherRaisedStreet1': False,
|
||||
'foldToOtherRaisedStreet2': False,
|
||||
'foldToOtherRaisedStreet3': False,
|
||||
'foldToOtherRaisedStreet4': False,
|
||||
'foldToStreet1CBChance': False,
|
||||
'foldToStreet1CBDone': False,
|
||||
'foldToStreet2CBChance': False,
|
||||
'foldToStreet2CBDone': False,
|
||||
'foldToStreet3CBChance': False,
|
||||
'foldToStreet3CBDone': False,
|
||||
'foldToStreet4CBChance': False,
|
||||
'foldToStreet4CBDone': False,
|
||||
'foldedBbToSteal': False,
|
||||
'foldedSbToSteal': False,
|
||||
'other3BStreet0': False,
|
||||
'other4BStreet0': False,
|
||||
'otherRaisedStreet0': False,
|
||||
'otherRaisedStreet1': False,
|
||||
'otherRaisedStreet2': False,
|
||||
'otherRaisedStreet3': False,
|
||||
'otherRaisedStreet4': False,
|
||||
'position': 4,
|
||||
'raiseFirstInChance': False,
|
||||
'raisedFirstIn': False,
|
||||
'rake': 10,
|
||||
'sawShowdown': True,
|
||||
'seatNo': 9,
|
||||
'sitout': False,
|
||||
'startCards': 167,
|
||||
'startCash': 131,
|
||||
'street0Aggr': True,
|
||||
'street0Bets': 0,
|
||||
'street0Calls': 0,
|
||||
'street0Raises': 0,
|
||||
'street0VPI': True,
|
||||
'street0_3BChance': False,
|
||||
'street0_3BDone': False,
|
||||
'street0_4BChance': True,
|
||||
'street0_4BDone': True,
|
||||
'street1Aggr': False,
|
||||
'street1Bets': 0,
|
||||
'street1CBChance': False,
|
||||
'street1CBDone': False,
|
||||
'street1Calls': 0,
|
||||
'street1CheckCallRaiseChance': False,
|
||||
'street1CheckCallRaiseDone': False,
|
||||
'street1Raises': 0,
|
||||
'street1Seen': False,
|
||||
'street2Aggr': False,
|
||||
'street2Bets': 0,
|
||||
'street2CBChance': False,
|
||||
'street2CBDone': False,
|
||||
'street2Calls': 0,
|
||||
'street2CheckCallRaiseChance': False,
|
||||
'street2CheckCallRaiseDone': False,
|
||||
'street2Raises': 0,
|
||||
'street2Seen': False,
|
||||
'street3Aggr': False,
|
||||
'street3Bets': 0,
|
||||
'street3CBChance': False,
|
||||
'street3CBDone': False,
|
||||
'street3Calls': 0,
|
||||
'street3CheckCallRaiseChance': False,
|
||||
'street3CheckCallRaiseDone': False,
|
||||
'street3Raises': 0,
|
||||
'street3Seen': False,
|
||||
'street4Aggr': False,
|
||||
'street4Bets': 0,
|
||||
'street4CBChance': False,
|
||||
'street4CBDone': False,
|
||||
'street4Calls': 0,
|
||||
'street4CheckCallRaiseChance': False,
|
||||
'street4CheckCallRaiseDone': False,
|
||||
'street4Raises': 0,
|
||||
'street4Seen': False,
|
||||
'totalProfit': 148,
|
||||
'tourneyTypeId': None,
|
||||
'tourneysPlayersIds': None,
|
||||
'winnings': 279,
|
||||
'wonAtSD': 1.0,
|
||||
'wonWhenSeenStreet1': 0.0,
|
||||
'wonWhenSeenStreet2': 0.0,
|
||||
'wonWhenSeenStreet3': 0.0,
|
||||
'wonWhenSeenStreet4': 0.0},
|
||||
u'Player5': { 'card1': 0,
|
||||
'card2': 0,
|
||||
'card3': 0,
|
||||
'card4': 0,
|
||||
'card5': 0,
|
||||
'card6': 0,
|
||||
'card7': 0,
|
||||
'foldBbToStealChance': False,
|
||||
'foldSbToStealChance': False,
|
||||
'foldToOtherRaisedStreet0': False,
|
||||
'foldToOtherRaisedStreet1': False,
|
||||
'foldToOtherRaisedStreet2': False,
|
||||
'foldToOtherRaisedStreet3': False,
|
||||
'foldToOtherRaisedStreet4': False,
|
||||
'foldToStreet1CBChance': False,
|
||||
'foldToStreet1CBDone': False,
|
||||
'foldToStreet2CBChance': False,
|
||||
'foldToStreet2CBDone': False,
|
||||
'foldToStreet3CBChance': False,
|
||||
'foldToStreet3CBDone': False,
|
||||
'foldToStreet4CBChance': False,
|
||||
'foldToStreet4CBDone': False,
|
||||
'foldedBbToSteal': False,
|
||||
'foldedSbToSteal': False,
|
||||
'other3BStreet0': False,
|
||||
'other4BStreet0': False,
|
||||
'otherRaisedStreet0': False,
|
||||
'otherRaisedStreet1': False,
|
||||
'otherRaisedStreet2': False,
|
||||
'otherRaisedStreet3': False,
|
||||
'otherRaisedStreet4': False,
|
||||
'position': 0,
|
||||
'raiseFirstInChance': False,
|
||||
'raisedFirstIn': False,
|
||||
'rake': 0,
|
||||
'sawShowdown': False,
|
||||
'seatNo': 4,
|
||||
'sitout': False,
|
||||
'startCards': 0,
|
||||
'startCash': 370,
|
||||
'street0Aggr': False,
|
||||
'street0Bets': 0,
|
||||
'street0Calls': 0,
|
||||
'street0Raises': 0,
|
||||
'street0VPI': False,
|
||||
'street0_3BChance': False,
|
||||
'street0_3BDone': False,
|
||||
'street0_4BChance': True,
|
||||
'street0_4BDone': False,
|
||||
'street1Aggr': False,
|
||||
'street1Bets': 0,
|
||||
'street1CBChance': False,
|
||||
'street1CBDone': False,
|
||||
'street1Calls': 0,
|
||||
'street1CheckCallRaiseChance': False,
|
||||
'street1CheckCallRaiseDone': False,
|
||||
'street1Raises': 0,
|
||||
'street1Seen': False,
|
||||
'street2Aggr': False,
|
||||
'street2Bets': 0,
|
||||
'street2CBChance': False,
|
||||
'street2CBDone': False,
|
||||
'street2Calls': 0,
|
||||
'street2CheckCallRaiseChance': False,
|
||||
'street2CheckCallRaiseDone': False,
|
||||
'street2Raises': 0,
|
||||
'street2Seen': False,
|
||||
'street3Aggr': False,
|
||||
'street3Bets': 0,
|
||||
'street3CBChance': False,
|
||||
'street3CBDone': False,
|
||||
'street3Calls': 0,
|
||||
'street3CheckCallRaiseChance': False,
|
||||
'street3CheckCallRaiseDone': False,
|
||||
'street3Raises': 0,
|
||||
'street3Seen': False,
|
||||
'street4Aggr': False,
|
||||
'street4Bets': 0,
|
||||
'street4CBChance': False,
|
||||
'street4CBDone': False,
|
||||
'street4Calls': 0,
|
||||
'street4CheckCallRaiseChance': False,
|
||||
'street4CheckCallRaiseDone': False,
|
||||
'street4Raises': 0,
|
||||
'street4Seen': False,
|
||||
'totalProfit': 0,
|
||||
'tourneyTypeId': None,
|
||||
'tourneysPlayersIds': None,
|
||||
'winnings': 0,
|
||||
'wonAtSD': 0.0,
|
||||
'wonWhenSeenStreet1': 0.0,
|
||||
'wonWhenSeenStreet2': 0.0,
|
||||
'wonWhenSeenStreet3': 0.0,
|
||||
'wonWhenSeenStreet4': 0.0},
|
||||
u'Player6': { 'card1': 0,
|
||||
'card2': 0,
|
||||
'card3': 0,
|
||||
'card4': 0,
|
||||
'card5': 0,
|
||||
'card6': 0,
|
||||
'card7': 0,
|
||||
'foldBbToStealChance': False,
|
||||
'foldSbToStealChance': False,
|
||||
'foldToOtherRaisedStreet0': False,
|
||||
'foldToOtherRaisedStreet1': False,
|
||||
'foldToOtherRaisedStreet2': False,
|
||||
'foldToOtherRaisedStreet3': False,
|
||||
'foldToOtherRaisedStreet4': False,
|
||||
'foldToStreet1CBChance': False,
|
||||
'foldToStreet1CBDone': False,
|
||||
'foldToStreet2CBChance': False,
|
||||
'foldToStreet2CBDone': False,
|
||||
'foldToStreet3CBChance': False,
|
||||
'foldToStreet3CBDone': False,
|
||||
'foldToStreet4CBChance': False,
|
||||
'foldToStreet4CBDone': False,
|
||||
'foldedBbToSteal': False,
|
||||
'foldedSbToSteal': False,
|
||||
'other3BStreet0': False,
|
||||
'other4BStreet0': False,
|
||||
'otherRaisedStreet0': False,
|
||||
'otherRaisedStreet1': False,
|
||||
'otherRaisedStreet2': False,
|
||||
'otherRaisedStreet3': False,
|
||||
'otherRaisedStreet4': False,
|
||||
'position': 'S',
|
||||
'raiseFirstInChance': False,
|
||||
'raisedFirstIn': False,
|
||||
'rake': 0,
|
||||
'sawShowdown': False,
|
||||
'seatNo': 5,
|
||||
'sitout': False,
|
||||
'startCards': 0,
|
||||
'startCash': 498,
|
||||
'street0Aggr': False,
|
||||
'street0Bets': 0,
|
||||
'street0Calls': 0,
|
||||
'street0Raises': 0,
|
||||
'street0VPI': False,
|
||||
'street0_3BChance': False,
|
||||
'street0_3BDone': False,
|
||||
'street0_4BChance': True,
|
||||
'street0_4BDone': False,
|
||||
'street1Aggr': False,
|
||||
'street1Bets': 0,
|
||||
'street1CBChance': False,
|
||||
'street1CBDone': False,
|
||||
'street1Calls': 0,
|
||||
'street1CheckCallRaiseChance': False,
|
||||
'street1CheckCallRaiseDone': False,
|
||||
'street1Raises': 0,
|
||||
'street1Seen': False,
|
||||
'street2Aggr': False,
|
||||
'street2Bets': 0,
|
||||
'street2CBChance': False,
|
||||
'street2CBDone': False,
|
||||
'street2Calls': 0,
|
||||
'street2CheckCallRaiseChance': False,
|
||||
'street2CheckCallRaiseDone': False,
|
||||
'street2Raises': 0,
|
||||
'street2Seen': False,
|
||||
'street3Aggr': False,
|
||||
'street3Bets': 0,
|
||||
'street3CBChance': False,
|
||||
'street3CBDone': False,
|
||||
'street3Calls': 0,
|
||||
'street3CheckCallRaiseChance': False,
|
||||
'street3CheckCallRaiseDone': False,
|
||||
'street3Raises': 0,
|
||||
'street3Seen': False,
|
||||
'street4Aggr': False,
|
||||
'street4Bets': 0,
|
||||
'street4CBChance': False,
|
||||
'street4CBDone': False,
|
||||
'street4Calls': 0,
|
||||
'street4CheckCallRaiseChance': False,
|
||||
'street4CheckCallRaiseDone': False,
|
||||
'street4Raises': 0,
|
||||
'street4Seen': False,
|
||||
'totalProfit': -1,
|
||||
'tourneyTypeId': None,
|
||||
'tourneysPlayersIds': None,
|
||||
'winnings': 0,
|
||||
'wonAtSD': 0.0,
|
||||
'wonWhenSeenStreet1': 0.0,
|
||||
'wonWhenSeenStreet2': 0.0,
|
||||
'wonWhenSeenStreet3': 0.0,
|
||||
'wonWhenSeenStreet4': 0.0},
|
||||
u'Player7': { 'card1': 0,
|
||||
'card2': 0,
|
||||
'card3': 0,
|
||||
'card4': 0,
|
||||
'card5': 0,
|
||||
'card6': 0,
|
||||
'card7': 0,
|
||||
'foldBbToStealChance': False,
|
||||
'foldSbToStealChance': False,
|
||||
'foldToOtherRaisedStreet0': False,
|
||||
'foldToOtherRaisedStreet1': False,
|
||||
'foldToOtherRaisedStreet2': False,
|
||||
'foldToOtherRaisedStreet3': False,
|
||||
'foldToOtherRaisedStreet4': False,
|
||||
'foldToStreet1CBChance': False,
|
||||
'foldToStreet1CBDone': False,
|
||||
'foldToStreet2CBChance': False,
|
||||
'foldToStreet2CBDone': False,
|
||||
'foldToStreet3CBChance': False,
|
||||
'foldToStreet3CBDone': False,
|
||||
'foldToStreet4CBChance': False,
|
||||
'foldToStreet4CBDone': False,
|
||||
'foldedBbToSteal': False,
|
||||
'foldedSbToSteal': False,
|
||||
'other3BStreet0': False,
|
||||
'other4BStreet0': False,
|
||||
'otherRaisedStreet0': False,
|
||||
'otherRaisedStreet1': False,
|
||||
'otherRaisedStreet2': False,
|
||||
'otherRaisedStreet3': False,
|
||||
'otherRaisedStreet4': False,
|
||||
'position': 1,
|
||||
'raiseFirstInChance': False,
|
||||
'raisedFirstIn': False,
|
||||
'rake': 0,
|
||||
'sawShowdown': False,
|
||||
'seatNo': 3,
|
||||
'sitout': False,
|
||||
'startCards': 0,
|
||||
'startCash': 834,
|
||||
'street0Aggr': False,
|
||||
'street0Bets': 0,
|
||||
'street0Calls': 0,
|
||||
'street0Raises': 0,
|
||||
'street0VPI': False,
|
||||
'street0_3BChance': False,
|
||||
'street0_3BDone': False,
|
||||
'street0_4BChance': True,
|
||||
'street0_4BDone': False,
|
||||
'street1Aggr': False,
|
||||
'street1Bets': 0,
|
||||
'street1CBChance': False,
|
||||
'street1CBDone': False,
|
||||
'street1Calls': 0,
|
||||
'street1CheckCallRaiseChance': False,
|
||||
'street1CheckCallRaiseDone': False,
|
||||
'street1Raises': 0,
|
||||
'street1Seen': False,
|
||||
'street2Aggr': False,
|
||||
'street2Bets': 0,
|
||||
'street2CBChance': False,
|
||||
'street2CBDone': False,
|
||||
'street2Calls': 0,
|
||||
'street2CheckCallRaiseChance': False,
|
||||
'street2CheckCallRaiseDone': False,
|
||||
'street2Seen': False,
|
||||
'street2Raises': False,
|
||||
'street3Aggr': False,
|
||||
'street3Bets': 0,
|
||||
'street3CBChance': False,
|
||||
'street3CBDone': False,
|
||||
'street3Calls': 0,
|
||||
'street3CheckCallRaiseChance': False,
|
||||
'street3CheckCallRaiseDone': False,
|
||||
'street3Raises': 0,
|
||||
'street3Seen': False,
|
||||
'street4Aggr': False,
|
||||
'street4Bets': 0,
|
||||
'street4CBChance': False,
|
||||
'street4CBDone': False,
|
||||
'street4Calls': 0,
|
||||
'street4CheckCallRaiseChance': False,
|
||||
'street4CheckCallRaiseDone': False,
|
||||
'street4Raises': 0,
|
||||
'street4Seen': False,
|
||||
'totalProfit': 0,
|
||||
'tourneyTypeId': None,
|
||||
'tourneysPlayersIds': None,
|
||||
'winnings': 0,
|
||||
'wonAtSD': 0.0,
|
||||
'wonWhenSeenStreet1': 0.0,
|
||||
'wonWhenSeenStreet2': 0.0,
|
||||
'wonWhenSeenStreet3': 0.0,
|
||||
'wonWhenSeenStreet4': 0.0}}
|
|
@ -1,5 +1,5 @@
|
|||
fpdb database dump
|
||||
DB version=136
|
||||
DB version=142
|
||||
|
||||
###################
|
||||
Table Autorates
|
||||
|
@ -44,7 +44,7 @@ empty table
|
|||
###################
|
||||
Table Settings
|
||||
###################
|
||||
version=136
|
||||
version=142
|
||||
|
||||
|
||||
###################
|
|
@ -0,0 +1,37 @@
|
|||
***** Hand History For Game 9336845949 *****
|
||||
30/60 Tourney Texas Hold'em Game Table (NL) (STT Tournament #52792286) - Sun Jun 13 12:21:39 EDT 2010
|
||||
Table 174827 (Real Money) -- Seat 6 is the button
|
||||
Total number of players : 6/6
|
||||
Seat 1: Player1 (1520)
|
||||
Seat 2: Player2 (1540)
|
||||
Seat 3: Player3 (2120)
|
||||
Seat 4: Player4 (2460)
|
||||
Seat 5: Player5 (2600)
|
||||
Seat 6: Player6 (1760)
|
||||
Player1 posts small blind (30)
|
||||
Player2 posts big blind (60)
|
||||
** Dealing down cards **
|
||||
Dealt to Player5 [ Jc, Js ]
|
||||
Player3 folds
|
||||
Player4 folds
|
||||
Player6 folds
|
||||
Player1 calls (210)
|
||||
Player2 folds
|
||||
** Dealing Flop ** : [ 4h, 7d, 5c ]
|
||||
Player1 checks
|
||||
Player1 calls (450)
|
||||
** Dealing Turn ** : [ Kd ]
|
||||
Player1 checks
|
||||
Player1 calls (830)
|
||||
Player1 is all-In.
|
||||
** Dealing River ** : [ Jd ]
|
||||
Creating Main Pot with 3100 with Player1
|
||||
** Summary **
|
||||
Main Pot: 3100
|
||||
Board: [ 4h 7d 5c Kd Jd ]
|
||||
Player1 balance 0, lost 1520 [ Ks 6c ] [ a pair of kings -- Ks,Kd,Jd,7d,6c ]
|
||||
Player2 balance 1480, lost 60 (folded)
|
||||
Player3 balance 2120, didn't bet (folded)
|
||||
Player4 balance 2460, didn't bet (folded)
|
||||
Player5 balance 4180, bet 1520, collected 3100, net +1580 [ Jc Js ] [ three of a kind, jacks -- Kd,Jc,Js,Jd,7d ]
|
||||
Player6 balance 1760, didn't bet (folded)
|
|
@ -0,0 +1,60 @@
|
|||
PokerStars Game #45201040897: Tournament #280631121, $5.00+$0.50 USD Hold'em Limit - Level III (50/100) - 2010/06/07 16:14:48 ET
|
||||
Table '280631121 1' 9-max Seat #2 is the button
|
||||
Seat 1: Slush11 (110 in chips)
|
||||
Seat 2: zsoccerino (1430 in chips) is sitting out
|
||||
Seat 3: 101ripcord (1250 in chips)
|
||||
Seat 4: Lawwill (3300 in chips)
|
||||
Seat 5: nakamurov (1890 in chips)
|
||||
Seat 6: 67_fredf_67 (1425 in chips)
|
||||
Seat 7: NICk.nico333 (1960 in chips)
|
||||
Seat 8: steffen780 (1745 in chips)
|
||||
Seat 9: PORCHES996 (390 in chips)
|
||||
101ripcord: posts small blind 25
|
||||
Lawwill: posts big blind 50
|
||||
*** HOLE CARDS ***
|
||||
Dealt to steffen780 [Td Th]
|
||||
nakamurov: folds
|
||||
67_fredf_67: calls 50
|
||||
NICk.nico333: folds
|
||||
steffen780: raises 50 to 100
|
||||
PORCHES996: folds
|
||||
Slush11: raises 10 to 110 and is all-in
|
||||
zsoccerino: folds
|
||||
101ripcord: calls 85
|
||||
Lawwill: folds
|
||||
67_fredf_67: calls 60
|
||||
steffen780: calls 10
|
||||
*** FLOP *** [2c Qh 6c]
|
||||
101ripcord: checks
|
||||
67_fredf_67: checks
|
||||
steffen780: bets 50
|
||||
101ripcord: calls 50
|
||||
67_fredf_67: folds
|
||||
*** TURN *** [2c Qh 6c] [9s]
|
||||
101ripcord: checks
|
||||
steffen780: bets 100
|
||||
101ripcord: calls 100
|
||||
*** RIVER *** [2c Qh 6c 9s] [4d]
|
||||
101ripcord: bets 100
|
||||
steffen780: calls 100
|
||||
*** SHOW DOWN ***
|
||||
101ripcord: shows [9c 4c] (two pair, Nines and Fours)
|
||||
steffen780: mucks hand
|
||||
101ripcord collected 500 from side pot
|
||||
Slush11: mucks hand
|
||||
101ripcord collected 490 from main pot
|
||||
*** SUMMARY ***
|
||||
Total pot 990 Main pot 490. Side pot 500. | Rake 0
|
||||
Board [2c Qh 6c 9s 4d]
|
||||
Seat 1: Slush11 mucked [9d As]
|
||||
Seat 2: zsoccerino (button) folded before Flop (didn't bet)
|
||||
Seat 3: 101ripcord (small blind) showed [9c 4c] and won (990) with two pair, Nines and Fours
|
||||
Seat 4: Lawwill (big blind) folded before Flop
|
||||
Seat 5: nakamurov folded before Flop (didn't bet)
|
||||
Seat 6: 67_fredf_67 folded on the Flop
|
||||
Seat 7: NICk.nico333 folded before Flop (didn't bet)
|
||||
Seat 8: steffen780 mucked [Td Th]
|
||||
Seat 9: PORCHES996 folded before Flop (didn't bet)
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
@ -47,8 +47,8 @@ def testSQLiteVarianceFunction():
|
|||
cur.execute("SELECT variance(i) from test")
|
||||
result = cur.fetchone()[0]
|
||||
|
||||
print "DEBUG: Testing variance function"
|
||||
print "DEBUG: result: %s expecting: 0.666666 (result-expecting ~= 0.0): %s" % (result, (result - 0.66666))
|
||||
print _("DEBUG: Testing variance function")
|
||||
print _("DEBUG: result: %s expecting: 0.666666 (result-expecting ~= 0.0): %s") % (result, (result - 0.66666))
|
||||
cur.execute("DROP TABLE test")
|
||||
assert (result - 0.66666) <= 0.0001
|
||||
|
||||
|
|
|
@ -17,6 +17,18 @@
|
|||
|
||||
# create .bat scripts in windows to try out different gtk dirs
|
||||
|
||||
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
|
||||
|
||||
try:
|
||||
|
||||
import os
|
||||
|
@ -24,7 +36,7 @@ try:
|
|||
import re
|
||||
|
||||
if os.name != 'nt':
|
||||
print "\nThis script is only for windows\n"
|
||||
print _("\nThis script is only for windows\n")
|
||||
exit()
|
||||
|
||||
dirs = re.split(os.pathsep, os.environ['PATH'])
|
||||
|
@ -51,7 +63,7 @@ try:
|
|||
bat.close()
|
||||
i = i + 1
|
||||
else:
|
||||
print "\nno gtk directories found in your path - install gtk or edit the path manually\n"
|
||||
print _("\nno gtk directories found in your path - install gtk or edit the path manually\n")
|
||||
|
||||
except SystemExit:
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue
Block a user