diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..bd11db36 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +pyfpdb/HUD_config.xml.example -crlf + diff --git a/packaging/gentoo/current_testing.ebuild b/packaging/gentoo/current_testing.ebuild index e2a9c67c..73bedd02 100644 --- a/packaging/gentoo/current_testing.ebuild +++ b/packaging/gentoo/current_testing.ebuild @@ -17,44 +17,49 @@ SLOT="0" KEYWORDS="~amd64 ~x86" #note: this should work on other architectures too, please send me your experiences -IUSE="graph mysql postgres sqlite" +IUSE="graph mysql postgres sqlite linguas_hu" RDEPEND=" - mysql? ( virtual/mysql - dev-python/mysql-python ) - postgres? ( dev-db/postgresql-server - dev-python/psycopg ) - sqlite? ( dev-lang/python[sqlite] - dev-python/numpy ) - >=x11-libs/gtk+-2.10 - dev-python/pygtk - graph? ( dev-python/numpy - dev-python/matplotlib[gtk] ) - dev-python/python-xlib - dev-python/pytz" + mysql? ( virtual/mysql + dev-python/mysql-python ) + postgres? ( dev-db/postgresql-server + dev-python/psycopg ) + sqlite? ( dev-lang/python[sqlite] + dev-python/numpy ) + >=x11-libs/gtk+-2.10 + dev-python/pygtk + graph? ( dev-python/numpy + dev-python/matplotlib[gtk] ) + dev-python/python-xlib + dev-python/pytz" DEPEND="${RDEPEND}" src_install() { - insinto "${GAMES_DATADIR}"/${PN} - doins -r gfx - doins -r pyfpdb - doins readme.txt + insinto "${GAMES_DATADIR}"/${PN} + doins -r gfx + doins -r pyfpdb - exeinto "${GAMES_DATADIR}"/${PN} - doexe run_fpdb.py + if use linguas_hu; then + dosym "${GAMES_DATADIR}"/${PN}/pyfpdb/locale/hu/LC_MESSAGES/${PN}.mo /usr/share/locale/hu/LC_MESSAGES/${PN}.mo + fi - dodir "${GAMES_BINDIR}" - dosym "${GAMES_DATADIR}"/${PN}/run_fpdb.py "${GAMES_BINDIR}"/${PN} + doins readme.txt - newicon gfx/fpdb-icon.png ${PN}.png - make_desktop_entry ${PN} + exeinto "${GAMES_DATADIR}"/${PN} + doexe run_fpdb.py - chmod +x "${D}/${GAMES_DATADIR}"/${PN}/pyfpdb/*.pyw - prepgamesdirs + 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." + 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." } diff --git a/packaging/gentoo/fpdb-9999.ebuild b/packaging/gentoo/fpdb-9999.ebuild index a2e28197..b3bfa9dc 100644 --- a/packaging/gentoo/fpdb-9999.ebuild +++ b/packaging/gentoo/fpdb-9999.ebuild @@ -18,48 +18,53 @@ SLOT="0" KEYWORDS="" #note: this should work on other architectures too, please send me your experiences -IUSE="graph mysql postgres sqlite" +IUSE="graph mysql postgres sqlite linguas_hu" RDEPEND=" - mysql? ( virtual/mysql - dev-python/mysql-python ) - postgres? ( dev-db/postgresql-server - dev-python/psycopg ) - sqlite? ( dev-lang/python[sqlite] - dev-python/numpy ) - >=x11-libs/gtk+-2.10 - dev-python/pygtk - graph? ( dev-python/numpy - dev-python/matplotlib[gtk] ) - dev-python/python-xlib - dev-python/pytz" + mysql? ( virtual/mysql + dev-python/mysql-python ) + postgres? ( dev-db/postgresql-server + dev-python/psycopg ) + sqlite? ( dev-lang/python[sqlite] + dev-python/numpy ) + >=x11-libs/gtk+-2.10 + dev-python/pygtk + graph? ( dev-python/numpy + dev-python/matplotlib[gtk] ) + dev-python/python-xlib + dev-python/pytz" DEPEND="${RDEPEND}" src_unpack() { - git_src_unpack + git_src_unpack } src_install() { - insinto "${GAMES_DATADIR}"/${PN} - doins -r gfx - doins -r pyfpdb - doins readme.txt + insinto "${GAMES_DATADIR}"/${PN} + doins -r gfx + doins -r pyfpdb - exeinto "${GAMES_DATADIR}"/${PN} - doexe run_fpdb.py + if use linguas_hu; then + dosym "${GAMES_DATADIR}"/${PN}/pyfpdb/locale/hu/LC_MESSAGES/${PN}.mo /usr/share/locale/hu/LC_MESSAGES/${PN}.mo + fi - dodir "${GAMES_BINDIR}" - dosym "${GAMES_DATADIR}"/${PN}/run_fpdb.py "${GAMES_BINDIR}"/${PN} + doins readme.txt - newicon gfx/fpdb-icon.png ${PN}.png - make_desktop_entry ${PN} + exeinto "${GAMES_DATADIR}"/${PN} + doexe run_fpdb.py - chmod +x "${D}/${GAMES_DATADIR}"/${PN}/pyfpdb/*.pyw - prepgamesdirs + 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." + 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." } diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index 980fc8e5..f89c318a 100755 --- a/pyfpdb/Configuration.py +++ b/pyfpdb/Configuration.py @@ -525,12 +525,12 @@ class General(dict): except KeyError: self["version"]=0 self["ui_language"]="system" - self["config_difficuly"]="expert" + self["config_difficulty"]="expert" def get_defaults(self): self["version"]=0 self["ui_language"]="system" - self["config_difficuly"]="expert" + self["config_difficulty"]="expert" self["config_wrap_len"]="-1" self["day_start"]="5" diff --git a/pyfpdb/FulltiltToFpdb.py b/pyfpdb/FulltiltToFpdb.py index a3526ca0..4b5fbcfd 100755 --- a/pyfpdb/FulltiltToFpdb.py +++ b/pyfpdb/FulltiltToFpdb.py @@ -261,7 +261,7 @@ class Fulltilt(HandHistoryConverter): if special == "KO": hand.isKO = True if special == "Head's Up" or special == "Heads Up": - hand.maxSeats = 2 + hand.maxseats = 2 if re.search("Matrix", special): hand.isMatrix = True if special == "Shootout": diff --git a/pyfpdb/HUD_config.xml.example b/pyfpdb/HUD_config.xml.example index dde3626b..068a5c61 100644 --- a/pyfpdb/HUD_config.xml.example +++ b/pyfpdb/HUD_config.xml.example @@ -1,711 +1,680 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index 0973141f..d9c7c07a 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -58,7 +58,7 @@ class Hand(object): LCS = {'H':'h', 'D':'d', 'C':'c', 'S':'s'} SYMBOL = {'USD': '$', 'EUR': u'$', 'T$': '', 'play': ''} MS = {'horse' : 'HORSE', '8game' : '8-Game', 'hose' : 'HOSE', 'ha': 'HA'} - SITEIDS = {'Fulltilt':1, 'PokerStars':2, 'Everleaf':3, 'Win2day':4, 'OnGame':5, 'UltimateBet':6, 'Betfair':7, 'Absolute':8, 'PartyPoker':9, 'Partouche':10, 'Carbon':11 } + SITEIDS = {'Fulltilt':1, 'PokerStars':2, 'Everleaf':3, 'Win2day':4, 'OnGame':5, 'UltimateBet':6, 'Betfair':7, 'Absolute':8, 'PartyPoker':9, 'Partouche':10, 'Carbon':11, 'PKR':12 } def __init__(self, config, sitename, gametype, handText, builtFrom = "HHC"): @@ -77,7 +77,7 @@ class Hand(object): self.dbid_gt = 0 self.tablename = "" self.hero = "" - self.maxseats = 0 + self.maxseats = None self.counted_seats = 0 self.buttonpos = 0 diff --git a/pyfpdb/PkrToFpdb.py b/pyfpdb/PkrToFpdb.py new file mode 100755 index 00000000..a94cd030 --- /dev/null +++ b/pyfpdb/PkrToFpdb.py @@ -0,0 +1,390 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Copyright 2010, Carl Gherardi +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# 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 General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +######################################################################## + + +import sys +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 + + +class Pkr(HandHistoryConverter): + + # Class Variables + + sitename = "PKR" + filetype = "text" + codepage = ("utf8", "cp1252") + siteId = 12 # Needs to match id entry in Sites database + + mixes = { 'HORSE': 'horse', '8-Game': '8game', 'HOSE': 'hose'} # Legal mixed games + sym = {'USD': "\$"} # ADD Euro, Sterling, etc HERE + substitutions = { + 'LEGAL_ISO' : "USD", # legal ISO currency codes + 'LS' : "\$|" # legal currency symbols - Euro(cp1252, utf-8) + } + + limits = { 'NO LIMIT':'nl', 'POT LIMIT':'pl', 'LIMIT':'fl' } + games = { # base, category + "HOLD'EM" : ('hold','holdem'), + 'FIXMEOmaha' : ('hold','omahahi'), + 'FIXMEOmaha Hi/Lo' : ('hold','omahahilo'), + 'FIXME5 Card Draw' : ('draw','fivedraw') + } + currencies = { u'€':'EUR', '$':'USD', '':'T$' } + + # Static regexes + re_GameInfo = re.compile(u""" + Table\s\#\d+\s\-\s(?P[a-zA-Z\ \d]+)\s + Starting\sHand\s\#(?P[0-9]+)\s + Start\stime\sof\shand:\s(?P.*)\s + Last\sHand\s\#[0-9]+\s + Game\sType:\s(?PHOLD'EM|5\sCard\sDraw)\s + Limit\sType:\s(?PNO\sLIMIT|LIMIT|POT\sLIMIT)\s + Table\sType\:\sRING\s + Money\sType:\sREAL\sMONEY\s + Blinds\sare\snow\s(?P%(LS)s|)? + (?P[.0-9]+)/(%(LS)s)? + (?P[.0-9]+) + """ % substitutions, re.MULTILINE|re.VERBOSE) + + re_PlayerInfo = re.compile(u""" + ^Seat\s(?P[0-9]+):\s + (?P.*)\s-\s + (%(LS)s)?(?P[.0-9]+) + """ % substitutions, re.MULTILINE|re.VERBOSE) + + re_HandInfo = re.compile(""" + ^Table\s\'(?P
[-\ a-zA-Z\d]+)\'\s + ((?P\d+)-max\s)? + (?P\(Play\sMoney\)\s)? + (Seat\s\#(?P
[ a-zA-Z]+) - \$?(?P[.0-9]+)/\$?(?P[.0-9]+) - (?P.*) - (?P
[0-9]+):(?P[0-9]+) ET - (?P[0-9]+)/(?P[0-9]+)/(?P[0-9]+)Table (?P
[ a-zA-Z]+)\nSeat (?P