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/announce-0.20.905.txt b/packaging/announce-0.20.905.txt new file mode 100644 index 00000000..cf4932c5 --- /dev/null +++ b/packaging/announce-0.20.905.txt @@ -0,0 +1,32 @@ +Hello everyone, +The new snapshot 0.20.905 is now available for download as source or as packages/installers for Debian, Gentoo, Ubuntu and Windows. +This version brings many improvements and bugfixes, updating is recommended for users of previous snapshots. If you're using a stable version like 0.20 or 0.20.1 please consider trying this version and report any bugs, and in particular regressions, so we can fix them. This snapshot will hopefully be the last, next step is one or more release candidates, and then the next stable release. + +We are still looking for translators! You can find some information about what languages we are still missing here: http://sourceforge.net/apps/mediawiki/fpdb/index.php?title=Translation + +188 changesets (excl. merges) have gone in since 0.20.904. +Please note that you will have to either recreate your database or use a new one if you're updating from 0.20.904 or older. +Config files from 0.20 and later should work. Please report if you have problems with config files from that version or later. + +What's changed: +- Fpdb now supports running in languages other than English, Erki supplied a translation for Hungarian. French, Spanish and Italian are in progress by new contributors. Fpdb will use the system-configured language, a configuration option will be added before the next stable release. Note that this is about the user interface language, non-English history file parsing is a seperate topic. +- Much improved testing to improve the recording of data, especially corner cases and non-trivial stats +- OnGame network (which now includes Betfair) is now properly supported +- FTP.fr importing now works. We don't know if the HUD works yet, give it a go and let us know +- We noticed that fpdb already supports PS.fr +- PokerStars should support all limits now +- The Debian package now handles a missing config file properly +- Many minor improvements to the Gentoo ebuilds for the upcoming submission to the sunrise overlay +- We changed how email import is configured. Either delete your old config or see the HUD_config.xml.example file for how to add the section to the right place +- fpdb should now be able to run with any config file from 0.20 or later, including all 0.20.9* snapshots +- Some more fixes to window visibility and the minimise to tray icon feature +- Various other small cleanups, fixes and improvements. See the git changelog for full details + +To download: +- Debian/Ubuntu Linux: http://sourceforge.net/projects/fpdb/files/fpdb/Snapshots/python-fpdb_0.20.905-1_all.deb/download +- Gentoo Linux: http://sourceforge.net/projects/fpdb/files/fpdb/Snapshots/fpdb-0.20.905.ebuild/download +- Windows: http://sourceforge.net/projects/fpdb/files/fpdb/Snapshots/fpdb-0.20.905anyCPU.exe/download +- Source version for those who installed the dependencies manually: http://sourceforge.net/projects/fpdb/files/fpdb/Snapshots/fpdb-0.20.905.tar.bz2/download + +Thanks to everyone who contributed code, translations, testing and bug reports! +The fpdb team diff --git a/packaging/debian/changelog b/packaging/debian/changelog index 49211161..c09713a3 100644 --- a/packaging/debian/changelog +++ b/packaging/debian/changelog @@ -1,3 +1,16 @@ +free-poker-tools (0.20.906-1) unstable; urgency=low + + * New snapshot + + -- Mika Bostrom Fri, 27 Aug 2010 08:26:05 +0300 + +free-poker-tools (0.20.905-1) unstable; urgency=low + + * New snapshot + * Hungarian translation + + -- Mika Bostrom Wed, 25 Aug 2010 10:05:36 +0300 + free-poker-tools (0.20.904-2) unstable; urgency=low * On fpdb start, copy example HUD_config.xml in place if none is present diff --git a/packaging/debian/rules b/packaging/debian/rules index 58b1136b..9f8d5238 100755 --- a/packaging/debian/rules +++ b/packaging/debian/rules @@ -26,8 +26,7 @@ install: build # Copy *.pyw manually in packaging tree 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/py2exe_setup.py + rm debian/$(PACKAGE)/usr/lib/python2.6/site-packages/fpdb/windows_make_bats.py binary-indep: build install 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/packaging/windows/py2exeWalkthroughPython26.txt b/packaging/windows/py2exeWalkthroughPython26.txt index b023d80d..68a74c81 100644 --- a/packaging/windows/py2exeWalkthroughPython26.txt +++ b/packaging/windows/py2exeWalkthroughPython26.txt @@ -103,6 +103,7 @@ Step 4 Get the fpdb GIT tree ---------------------------- 4.1/ Best to take a copy to work with; following steps will assume that the fpdb folder is on the Desktop +4.2/ Edit the script in packaging/windows/py2exe_setup.py to set the fpdbver variable for this release 5.3/ Install correct Numpy for this build @@ -158,7 +159,7 @@ Step 6 Run py2exe to generate fpdb.exe 6.1/ Run the script to create the fpdb.exe bundle -dos> cd Desktop\fpdb\pyfpdb +dos> cd Desktop\fpdb\packaging\windows dos> c:\python26\python.exe py2exe_setup.py py2exe wait a while, watch lots of copying and whatever. @@ -183,16 +184,14 @@ Step 8 Drag out the completed bundle ------------------------------------ py2exe creates a new folder for the created software bundle, drag this out to the desktop for ease of working. -As far as I know you cannot rerun the build if the fpdb-yyyymmdd-exe exists in the tree, so dragging this out -also allows the build to re-run at step 6. -8.1/ Drag Desktop\fpdb\pyfpdb\fpdb-yyyymmdd-exe to Desktop\ +8.1/ Drag Desktop\fpdb\packaging\windows\fpdb-n.nn.nnn to Desktop\ Step 9 Initial run ------------------ -9.1/ Open the Desktop\fpdb-yyyymmdd-exe folder +9.1/ Open the Desktop\fpdb-n.nn.nnn folder 9.2/ In explorer...tools...folder options...View uncheck "Hide extensions for known file types" 9.3/ Double click run_fpdb.bat 9.4/ check the contents of pyfpdb\fpdb.exe.log, deal with any errors thrown @@ -222,7 +221,7 @@ pyfpdb/share/man Step 12 rename folder --------------------- -Rename the folder to something meaningful to the community. If you have built for NoSSE, append anyCPU to the directory name. +If needed, 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 diff --git a/pyfpdb/py2exe_setup.py b/packaging/windows/py2exe_setup.py similarity index 55% rename from pyfpdb/py2exe_setup.py rename to packaging/windows/py2exe_setup.py index 9dbda8dd..8bf723a4 100644 --- a/pyfpdb/py2exe_setup.py +++ b/packaging/windows/py2exe_setup.py @@ -32,14 +32,10 @@ Py2exe script for fpdb. #HOW TO USE this script: # -#- cd to the folder where this script is stored, usually .../pyfpdb. -# [If there are build and dist subfolders present , delete them to get -# rid of earlier builds. Update: script now does this for you] -#- Run the script with "py2exe_setup.py py2exe" -#- You will frequently get messages about missing .dll files. E. g., -# MSVCP90.dll. These are somewhere in your windows install, so you -# can just copy them to your working folder. (or just assume other -# person will have them? any copyright issues with including them?) +#- cd to the folder where this script is stored, usually ...packaging/windows +#- Run the script with python "py2exe_setup.py py2exe" +#- You will frequently get messages about missing .dll files.just assume other +# person will have them? we have copyright issues including some dll's #- If it works, you'll have a new dir fpdb-YYYYMMDD-exe which should # contain 2 dirs; gfx and pyfpdb and run_fpdb.bat #- [ This bit is now automated: @@ -49,27 +45,11 @@ Py2exe script for fpdb. #- You can (should) then prune the etc/, lib/ and share/ folders to # remove components we don't need. (see output at end of program run) -# sqlcoder notes: this worked for me with the following notes: -#- I used the following versions: -# python 2.5.4 -# gtk+ 2.14.7 (gtk_2.14.7-20090119) -# pycairo 1.4.12-2 -# pygobject 2.14.2-2 -# pygtk 2.12.1-3 -# matplotlib 0.98.3 -# numpy 1.4.0 -# py2exe-0.6.9 for python 2.5 -# -#- I also copied these dlls manually from /bin to /dist : -# -# libgobject-2.0-0.dll -# libgdk-win32-2.0-0.dll -# -# Now updated to work with python 2.6 + related dependencies # 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 +# Gimick: restructure to allow script to run from packaging/windows directory, and not to write to source pyfpdb + import os import sys @@ -86,33 +66,14 @@ import py2exe import glob import matplotlib import shutil -from datetime import date +#from datetime import date -origIsSystemDLL = py2exe.build_exe.isSystemDLL def isSystemDLL(pathname): #dwmapi appears to be vista-specific file, not XP if os.path.basename(pathname).lower() in ("dwmapi.dll"): return 0 return origIsSystemDLL(pathname) -py2exe.build_exe.isSystemDLL = isSystemDLL - - -def remove_tree(top): - # Delete everything reachable from the directory named in 'top', - # assuming there are no symbolic links. - # CAUTION: This is dangerous! For example, if top == '/', it - # 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','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: - os.remove(os.path.join(root, name)) - for name in dirs: - os.rmdir(os.path.join(root, name)) - os.rmdir(top) def test_and_remove(top): if os.path.exists(top): @@ -121,31 +82,64 @@ def test_and_remove(top): else: print "Unexpected file '"+top+"' found. Exiting." exit() + +def remove_tree(top): + # Delete everything reachable from the directory named in 'top', + # assuming there are no symbolic links. + # CAUTION: This is dangerous! For example, if top == '/', it + # 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',distdir) and os.path.basename(os.getcwd()) == 'windows': + #print "removing directory '"+top+"' ..." + for root, dirs, files in os.walk(top, topdown=False): + for name in files: + os.remove(os.path.join(root, name)) + for name in dirs: + os.rmdir(os.path.join(root, name)) + os.rmdir(top) -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 -#xxx = sys.stdin.readline().rstrip() -dist_dirname = r'fpdb-' + today + '-exe' -dist_dir = r'..\fpdb-' + today + '-exe' -print +def copy_tree(source,destination): + source = source.replace('\\', '\\\\') + destination = destination.replace('\\', '\\\\') + print "*** Copying " + source + " to " + destination + " ***" + shutil.copytree( source, destination ) -# remove build and dist dirs if they exist +def copy_file(source,destination): + source = source.replace('\\', '\\\\') + destination = destination.replace('\\', '\\\\') + print "*** Copying " + source + " to " + destination + " ***" + shutil.copy( source, destination ) + + +fpdbver = '0.20.906' + +distdir = r'fpdb-' + fpdbver +rootdir = r'../../' #cwd is normally /packaging/windows +pydir = rootdir+'pyfpdb/' +gfxdir = rootdir+'gfx/' +sys.path.append( pydir ) # allows fpdb modules to be found by options/includes below + +print "\n" + r"Output will be created in "+distdir + +print "*** Cleaning working folders ***" test_and_remove('dist') test_and_remove('build') -test_and_remove('pyfpdb') +test_and_remove(distdir) -test_and_remove(dist_dirname) +print "*** Building now in dist folder ***" +origIsSystemDLL = py2exe.build_exe.isSystemDLL +py2exe.build_exe.isSystemDLL = isSystemDLL setup( name = 'fpdb', description = 'Free Poker DataBase', - version = '0.20.903', + version = fpdbver, - windows = [ {'script': 'fpdb.pyw', "icon_resources": [(1, "../gfx/fpdb_large_icon.ico")]}, - {'script': 'HUD_main.pyw', }, - {'script': 'Configuration.py', } + windows = [ {'script': pydir+'fpdb.pyw', "icon_resources": [(1, gfxdir+"fpdb_large_icon.ico")]}, + {'script': pydir+'HUD_main.pyw', }, + {'script': pydir+'Configuration.py', } ], options = {'py2exe': { @@ -158,74 +152,56 @@ setup( ,'PartyPokerToFpdb', 'PokerStarsToFpdb' ,'UltimateBetToFpdb', 'Win2dayToFpdb' ], - 'excludes' : ['_tkagg', '_agg2', 'cocoaagg', 'fltkagg'], # surely we need this? '_gtkagg' + 'excludes' : ['_tkagg', '_agg2', 'cocoaagg', 'fltkagg'], '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', '../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') - #,(r'matplotlibdata', glob.glob(r'c:\python25\Lib\site-packages\matplotlib\mpl-data\*')) + # this code will not walk a tree + # Note: cwd for 1st value is packaging/windows/dist (this is confusing BTW) + # Note: only include files here which are to be put into the package pyfpdb folder or subfolders + + data_files = [('', glob.glob(rootdir+'*.txt')) + ,('', [pydir+'HUD_config.xml.example',pydir+'Cards01.png', pydir+'logging.conf']) ] + matplotlib.get_py2exe_datafiles() ) -# rename completed output package as pyfpdb -os.rename('dist', 'pyfpdb') +# ,(distdir, [rootdir+'run_fpdb.bat']) +# ,(distdir+r'\gfx', glob.glob(gfxdir+'*.*')) +# ] + +print "*** py2exe build phase complete ***" -# 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 ) +# copy zone info and fpdb translation folders +copy_tree (r'c:\python26\Lib\site-packages\pytz\zoneinfo', os.path.join(r'dist', 'zoneinfo')) +copy_tree (pydir+r'locale', os.path.join(r'dist', 'locale')) -# shunt pyfpdb package over to the distribution folder -dest = os.path.join(dist_dirname, 'pyfpdb') -# print "try renaming pyfpdb to", dest -dest = dest.replace('\\', '\\\\') -# print "dest is now", dest -os.rename( 'pyfpdb', dest ) +# create distribution folder and populate with gfx + bat +copy_tree (gfxdir, os.path.join(distdir, 'gfx')) +copy_file (rootdir+'run_fpdb.bat', distdir) -# prompt for gtk location +print "*** Renaming dist folder as distribution pyfpdb folder ***" +dest = os.path.join(distdir, 'pyfpdb') +os.rename( 'dist', dest ) +print "*** copying GTK runtime ***" 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 + print "Enter directory name for GTK (e.g. c:/gtk) : ", # 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') -src = src.replace('\\', '\\\\') -shutil.copy( src, dest ) +print "*** copying GTK runtime ***" +dest = os.path.join(distdir, 'pyfpdb') +copy_file(os.path.join(gtk_dir, 'bin', 'libgdk-win32-2.0-0.dll'), dest ) +copy_file(os.path.join(gtk_dir, 'bin', 'libgobject-2.0-0.dll'), dest) +copy_tree(os.path.join(gtk_dir, 'etc'), os.path.join(dest, 'etc')) +copy_tree(os.path.join(gtk_dir, 'lib'), os.path.join(dest, 'lib')) +copy_tree(os.path.join(gtk_dir, 'share'), os.path.join(dest, 'share')) -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') -dest_dir = dest_dir.replace('\\', '\\\\') -shutil.copytree( src_dir, dest_dir ) - -src_dir = os.path.join(gtk_dir, 'lib') -src_dir = src_dir.replace('\\', '\\\\') -dest_dir = os.path.join(dest, 'lib') -dest_dir = dest_dir.replace('\\', '\\\\') -shutil.copytree( src_dir, dest_dir ) - -src_dir = os.path.join(gtk_dir, 'share') -src_dir = src_dir.replace('\\', '\\\\') -dest_dir = os.path.join(dest, 'share') -dest_dir = dest_dir.replace('\\', '\\\\') -shutil.copytree( src_dir, dest_dir ) - -print "\nIf py2exe was successful you should now have a new dir" -print dist_dirname+" in your pyfpdb dir" +print "*** All done! ***" +test_and_remove('build') +print distdir+" is in the pyfpdb dir" print """ The following dirs can probably removed to make the final package smaller: @@ -243,5 +219,3 @@ pyfpdb/share/themes/Default Use 7-zip to zip up the distribution and create a self extracting archive and that's it! """ - - diff --git a/pyfpdb/AlchemyTables.py b/pyfpdb/AlchemyTables.py index c74665b1..e89380a7 100644 --- a/pyfpdb/AlchemyTables.py +++ b/pyfpdb/AlchemyTables.py @@ -450,7 +450,6 @@ def sss(): self.settings['os']="windows" self.settings.update(self.config.get_db_parameters()) - self.settings.update(self.config.get_tv_parameters()) self.settings.update(self.config.get_import_parameters()) self.settings.update(self.config.get_default_paths()) diff --git a/pyfpdb/BetfairToFpdb.py b/pyfpdb/BetfairToFpdb.py index 62db0311..07ee2612 100755 --- a/pyfpdb/BetfairToFpdb.py +++ b/pyfpdb/BetfairToFpdb.py @@ -44,9 +44,8 @@ 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("^(?PNL|PL|) (?P\$|)?(?P[.0-9]+)/\$?(?P[.0-9]+) (?P(Texas Hold\'em|Omaha Hi|Razz))", re.MULTILINE) - re_SplitHands = re.compile(r'End of hand .{2}-\d{7,9}-\d+ \*\*\*\*\*\n') + re_SplitHands = re.compile(r'\n\n+') re_HandInfo = re.compile("\*\*\*\*\* Betfair Poker Hand History for Game (?P[0-9]+) \*\*\*\*\*\n(?PNL|PL|) (?P\$|)?(?P[.0-9]+)/\$?(?P[.0-9]+) (?P(Texas Hold\'em|Omaha Hi|Razz)) - (?P[a-zA-Z]+, [a-zA-Z]+ \d+, \d\d:\d\d:\d\d GMT \d\d\d\d)\nTable (?P[ a-zA-Z0-9]+) \d-max \(Real Money\)\nSeat (?P- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index c32f9f37..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"): @@ -320,10 +320,8 @@ If a player has None chips he won't be added.""" 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 on hand number %s") % (player, self.handid)) + raise FpdbParseError(_("checkPlayerExists: '%s fail on hand number %s") % (player, self.handid)) def setCommunityCards(self, street, cards): log.debug("setCommunityCards %s %s" %(street, cards)) diff --git a/pyfpdb/HandHistoryConverter.py b/pyfpdb/HandHistoryConverter.py index 64831d61..860d05e1 100644 --- a/pyfpdb/HandHistoryConverter.py +++ b/pyfpdb/HandHistoryConverter.py @@ -70,6 +70,7 @@ class HandHistoryConverter(): # "utf_8" is more likely if there are funny characters codepage = "cp1252" + re_tzOffset = re.compile('^\w+[+-]\d{4}$') def __init__(self, config, in_path = '-', out_path = '-', follow=False, index=0, autostart=True, starsArchive=False, ftpArchive=False): """\ @@ -150,6 +151,7 @@ Otherwise, finish at EOF. log.debug(handText) else: handsList = self.allHandsAsList() + log.debug( _("handsList is ") + str(handsList) ) log.info("Parsing %d hands" % len(handsList)) # Determine if we're dealing with a HH file or a Summary file # quick fix : empty files make the handsList[0] fail ==> If empty file, go on with HH parsing @@ -568,17 +570,32 @@ or None if we fail to get the info """ @staticmethod def changeTimezone(time, givenTimezone, wantedTimezone): - #print "raw time:",time, "given TZ:", givenTimezone + """Takes a givenTimezone in format AAA or AAA+HHMM where AAA is a standard timezone + and +HHMM is an optional offset (+/-) in hours (HH) and minutes (MM) + (See OnGameToFpdb.py for example use of the +HHMM part) + Tries to convert the time parameter (with no timezone) from the givenTimezone to + the wantedTimeZone (currently only allows "UTC") + """ + log.debug( _("raw time:")+str(time) + _(" given TZ:")+str(givenTimezone) ) if wantedTimezone=="UTC": wantedTimezone = pytz.utc else: raise Error #TODO raise appropriate error - + + givenTZ = None + if HandHistoryConverter.re_tzOffset.match(givenTimezone): + offset = int(givenTimezone[-5:]) + givenTimezone = givenTimezone[0:-5] + log.debug( _("changeTimeZone: offset=") + str(offset) ) + else: offset=0 + if givenTimezone=="ET": - givenTimezone = timezone('US/Eastern') + givenTZ = timezone('US/Eastern') elif givenTimezone=="CET": - givenTimezone = timezone('Europe/Berlin') + givenTZ = timezone('Europe/Berlin') #Note: Daylight Saving Time is standardised across the EU so this should be fine + elif givenTimezone == 'GMT': # Greenwich Mean Time (same as UTC - no change to time) + givenTZ = timezone('GMT') elif givenTimezone == 'HST': # Hawaiian Standard Time pass elif givenTimezone == 'AKT': # Alaska Time @@ -612,23 +629,27 @@ or None if we fail to get the info """ elif givenTimezone == 'JST': # Japan Standard Time pass elif givenTimezone == 'AWST': # Australian Western Standard Time - givenTimezone = timezone('Australia/West') + givenTZ = timezone('Australia/West') elif givenTimezone == 'ACST': # Australian Central Standard Time - givenTimezone = timezone('Australia/Darwin') + givenTZ = timezone('Australia/Darwin') elif givenTimezone == 'AEST': # Australian Eastern Standard Time # Each State on the East Coast has different DSTs. # Melbournce is out because I don't like AFL, Queensland doesn't have DST # ACT is full of politicians and Tasmania will never notice. # Using Sydney. - givenTimezone = timezone('Australia/Sydney') + givenTZ = timezone('Australia/Sydney') elif givenTimezone == 'NZT': # New Zealand Time pass else: raise Error #TODO raise appropriate error - localisedTime = givenTimezone.localize(time) - utcTime = localisedTime.astimezone(wantedTimezone) - #print "utcTime:",utcTime + if givenTZ is None: + raise Error #TODO raise appropriate error + # (or just return time unchanged?) + + localisedTime = givenTZ.localize(time) + utcTime = localisedTime.astimezone(wantedTimezone) + datetime.timedelta(seconds=-3600*(offset/100)-60*(offset%100)) + log.debug( _("utcTime:")+str(utcTime) ) return utcTime #end @staticmethod def changeTimezone diff --git a/pyfpdb/OnGameToFpdb.py b/pyfpdb/OnGameToFpdb.py index 26a2ecc9..00ecf6ae 100755 --- a/pyfpdb/OnGameToFpdb.py +++ b/pyfpdb/OnGameToFpdb.py @@ -43,6 +43,8 @@ class OnGame(HandHistoryConverter): codepage = ("utf8", "cp1252") siteId = 5 # Needs to match id entry in Sites database + mixes = { } # Legal mixed games + sym = {'USD': "\$", 'CAD': "\$", 'T$': "", "EUR": "\xe2\x82\xac", "GBP": "\xa3"} # ADD Euro, Sterling, etc HERE substitutions = { 'LEGAL_ISO' : "USD|EUR|GBP|CAD|FPP", # legal ISO currency codes 'LS' : "\$|\xe2\x82\xac|" # legal currency symbols - Euro(cp1252, utf-8) @@ -65,7 +67,8 @@ class OnGame(HandHistoryConverter): #self.rexx.setGameInfoRegex('.*Blinds \$?(?P[.0-9]+)/\$?(?P[.0-9]+)') # Static regexes - re_SplitHands = re.compile(r'End of hand .{2}-\d{7,9}-\d+ \*\*\*\*\*\n') + # ***** End of hand R5-75443872-57 ***** + re_SplitHands = re.compile(u'\*\*\*\*\*\sEnd\sof\shand\s[-A-Z\d]+.*\n(?=\*)') # ***** History for hand R5-75443872-57 ***** # Start hand: Wed Aug 18 19:29:10 GMT+0100 2010 @@ -73,29 +76,33 @@ class OnGame(HandHistoryConverter): re_HandInfo = re.compile(u""" \*\*\*\*\*\sHistory\sfor\shand\s(?P[-A-Z\d]+).* Start\shand:\s(?P.*) - Table:\s(?P
[\'\w]+)\s\[\d+\]\s\( + Table:\s(?P
[\'\w\s]+)\s\[\d+\]\s\( ( - (?PNo\sLimit|Limit|LIMIT|Pot\sLimit)\s + (?PNO_LIMIT|Limit|LIMIT|Pot\sLimit)\s (?PTEXAS_HOLDEM|RAZZ)\s (?P[.0-9]+)/ (?P[.0-9]+) )? """ % substitutions, re.MULTILINE|re.DOTALL|re.VERBOSE) + re_TailSplitHands = re.compile(u'(\*\*\*\*\*\sEnd\sof\shand\s[-A-Z\d]+.*\n)(?=\*)') + re_Button = re.compile('Button: seat (?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