diff --git a/packaging/windows/MySqlPython1.2.3WalkthroughPython27.txt b/packaging/windows/MySqlPython1.2.3WalkthroughPython27.txt new file mode 100644 index 00000000..224bf9f9 --- /dev/null +++ b/packaging/windows/MySqlPython1.2.3WalkthroughPython27.txt @@ -0,0 +1,125 @@ +Create MySqlPython version 1.2.3 windows installer for Python26 + +This walkthrough is derived from excellent installation instructions released under GNU Free Documentation License 1.2. The original work is here ... http://www.bcspcsonline.com/wiki/index.php?title=MySQL-5.1.34_Python-2.6_Module_Build_Instructions The Wiki author appears to be "Irondesk" + +This version by Gimick on 29th June 2010 +Content is available under GNU Free Documentation License 1.2 + +Premamble +--------- + + +The FPDB exe needs to build against the MySql-Python project. Unfortunately, for python 2.6 there is no official installer for windows, and none is ever likely to be provided. + +Community builds are available, but to reduce third-party dependencies, we will build our own here. + +Step 0 Get a fresh XP installation +---------------------------------- + +0.1/ Using XPhome 32bit + + +Step 1, VisualStudio 2008 express install +----------------------------------------- + +1.1/ Get the ISO CD from here ... http://www.microsoft.com/express/Downloads/#2008-All + +1.2/ Run and install Visual C++ only, don't bother with the additional packages offered + +This package will run 30 days before registration is needed + + +Step 2, setup Mysql Server +-------------------------- + +2.1/ Install MySQL server runtime ... http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.34-win32.msi + +Choose Typical, choose configure, choose Standard Configuration, choose all defaults, supply admin username/password. + + +Step 3, more installs +---------------------- + +3.1/ install the following in sequence (accept all default options) there should be no errors ! + +Python 2.7 ... http://python.org/ftp/python/2.7/python-2.7.msi +7zip 914 ... http://sourceforge.net/projects/sevenzip/files/7-Zip/9.14/7z914.exe/download + + +Step 4, grab Mysql server Source +-------------------------------- + +4.1/ Download ... http://downloads.mysql.com/archives/mysql-5.1/mysql-noinstall-5.1.34-win32.zip +4.2/ Unpacking Desktop\mysqlsource (use 7zip) +4.3/ Copy the following source directories to the MySql installation: + +dos> xcopy Desktop\mysqlsource\mysql-5.1.34-win32\data\* "c:\Program Files\MySQL\MySQL Server 5.1\data" /I/E/F/H +dos> xcopy Desktop\mysqlsource\mysql-5.1.34-win32\Embedded\* "c:\Program Files\MySQL\MySQL Server 5.1\Embedded" /I/E/F/H +dos> xcopy Desktop\mysqlsource\mysql-5.1.34-win32\include\* "c:\Program Files\MySQL\MySQL Server 5.1\include" /I/E/F/H +dos> xcopy Desktop\mysqlsource\mysql-5.1.34-win32\lib\* "c:\Program Files\MySQL\MySQL Server 5.1\lib" /I/E/F/H +dos> xcopy Desktop\mysqlsource\mysql-5.1.34-win32\mysql-test\* "c:\Program Files\MySQL\MySQL Server 5.1\mysql-test" /I/E/F/H +dos> xcopy Desktop\mysqlsource\mysql-5.1.34-win32\sql-bench\* "c:\Program Files\MySQL\MySQL Server 5.1\sql-bench" /I/E/F/H + +4.4/ You can delete Destop\mysqlsource, is no longer needed. + + +Step 5, grab Mysql-python source +-------------------------------- + +5.1/ get download +MySql for python ... http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz/download + +5.2/ extract MySQL-python-1.2.3 directory to the Desktop using 7zip +(note: use 7zip, open the gz, then open the tar, then extract the directory found inside there) + +Desktop\MySQL-python-1.2.3 should now exist + + +Step 6, get python build tools +------------------------------ + +6.1/ get Easy Setup installer +Easy setup installer ... http://peak.telecommunity.com/dist/ez_setup.py + +6.2/ Check the DEFAULT VERSION specified in Easy Setup and get the corresponding setuptools (version c11 in this case) +Setuptools version 11 ... http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg + +6.3/ Put both of these files into Desktop\MySQL-python-1.2.3, overwriting any existing files + + +Step 7, install the build tool +------------------------------ + +dos> cd Desktop\MySQL-python-1.2.3 +dos> c:\Python27\python.exe ez_setup.py setuptools-0.6c11-py2.7.egg + + +Step 8, Tweak the configuration +------------------------------- + +dos> cd Desktop\MySQL-python-1.2.3 + +8.1/ dos> write site.cfg + +Change registry_key = SOFTWARE\MySQL AB\MySQL Server 5.0 + to registry_key = SOFTWARE\MySQL AB\MySQL Server 5.1 + + +Step 9, build +------------- + +dos> cd Desktop\MySQL-python-1.2.3 + +9.1/ dos> c:\python27\python.exe setup.py build + +* Note: You will probably get a bunch of warnings and maybe a manifest error status 31, these are ok as long as there are no errors in compiling or linking. +* Note: This will generate the "MySQL-python-1.2.3/build" folder + +9.2/ dos> c:\python27\python.exe setup.py bdist_wininst + + +Step 10, done +------------- + +10.1/ the \dist directory will contain MySQL-python-1.2.3.win32-py2.7.exe !!!!! +10.2/ upload this file to sourceforge diff --git a/packaging/windows/py27-links.txt b/packaging/windows/py27-links.txt index cb1e413c..00f3cd81 100644 --- a/packaging/windows/py27-links.txt +++ b/packaging/windows/py27-links.txt @@ -1,16 +1,24 @@ -This is a list of download links of Windows packages for Python 2.7 of our dependencies. +This is a list of download links of Windows32 packages for Python 2.7 of our dependencies. -These are as of 26Feb2011: -matplotlib 1.0.1 ... http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0.1/ -pygtk 2.22 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.22/ -pycairo 1.8.10 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/1.8/ -pyGobject X ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/2.26/ +These are as of 27Feb2011: - -The below are from Aug2010, and should probably be updated to newer versions: +Required: 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 -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 +gtk+ allinone... http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.22/gtk+-bundle_2.22.1-20101227_win32.zip +matplotlib 1.0.1 ... http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0.1/matplotlib-1.0.1.win32-py2.7.exe/download +pygtk 2.22 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.22/pygtk-2.22.0-1.win32-py2.7.exe +pycairo 1.8.10 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/1.8/pycairo-1.8.10.win32-py2.7.exe +pyGobject X ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/2.26/pygobject-2.26.0-1.win32-py2.7.exe +pywin 216 ... http://sourceforge.net/projects/pywin32/files/pywin32/Build216/pywin32-216.win32-py2.7.exe/download +numpy 1.5.1 ... http://sourceforge.net/projects/numpy/files/NumPy/1.5.1/numpy-1.5.1-win32-superpack-python2.7.exe/download +pypokereval 138 ... http://sourceforge.net/projects/fpdb/files/fpdb/pokereval-138.win32-py2.7.exe/download + +optional: +cdecimal 2.2 ... http://www.bytereef.org/software/mpdecimal/releases/cdecimal-2.2.win32-py2.7.msi +mysql-python 1.2.3 ... http://sourceforge.net/projects/fpdb/files/fpdb/MySQL-python-1.2.3.win32-py2.7.exe/download +psycopg2 ... http://www.stickpeople.com/projects/python/win-psycopg/psycopg2-2.3.1.win32-py2.7-pg9.0.1-release.exe + +Developers only: +py2exe 0.6.9 ... http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/py2exe-0.6.9.win32-py2.7.exe/download diff --git a/packaging/windows/py2exeWalkthroughPython27.txt b/packaging/windows/py2exeWalkthroughPython27.txt new file mode 100644 index 00000000..f2ad23f6 --- /dev/null +++ b/packaging/windows/py2exeWalkthroughPython27.txt @@ -0,0 +1,229 @@ +PY2EXE walkthrough for Python 2.7 & FPDB 0.2x +created on 27th Feb 2011 by Gimick + +This walkthrough is derived from comments in the py2exe script made by Ray and SqlCoder +Additional information, formatting, updating to Python 2.6 and Python 2.7 and sequencing added by Gimick +Content is available under the the GNU Affero General Public License version 3 + + + +Step 0 Get a fresh XP installation +---------------------------------- + +0.1/ Using XPhome or Pro 32bit + +0.2/ Ensure the CPU supports SSE2 instruction set or better. + + +Step 1, dependency install +-------------------------- + +1.1/ install the following in sequence (accept all default options) there should be no errors ! + +Python 2.7 ... http://python.org/ftp/python/2.7/python-2.7.msi +matplotlib 1.0.1 ... http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0.1/matplotlib-1.0.1.win32-py2.7.exe/download +pygtk 2.22 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.22/pygtk-2.22.0-1.win32-py2.7.exe +pycairo 1.8.10 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/1.8/pycairo-1.8.10.win32-py2.7.exe +pyGobject X 2.26 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/2.26/pygobject-2.26.0-1.win32-py2.7.exe +pywin 216 ... http://sourceforge.net/projects/pywin32/files/pywin32/Build216/pywin32-216.win32-py2.7.exe/download + +pypokereval 138 ... http://sourceforge.net/projects/fpdb/files/fpdb/pokereval-138.win32-py2.7.exe/download +cdecimal 2.2 ... http://www.bytereef.org/software/mpdecimal/releases/cdecimal-2.2.win32-py2.7.msi +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) + +py2exe 0.6.9 ... http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/py2exe-0.6.9.win32-py2.7.exe/download + +1.2/ MySQL + +Install the following file: +mysql-python 1.2.3 ... http://sourceforge.net/projects/fpdb/files/fpdb/MySQL-python-1.2.3.win32-py2.7.exe/download + +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 gmail.com> on the py2exe mailing list for documenting this problem and solution. + +1.3.1/ Navigate to C:\Python27\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 + + +1.4/ Patch py2exe to stop popup runtime error message + +see http://www.py2exe.org/index.cgi/StderrLog for technical info. + +1.4.1/ + +dos> write C:\Python27\Lib\site-packages\py2exe\boot_common.py + +replace: + atexit.register(alert, 0, + "See the logfile '%s' for details" % fname, + "Errors occurred") +with: + #atexit.register(alert, 0, + # "See the logfile '%s' for details" % fname, + # "Errors occurred") + +1.4.2/ save and exit + + + +Step 2 Setup GTK +----------------- + +There are quite a few GTK packages needed, and rather than install them individually, I used the official AllinOne from the GTK project. + +2,1/ Create a new folder c:\GTK + +2.2/ Extract the following zip file into c:\GTK + +gtk+ allinone 2.22.1 ... http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.22/gtk+-bundle_2.22.1-20101227_win32.zip + +2.3/ If everything has worked, you should have c:\GTK\bin \etc \lib \src and so on created. + +2.4/ The /share/doc and /share/gtk-doc folders are huge, so can be emptied now (leave the /doc and /gtk-doc folders + in place, but delete the content) + + +Step 3 Set GTK into the PATH variable +------------------------------------- + +The path for GTK isn't set by default, so need to let the o/s know where the GTK stuff is. + +3.1/ Rightclick on mycomputer to show system properties +3.2/ select advanced/environment Variables +3.3/ in "system variables" NOT "user variables" do the following +3.3.1/ create a new item as name: GTK_BASEPATH value: c:\GTK +3.3.2/ edit the item "path", press home to get to the first character and insert the following text, (no quotes, including semicolon) %GTK_BASEPATH%\bin; + +3.4/ to check, open command prompt and do: + +dos>path ... system should respond with ... PATH=c:\GTK\bin;C:\WIN........ + +3.5/ Give it a spin to test (hopefully an application will start, if not, something has gone wrong) + +dos> gtk-demo + + +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 +----------------------------------------- + +Numpy needs special handling, as by default it will install an optimised version for the SSE level of your CPU (SSE3, SSE2 or noSSE). This means that the completed package will not run on an older CPU. + +For this reason, do not just run the installer. We will force a nosse version, to minimise problems on +older client PC's + +5.3.1/ download the package to the Desktop + +numpy 1.5.1 ... http://sourceforge.net/projects/numpy/files/NumPy/1.5.1/numpy-1.5.1-win32-superpack-python2.7.exe/download + +5.3.3/ You are normally wanting to build a package which works on all CPU's, so install for noSSE as follows: + +dos> cd Desktop +dos> numpy-1.5.1-win32-superpack-python2.7.exe /arch nosse + +5.3.4/ At the end of the installation, click on "show details" to confirm the installation. + +"Target CPU handles SSE2" +"Target CPU handles SSE3" +"nosse install (arch value: nosse)" +"Install NO SSE" +Extract: numpy-1.5.1-nosse.exe... 100% +Execute: "C:\DOCUME~1\user\LOCALS~1\Temp\numpy-1.5.1-nosse.exe" +Completed + +Step 6 Run py2exe to generate fpdb.exe +-------------------------------------- + +6.0/ Set version number of build folder +dos> cd Desktop\fpdb\packaging\windows +dos> write py2exe_setup.py +change the value of fpdbver and save file + +6.1/ Run the script to create the fpdb.exe bundle + +dos> cd Desktop\fpdb\packaging\windows +dos> c:\python27\python.exe py2exe_setup.py py2exe + +wait a while, watch lots of copying and whatever. + +6.2/ You should next get prompted for the GTK folder. +Enter c:\GTK + +6.3/ If there are no errors reported, it has probably worked, we will test soon. + +Build notes: + +There is a warning about dll's not included "umath.pyd - c:\Python27\lib\site-packages\numpy\core\umath.pyd" + - reason for this is not understood at present. (Umath is apparently included in the built package). + + +Step 7 not currently used +------------------------- + +Has been deleted + + +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. + +8.1/ Drag Desktop\fpdb\packaging\windows\fpdb-n.nn.nnn to Desktop\ + + +Step 9 Initial run +------------------ + +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 + +9.5/ hopefully, fpdb will run +9.6/ Try out a few options, deal with any errors reported + +Observe that the msvcp90.dll was provided by the python runtime package, so we don't have to install the separate package from Microsoft. End-users will, however need the dependency. + + +Step 11 deleted +--------------- + +Has been deleted + + +Step 12 rename folder +--------------------- + +If needed, rename the folder to something meaningful to the community. + +Step 13 Compress to executable archive +-------------------------------------- + +13.1/ Download and install 7zip 914 ... http://sourceforge.net/projects/sevenzip/files/7-Zip/9.14/7z914.exe/download +13.2/ Rightclick on fpdb executable folder, select 7zip Add to archive... select SFX archive option switch +13.3/ Test the created exe file diff --git a/packaging/windows/py2exe_setup.py b/packaging/windows/py2exe_setup.py index 210aaf5a..f472a320 100644 --- a/packaging/windows/py2exe_setup.py +++ b/packaging/windows/py2exe_setup.py @@ -24,32 +24,25 @@ Py2exe script for fpdb. ######################################################################## #TODO: -# get rid of all the uneeded libraries (e.g., pyQT) # think about an installer -# done: change GuiAutoImport so that it knows to start HUD_main.exe, when appropriate -# include the lib needed to handle png files in mucked - #HOW TO USE this script: # +#- edit the fpdbver variable in this script (this value will be used to create the distribution folder name) #- 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 +#- If it works, you'll have a new dir fpdb-version which should # contain 2 dirs; gfx and pyfpdb and run_fpdb.bat -#- [ This bit is now automated: -# Last, you must copy the etc/, lib/ and share/ folders from your -# gtk/bin/ (just /gtk/?) folder to the pyfpdb folder. (the whole folders, -# not just the contents) ] -#- 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) # See walkthrough in packaging directory for versions used +# Very useful guide here : http://www.no-ack.org/2010/09/complete-guide-to-py2exe-for-pygtk.html # 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 +fpdbver = '0.22' import os import sys @@ -61,12 +54,16 @@ except: print "A parameter is required, quitting now" quit() +if sys.argv[1] <> "py2exe": + print "Parameter 1 is not valid, quitting now" + quit() + from distutils.core import setup import py2exe import glob import matplotlib import shutil -#from datetime import date +import cdecimal def isSystemDLL(pathname): #dwmapi appears to be vista-specific file, not XP @@ -75,12 +72,15 @@ def isSystemDLL(pathname): return origIsSystemDLL(pathname) def test_and_remove(top): + #print "Attempting to delete:", top if os.path.exists(top): if os.path.isdir(top): remove_tree(top) else: print "Unexpected file '"+top+"' found. Exiting." exit() + else: + "oops folder not found" def remove_tree(top): # Delete everything reachable from the directory named in 'top', @@ -89,8 +89,8 @@ 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',distdir) and os.path.basename(os.getcwd()) == 'windows': - #print "removing directory '"+top+"' ..." + if (top in ('build','dist') or top.startswith(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)) @@ -111,8 +111,6 @@ def copy_file(source,destination): shutil.copy( source, destination ) -fpdbver = '0.21.rc1' - distdir = r'fpdb-' + fpdbver rootdir = r'../../' #cwd is normally /packaging/windows pydir = rootdir+'pyfpdb/' @@ -172,20 +170,17 @@ setup( ] + matplotlib.get_py2exe_datafiles() ) -# ,(distdir, [rootdir+'run_fpdb.bat']) -# ,(distdir+r'\gfx', glob.glob(gfxdir+'*.*')) -# ] + print "*** py2exe build phase complete ***" # 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 (r'c:\python27\Lib\site-packages\pytz\zoneinfo', os.path.join(r'dist', 'zoneinfo')) copy_tree (pydir+r'locale', os.path.join(r'dist', 'locale')) # create distribution folder and populate with gfx + bat copy_tree (gfxdir, os.path.join(distdir, 'gfx')) copy_file (rootdir+'run_fpdb.bat', distdir) -print "*** Renaming dist folder as distribution pyfpdb folder ***" +print "*** Renaming dist folder as pyfpdb folder ***" dest = os.path.join(distdir, 'pyfpdb') os.rename( 'dist', dest ) @@ -203,23 +198,27 @@ 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')) -print "*** All done! ***" +print "*** Activating MS-Windows GTK theme ***" +gtkrc = open(os.path.join(distdir, 'pyfpdb', 'etc', 'gtk-2.0', 'gtkrc'), 'w') +print >>gtkrc, 'gtk-theme-name = "MS-Windows"' +gtkrc.close() + +print "*** deleting temporary build folder ***" test_and_remove('build') -print distdir+" is in the pyfpdb dir" -print """ -The following dirs can probably removed to make the final package smaller: -pyfpdb/lib/glib-2.0 -pyfpdb/lib/gtk-2.0/include -pyfpdb/lib/pkgconfig -pyfpdb/share/aclocal -pyfpdb/share/doc -pyfpdb/share/glib-2.0 -pyfpdb/share/gtk-2.0 -pyfpdb/share/gtk-doc -pyfpdb/share/locale -pyfpdb/share/man -pyfpdb/share/themes/Default +print "*** deleting folders to shrink package size ***" +test_and_remove(os.path.join(distdir, 'pyfpdb', 'lib', 'glib-2.0')) +test_and_remove(os.path.join(distdir, 'pyfpdb', 'lib', 'gtk-2.0','include')) +test_and_remove(os.path.join(distdir, 'pyfpdb', 'lib', 'pkgconfig')) +test_and_remove(os.path.join(distdir, 'pyfpdb', 'share', 'aclocal')) +test_and_remove(os.path.join(distdir, 'pyfpdb', 'share', 'doc')) +test_and_remove(os.path.join(distdir, 'pyfpdb', 'share', 'glib-2.0')) +test_and_remove(os.path.join(distdir, 'pyfpdb', 'share', 'gtk-2.0')) +test_and_remove(os.path.join(distdir, 'pyfpdb', 'share', 'gtk-doc')) +test_and_remove(os.path.join(distdir, 'pyfpdb', 'share', 'locale')) +test_and_remove(os.path.join(distdir, 'pyfpdb', 'share', 'man')) -Use 7-zip to zip up the distribution and create a self extracting archive and that's it! -""" +print "***++++++++++++++++++++++++++++++++++++++++++++++" +print "All done!" +print "The distribution folder "+distdir+" is in the pyfpdb dir" +print "***++++++++++++++++++++++++++++++++++++++++++++++" diff --git a/packaging/windows/pypoker138walkthrough.txt b/packaging/windows/pypoker138walkthrough.txt index 1c7ee0f4..62004e7a 100644 --- a/packaging/windows/pypoker138walkthrough.txt +++ b/packaging/windows/pypoker138walkthrough.txt @@ -1,191 +1,210 @@ -pypokereval build for windows stepbystep guide ----------------------------------------------- - -Created by Gimick on 3rd December 2010 - -This walkthrough is derived with the assistance of EricBlade and the build notes -supplied by Loic Dachary http://dachary.org/ - -Content is available under the the GNU Affero General Public License version 3 - - -0. Build environ ----------------- - -We are building against the 2008 runtime because Python 2.6 - has the same dependency (msvcr90.dll version 9.0.21022.8) - -Using winXPhome 32 bit - -1 Visual studio ---------------- - -1.1/ Get the ISO CD from here ... http://www.microsoft.com/express/Downloads/#2008-All - -1.2/ Run and install Visual C++ only, don't bother with the additional packages offered - -This package will run 30 days before registration is needed - -2. Python runtime ------------------ - -2.1/ Install python runtime from here ... - -Python 2.6.5 ... http://www.python.org/ftp/python/2.6.5/python-2.6.5.msi - -3. Source install ------------------ - -3.1/ grab sources from here - -pypoker-eval v138 ... http://download.gna.org/pokersource/sources/pypoker-eval-138.0.tar.gz -poker-eval v138 ... http://download.gna.org/pokersource/sources/poker-eval-138.0.tar.gz - -3.2/ unpack and place the pypoker-eval-138 directory in c:\ -3.2.1/ rename to pypoker-eval - -3.3/ unpack and place the poker-eval-138 directory in c:\ -3.3.1/ rename to poker-eval - -Important: the build will fail with bizarre missing header files if the project is placed - in a directory containing a space character - you have been warned! - -4. Update source file ---------------------- - -4.1/ dos> write c:/pypoker-eval/pypokereval.c - -change this: - -#define VERSION_NAME(W) W##2_4 -#define PYTHON_VERSION "2_4" - -to be this: - -#define VERSION_NAME(W) W##2_6 -#define PYTHON_VERSION "2_6" - -4.2/ save and exit - -4.3/ dos> write c:/pypoker-eval/pokereval.py - -Comment-out this line: - -_pokereval = __import__('_pokereval_' + sys.version[0] + '_' + sys.version[2]) - -Insert this one in its' place: - -import _pokereval_2_6 as _pokereval - - -4.4/ save and exit - - -5. Build pre-preparation ------------------------- - -(Here we are converting the two project definition files to 2008) - -5.1 navigate to directory c:/poker-eval -5.1.1 double click poker-eval.vcproj -5.1.2 Visual studio will launch and make a conversion - accept all defaults -5.1.3 exit and save - -5.2 navigate to directory c:/pypoker-eval -5.2.1 double click pypoker-eval.vcproj -5.2.2 Visual studio will launch and make a conversion - accept all defaults -5.2.3 exit - -6. build preparation --------------------- - -6.2 navigate to directory c:/pypoker-eval -6.2.1 double click pypoker-eval.vcproj - visual studio should launch - -6.2.3 Select Build...configuration manager... - Select "active solution configuration" to "Release" - (The configuration for both projects will change to "Release") - -6.2.3 Close the configuration manager - -6.2.4 In the solution explorer window, hilight pythonpoker-eval / right mouse / properties... - -6.2.5 In the pythonpoker-eval properties dialog, - -change references to "python24" to "python26" in the following: - - = C/C++/Additional Include Directories/ - = linker/general/Additional library directories - = linker/input/Additional Dependencies - -Change the following - - = linker/generate debug info - set to No - = linker/debugging/Generate debug info - set to No - -6.2.6 Apply all changes to the properties dialog and close - -6.3 Exit from visual studio - -7. Build poker eval -------------------- - -7.1 navigate to directory c:/poker-eval -7.1.1 double click poker-eval.vcproj -7.1.2 Visual studio will launch - -7.2 In the solution explorer window, hilight poker-eval / right mouse / build - -7.3 There should be no errors - -7.4 Exit from visual studio - - -8. Build pypoker eval ---------------------- - -8.1 navigate to directory c:/pypoker-eval -8.1.1 double click pypoker-eval.vcproj -8.1.2 Visual studio will launch - -8.2 In the solution explorer window, hilight pythonpoker-eval / right mouse / build - -8.3 There should be no errors (but a few warnings) - -8.4 Exit from visual studio - -9. packaging ------------- - -9.1 Navigate to c:/pypoker-eval/release -9.2 the output file is pypokereval.dll -9.3 rename this file to _pokereval_2_6.pyd - -9.4 create a zip file containing : - -_pokereval_2_6.pyd from releases -test.py from pypoker-eval-138.0 -pokereval.py from pypoker-eval-138.0 -poker-eval.vcproj from c:\poker-eval -pypoker-eval.vcproj from c:\pypoker-eval -pypokereval.c from c:\pypoker-eval - -Remember to include the version (138), python 265 and win32 in the package filename - -10. Installation and Testing ----------------------------- - -Python 2.6.5 must be installed - -10.1 Extract this package to directory -10.2 Change directory to the directory in 10.1 -10.3 execute dos> c:\Python26\python.exe test.py -10.4 hand-output should scroll down the screen -10.5 start the python interpreter -10.6 >>> import pokereval -10.7 No errors should be seen - - - - - +pypokereval build for windows stepbystep guide +---------------------------------------------- + +Created by Gimick on 3rd December 2010 +Updated for py27 by Gimick 27th Feb 2011 + +This walkthrough is derived with the assistance of EricBlade and the build notes +supplied by Loic Dachary http://dachary.org/ + +Content is available under the the GNU Affero General Public License version 3 + + +0. Build environ +---------------- + +We are building against the 2008 runtime because Python 2.7 + has the same dependency (msvcr90.dll version 9.0.21022.8) + +Using winXPhome 32 bit + +1 Visual studio +--------------- + +1.1/ Get the ISO CD from here ... http://www.microsoft.com/express/Downloads/#2008-All + +1.2/ Run and install Visual C++ only, don't bother with the additional packages offered + +This package will run 30 days before registration is needed + +2. Python runtime +----------------- + +2.1/ Install python runtime from here ... + +Python 2.7 ... http://python.org/ftp/python/2.7/python-2.7.msi + +3. Source install +----------------- + +3.1/ grab sources from here + +pypoker-eval v138 ... http://download.gna.org/pokersource/sources/pypoker-eval-138.0.tar.gz +poker-eval v138 ... http://download.gna.org/pokersource/sources/poker-eval-138.0.tar.gz + +3.2/ unpack and place the pypoker-eval-138 directory in c:\ +3.2.1/ rename to pypoker-eval + +3.3/ unpack and place the poker-eval-138 directory in c:\ +3.3.1/ rename to poker-eval + +Important: the build will fail with bizarre missing header files if the project is placed + in a directory containing a space character - you have been warned! + +4. Update source file +--------------------- + +4.1/ dos> write c:/pypoker-eval/pypokereval.c + +change this: + +#define VERSION_NAME(W) W##2_4 +#define PYTHON_VERSION "2_4" + +to be this: + +#define VERSION_NAME(W) W##2_7 +#define PYTHON_VERSION "2_7" + +- - - - - - + +Move this block of code: + +#ifdef _DEBUG // for Windows python23_d.lib is not in distribution... ugly but works + #undef _DEBUG + #include + #define _DEBUG +#else + #include +#endif + +To be after this line: + +#include "enumdefs.h" + +4.2/ save and exit + +- - - - - + +4.3/ dos> write c:/pypoker-eval/pokereval.py + +Comment-out this line: + +_pokereval = __import__('_pokereval_' + sys.version[0] + '_' + sys.version[2]) + +Insert this one in its' place: + +import _pokereval_2_7 as _pokereval + + +4.4/ save and exit + + +5. Build pre-preparation +------------------------ + +(Here we are converting the two project definition files to 2008) + +5.1 navigate to directory c:/poker-eval +5.1.1 double click poker-eval.vcproj +5.1.2 Visual studio will launch and make a conversion - accept all defaults +5.1.3 exit and save + +5.2 navigate to directory c:/pypoker-eval +5.2.1 double click pypoker-eval.vcproj +5.2.2 Visual studio will launch and make a conversion - accept all defaults +5.2.3 exit + +6. build preparation +-------------------- + +6.2 navigate to directory c:/pypoker-eval +6.2.1 double click pypoker-eval.vcproj - visual studio should launch + +6.2.3 Select Build...configuration manager... + Select "active solution configuration" to "Release" + (The configuration for both projects will change to "Release") + +6.2.3 Close the configuration manager + +6.2.4 In the solution explorer window, hilight pythonpoker-eval / right mouse / properties... + +6.2.5 In the pythonpoker-eval properties dialog, + +change references to "python24" to "python27" in the following: + + = C/C++/Additional Include Directories/ + = linker/general/Additional library directories + = linker/input/Additional Dependencies + +Change the following + + = linker/generate debug info - set to No + +6.2.6 Apply all changes to the properties dialog and close + +6.3 Exit from visual studio + +7. Build poker eval +------------------- + +7.1 navigate to directory c:/poker-eval +7.1.1 double click poker-eval.vcproj +7.1.2 Visual studio will launch + +7.2 In the solution explorer window, hilight poker-eval / right mouse / build + +7.3 There should be no errors + +7.4 Exit from visual studio + + +8. Build pypoker eval +--------------------- + +8.1 navigate to directory c:/pypoker-eval +8.1.1 double click pypoker-eval.vcproj +8.1.2 Visual studio will launch + +8.2 In the solution explorer window, hilight pythonpoker-eval / right mouse / build + +8.3 There should be no errors (but a few warnings) + +8.4 Exit from visual studio + +9. Wrap-up +---------- + +9.1 Navigate to c:/pypoker-eval/release +9.2 the output file is pypokereval.dll +9.3 rename this file to _pokereval_2_7.pyd + +9.4 create a zip file containing : + +_pokereval_2_7.pyd from releases +test.py from pypoker-eval-138.0 +pokereval.py from pypoker-eval-138.0 +poker-eval.vcproj from c:\poker-eval +pypoker-eval.vcproj from c:\pypoker-eval +pypokereval.c from c:\pypoker-eval + +Remember to include the version (138), python 27 and win32 in the package filename + +10. Testing +----------- + +Python 2.7 must be installed + +10.1 Extract the zip file created in 9.4 into a new directory +10.2 Change directory to the directory in 10.1 +10.3 execute dos> c:\Python27\python.exe test.py +10.4 hand-output should scroll down the screen +10.5 start the python interpreter +10.6 >>> import pokereval +10.7 No errors should be seen + +11. Packaging +------------- + +Please follow pypokereval-win32-packaging-walkthrough.txt in the same directory as this walkthrough. + diff --git a/pyfpdb/AbsoluteToFpdb.py b/pyfpdb/AbsoluteToFpdb.py index c31a52ab..26e0a564 100755 --- a/pyfpdb/AbsoluteToFpdb.py +++ b/pyfpdb/AbsoluteToFpdb.py @@ -202,10 +202,10 @@ class Absolute(HandHistoryConverter): if m is None or fname_info is None: if m is None: tmp = hand.handText[0:100] - logging.error(_("Didn't match re_HandInfo: '%s'") % tmp) - raise FpdbParseError("Absolute: " + _("Didn't match re_HandInfo: '%s'") % tmp) + logging.error(_("No match in readHandInfo: '%s'") % tmp) + raise FpdbParseError("Absolute: " + _("No match in readHandInfo: '%s'") % tmp) elif fname_info is None: - logging.error(_("readHandInfo: File name didn't match re_*InfoFromFilename")) + logging.error(_("File name didn't match re_*InfoFromFilename")) logging.error(_("File name: %s") % self.in_path) raise FpdbParseError("Absolute: " + _("Didn't match re_*InfoFromFilename: '%s'") % self.in_path) @@ -349,7 +349,7 @@ class Absolute(HandHistoryConverter): bet = action.group('BET').replace(',', '') hand.addComplete( street, action.group('PNAME'), bet) else: - logging.debug(_("Unimplemented readAction: %s %s") % (action.group('PNAME'),action.group('ATYPE'))) + logging.debug(_("Unimplemented readAction: '%s' '%s'") % (action.group('PNAME'),action.group('ATYPE'))) def readShowdownActions(self, hand): diff --git a/pyfpdb/AlchemyMappings.py b/pyfpdb/AlchemyMappings.py index 53f59a1a..40e7a5e4 100644 --- a/pyfpdb/AlchemyMappings.py +++ b/pyfpdb/AlchemyMappings.py @@ -370,6 +370,7 @@ class Site(object): (10, 'Partouche', 'PA'), (11, 'Carbon', 'CA'), (12, 'PKR', 'PK'), + (13, 'PacificPoker', 'P8'), ] INITIAL_DATA_KEYS = ('id', 'name', 'code') diff --git a/pyfpdb/Anonymise.py b/pyfpdb/Anonymise.py index 4b603e75..6b00e3c6 100755 --- a/pyfpdb/Anonymise.py +++ b/pyfpdb/Anonymise.py @@ -52,7 +52,7 @@ else: m = hhc.re_PlayerInfo.finditer(filecontents) outfile = options.filename+".anon" -print _("Output being written to"), outfile +print (_("Output being written to %s") % outfile) savestdout = sys.stdout fsock = open(outfile,"w") diff --git a/pyfpdb/BetfairToFpdb.py b/pyfpdb/BetfairToFpdb.py index 8c9664ab..446bbbee 100755 --- a/pyfpdb/BetfairToFpdb.py +++ b/pyfpdb/BetfairToFpdb.py @@ -105,8 +105,8 @@ class Betfair(HandHistoryConverter): def readHandInfo(self, hand): m = self.re_HandInfo.search(hand.handText) if(m == None): - log.error(_("Didn't match re_HandInfo")) - raise FpdbParseError(_("No match in readHandInfo.")) + log.error(_("No match in readHandInfo: '%s'") % hand.handText[0:100]) + raise FpdbParseError(_("No match in readHandInfo: '%s'") % hand.handText[0:100]) logging.debug("HID %s, Table %s" % (m.group('HID'), m.group('TABLE'))) hand.handid = m.group('HID') hand.tablename = m.group('TABLE') @@ -196,7 +196,7 @@ class Betfair(HandHistoryConverter): elif action.group('ATYPE') == 'checks': hand.addCheck( street, action.group('PNAME')) else: - sys.stderr.write(_("DEBUG: ") + _("unimplemented readAction: '%s' '%s'") % (action.group('PNAME'),action.group('ATYPE'))) + sys.stderr.write(_("DEBUG: ") + _("Unimplemented readAction: '%s' '%s'") % (action.group('PNAME'),action.group('ATYPE'))) def readShowdownActions(self, hand): diff --git a/pyfpdb/CarbonToFpdb.py b/pyfpdb/CarbonToFpdb.py index 1ddba430..0f0822bf 100644 --- a/pyfpdb/CarbonToFpdb.py +++ b/pyfpdb/CarbonToFpdb.py @@ -160,9 +160,9 @@ or None if we fail to get the info """ def readHandInfo(self, hand): m = self.re_HandInfo.search(hand.handText) if m is None: - logging.info(_("Didn't match re_HandInfo")) + logging.info(_("No match in readHandInfo: '%s'") % hand.handText[0:100]) logging.info(hand.handText) - raise FpdbParseError(_("No match in readHandInfo.")) + raise FpdbParseError(_("No match in readHandInfo: '%s'") % hand.handText[0:100]) logging.debug("HID %s-%s, Table %s" % (m.group('HID1'), m.group('HID2'), m.group('TABLE')[:-1])) hand.handid = m.group('HID1') + m.group('HID2') @@ -264,8 +264,7 @@ or None if we fail to get the info """ elif action.group('ATYPE') == 'ALL_IN': hand.addAllIn(street, player, action.group('BET')) else: - logging.debug(_("Unimplemented readAction: %s %s") - % (action.group('PSEAT'),action.group('ATYPE'))) + logging.debug(_("Unimplemented readAction: '%s' '%s'") % (action.group('PSEAT'),action.group('ATYPE'))) def readShowdownActions(self, hand): for shows in self.re_ShowdownAction.finditer(hand.handText): diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index f24d76aa..da22a363 100644 --- a/pyfpdb/Configuration.py +++ b/pyfpdb/Configuration.py @@ -55,7 +55,10 @@ log = logging.getLogger("config") def get_default_config_path(): """Returns the path where the fpdb config file _should_ be stored.""" if os.name == 'posix': - config_path = os.path.join(os.path.expanduser("~"), '.fpdb') + if (os.uname()[0]=="Darwin"): + config_path = os.path.join(os.getenv("HOME"), ".fpdb") + else: + config_path = os.path.join(os.path.expanduser("~"), '.fpdb') elif os.name == 'nt': config_path = os.path.join(unicode(os.environ[u"APPDATA"], "latin-1"), u"fpdb") #print u"path after joining in get_default_config_path:",config_path @@ -75,7 +78,6 @@ def get_exec_path(): def get_config(file_name, fallback = True): """Looks in cwd and in self.default_config_path for a config file.""" - # look for example file even if not used here, path is returned to caller config_found,example_found,example_copy = False,False,False config_path, example_path = None,None @@ -85,17 +87,17 @@ def get_config(file_name, fallback = True): config_path = os.path.join(exec_dir, 'pyfpdb', file_name) else: config_path = os.path.join(exec_dir, file_name) -# print "config_path=", config_path + #print "config_path=", config_path if os.path.exists(config_path): # there is a file in the cwd config_found = True # so we use it else: # no file in the cwd, look where it should be in the first place default_dir = get_default_config_path() config_path = os.path.join(default_dir, file_name) -# print "config path 2=", config_path + #print "config path 2=", config_path if os.path.exists(config_path): config_found = True - -# Example configuration for debian package + + # 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 @@ -109,7 +111,14 @@ def get_config(file_name, fallback = True): msg = _("Config file has been created at %s.\n") % config_path logging.info(msg) except IOError: - pass + try: + example_path = file_name + '.example' + shutil.copyfile(example_path, config_path) + example_copy = True + msg = _("Config file has been created at %s.\n") % config_path + logging.info(msg) + except IOError: + pass # OK, fall back to the .example file, should be in the start dir elif os.path.exists(file_name + ".example"): @@ -482,7 +491,6 @@ class Import: self.node = node self.interval = node.getAttribute("interval") self.callFpdbHud = node.getAttribute("callFpdbHud") - self.hhArchiveBase = node.getAttribute("hhArchiveBase") self.ResultsDirectory = node.getAttribute("ResultsDirectory") self.hhBulkPath = node.getAttribute("hhBulkPath") self.saveActions = string_to_bool(node.getAttribute("saveActions"), default=False) @@ -492,8 +500,8 @@ class Import: self.saveStarsHH = string_to_bool(node.getAttribute("saveStarsHH"), default=False) def __str__(self): - return " interval = %s\n callFpdbHud = %s\n hhArchiveBase = %s\n saveActions = %s\n fastStoreHudCache = %s\nResultsDirectory = %s" \ - % (self.interval, self.callFpdbHud, self.hhArchiveBase, self.saveActions, self.cacheSessions, self.sessionTimeout, self.fastStoreHudCache, self.ResultsDirectory) + return " interval = %s\n callFpdbHud = %s\n saveActions = %s\n fastStoreHudCache = %s\nResultsDirectory = %s" \ + % (self.interval, self.callFpdbHud, self.saveActions, self.cacheSessions, self.sessionTimeout, self.fastStoreHudCache, self.ResultsDirectory) class HudUI: def __init__(self, node): @@ -712,7 +720,7 @@ class Config: while added > 0 and n < 2: n = n + 1 log.info(_("Reading configuration file %s") % file) - print _("\nReading configuration file %s\n") % file + print (("\n"+_("Reading configuration file %s")+"\n") % file) try: doc = xml.dom.minidom.parse(file) self.doc = doc @@ -858,9 +866,6 @@ class Config: return nodes_added - def set_hhArchiveBase(self, path): - self.imp.node.setAttribute("hhArchiveBase", path) - def find_default_conf(self): if os.name == 'posix': config_path = os.path.join(os.path.expanduser("~"), '.fpdb', 'default.conf') @@ -1258,10 +1263,6 @@ class Config: try: imp['interval'] = self.imp.interval except: imp['interval'] = 10 - # hhArchiveBase is the temp store for part-processed hand histories - should be redundant eventually - try: imp['hhArchiveBase'] = self.imp.hhArchiveBase - except: imp['hhArchiveBase'] = "~/.fpdb/HandHistories/" - # ResultsDirectory is the local cache for downloaded results # NOTE: try: except: doesn'tseem to be triggering # using if instead diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 4efc832f..3898c65d 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1519,6 +1519,7 @@ class Database: c.execute("INSERT INTO Sites (name,code) VALUES ('Betfair', 'BF')") c.execute("INSERT INTO Sites (name,code) VALUES ('Absolute', 'AB')") c.execute("INSERT INTO Sites (name,code) VALUES ('PartyPoker', 'PP')") + c.execute("INSERT INTO Sites (name,code) VALUES ('PacificPoker', 'P8')") c.execute("INSERT INTO Sites (name,code) VALUES ('Partouche', 'PA')") c.execute("INSERT INTO Sites (name,code) VALUES ('Carbon', 'CA')") c.execute("INSERT INTO Sites (name,code) VALUES ('PKR', 'PK')") @@ -2054,6 +2055,14 @@ class Database: cursor = self.get_cursor() for row in inserts: + #convert all True/False values to numeric 0/1 + # needed because columns in hudcache are not BOOL they are INT + # and are being summed if an existing hudcache entry exists + # psycopg2 module does not automatically convert these to numeric. + # mantis bug #93 + for ind in range(len(row)): + if row[ind] == True: row[ind] = 1 + if row[ind] == False: row[ind] = 0 # Try to do the update first: num = cursor.execute(update_hudcache, row) #print "DEBUG: values: %s" % row[-6:] diff --git a/pyfpdb/EverestToFpdb.py b/pyfpdb/EverestToFpdb.py index d55cc922..662d2889 100644 --- a/pyfpdb/EverestToFpdb.py +++ b/pyfpdb/EverestToFpdb.py @@ -142,9 +142,9 @@ class Everest(HandHistoryConverter): def readHandInfo(self, hand): m = self.re_HandInfo.search(hand.handText) if m is None: - logging.info(_("Didn't match re_HandInfo")) + logging.info(_("No match in readHandInfo: '%s'") % hand.handText[0:100]) logging.info(hand.handText) - raise FpdbParseError(_("No match in readHandInfo.")) + raise FpdbParseError(_("No match in readHandInfo: '%s'") % hand.handText[0:100]) hand.handid = m.group('HID') hand.tablename = self.info['TABLENAME'] hand.maxseats = None @@ -231,9 +231,8 @@ class Everest(HandHistoryConverter): elif action.group('ATYPE') in ('FOLD', 'SIT_OUT'): hand.addFold(street, player) else: - print (_("Unimplemented readAction: %s %s") % (action.group('PSEAT'),action.group('ATYPE'))) - logging.debug(_("Unimplemented readAction: %s %s") - % (action.group('PSEAT'),action.group('ATYPE'))) + print (_("Unimplemented readAction: '%s' '%s'") % (action.group('PSEAT'),action.group('ATYPE'))) + logging.debug(_("Unimplemented readAction: '%s' '%s'") % (action.group('PSEAT'),action.group('ATYPE'))) def readShowdownActions(self, hand): for shows in self.re_ShowdownAction.finditer(hand.handText): diff --git a/pyfpdb/EverleafToFpdb.py b/pyfpdb/EverleafToFpdb.py index 400e24a0..bcd37af9 100755 --- a/pyfpdb/EverleafToFpdb.py +++ b/pyfpdb/EverleafToFpdb.py @@ -142,7 +142,7 @@ or None if we fail to get the info """ def readHandInfo(self, hand): m = self.re_HandInfo.search(hand.handText) if(m == None): - logging.info(_("Didn't match re_HandInfo")) + logging.info(_("No match in readHandInfo: '%s'") % hand.handText[0:100]) logging.info(hand.handText) return None logging.debug("HID %s, Table %s" % (m.group('HID'), m.group('TABLE'))) diff --git a/pyfpdb/Filters.py b/pyfpdb/Filters.py index e73637c9..0a085933 100644 --- a/pyfpdb/Filters.py +++ b/pyfpdb/Filters.py @@ -52,7 +52,7 @@ class Filters(threading.Thread): # 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:') + ,'playerstitle':_('Hero:'), 'sitestitle':(_('Sites')+':'), 'gamestitle':(_('Games')+':') ,'limitstitle':_('Limits:'), 'seatstitle':_('Number of Players:') ,'groupstitle':_('Grouping:'), 'posnshow':_('Show Position Stats') ,'datestitle':_('Date:') diff --git a/pyfpdb/FulltiltToFpdb.py b/pyfpdb/FulltiltToFpdb.py index 380c5077..69caa79b 100755 --- a/pyfpdb/FulltiltToFpdb.py +++ b/pyfpdb/FulltiltToFpdb.py @@ -260,7 +260,7 @@ class Fulltilt(HandHistoryConverter): if m is None: tmp = hand.handText[0:100] log.error(_("Unable to recognise handinfo from: '%s'") % tmp) - log.error(_("readHandInfo: Raising FpdbParseError")) + log.error("readHandInfo: " + _("Raising FpdbParseError")) raise FpdbParseError(_("Unable to recognise handinfo from: '%s'")) #print "DEBUG: m.groupdict: %s" % m.groupdict() diff --git a/pyfpdb/GuiAutoImport.py b/pyfpdb/GuiAutoImport.py index 2b54f988..69d33cdd 100755 --- a/pyfpdb/GuiAutoImport.py +++ b/pyfpdb/GuiAutoImport.py @@ -223,15 +223,16 @@ class GuiAutoImport (threading.Thread): def startClicked(self, widget, data): """runs when user clicks start on auto import tab""" -# Check to see if we have an open file handle to the HUD and open one if we do not. -# bufsize = 1 means unbuffered -# We need to close this file handle sometime. + # Check to see if we have an open file handle to the HUD and open one if we do not. + # bufsize = 1 means unbuffered + # We need to close this file handle sometime. -# TODO: Allow for importing from multiple dirs - REB 29AUG2008 -# As presently written this function does nothing if there is already a pipe open. -# That is not correct. It should open another dir for importing while piping the -# results to the same pipe. This means that self.path should be a a list of dirs -# to watch. + # TODO: Allow for importing from multiple dirs - REB 29AUG2008 + # As presently written this function does nothing if there is already a pipe open. + # That is not correct. It should open another dir for importing while piping the + # results to the same pipe. This means that self.path should be a a list of dirs + # to watch. + if data == "autostart" or (widget == self.startButton and self.startButton.get_active()): self.startButton.set_active(True) # - Does the lock acquisition need to be more sophisticated for multiple dirs? diff --git a/pyfpdb/GuiDatabase.py b/pyfpdb/GuiDatabase.py index b7814979..9e2734bb 100755 --- a/pyfpdb/GuiDatabase.py +++ b/pyfpdb/GuiDatabase.py @@ -478,7 +478,7 @@ class AddDB(gtk.Dialog): def run(self): response = super(AddDB,self).run() - log.debug(_("addDB.run: response is %s accept is %s") % (str(response), str(int(gtk.RESPONSE_ACCEPT)))) + log.debug(_("addDB.run: response is %s, accept is %s") % (str(response), str(int(gtk.RESPONSE_ACCEPT)))) ok,retry = False,True while response == gtk.RESPONSE_ACCEPT: diff --git a/pyfpdb/GuiGraphViewer.py b/pyfpdb/GuiGraphViewer.py index db530d9d..9ff8017f 100644 --- a/pyfpdb/GuiGraphViewer.py +++ b/pyfpdb/GuiGraphViewer.py @@ -46,10 +46,8 @@ try: from numpy import arange, cumsum from pylab import * except ImportError, inst: - 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 _("""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 class GuiGraphViewer (threading.Thread): diff --git a/pyfpdb/GuiPrefs.py b/pyfpdb/GuiPrefs.py index 3ef334cd..59b1c0e6 100755 --- a/pyfpdb/GuiPrefs.py +++ b/pyfpdb/GuiPrefs.py @@ -75,7 +75,7 @@ class GuiPrefs: 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) diff --git a/pyfpdb/GuiStove.py b/pyfpdb/GuiStove.py index 48518c40..f1261a28 100644 --- a/pyfpdb/GuiStove.py +++ b/pyfpdb/GuiStove.py @@ -131,10 +131,10 @@ class GuiStove(): flop_games_cb = self.create_combo_box(games) players_cb = self.create_combo_box(players) - label = gtk.Label(_("Gametype:")) + label = gtk.Label(_("Gametype")+":") ddhbox.add(label) ddhbox.add(flop_games_cb) - label = gtk.Label(_("Players:")) + label = gtk.Label(_("Players")+":") ddhbox.add(label) ddhbox.add(players_cb) diff --git a/pyfpdb/GuiTourneyGraphViewer.py b/pyfpdb/GuiTourneyGraphViewer.py index ff1a71e2..06ceb34b 100644 --- a/pyfpdb/GuiTourneyGraphViewer.py +++ b/pyfpdb/GuiTourneyGraphViewer.py @@ -46,10 +46,8 @@ try: from numpy import arange, cumsum from pylab import * except ImportError, inst: - 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 _("""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 class GuiTourneyGraphViewer (threading.Thread): diff --git a/pyfpdb/HUD_config.test.xml b/pyfpdb/HUD_config.test.xml index f8a99ee3..fba76fe1 100644 --- a/pyfpdb/HUD_config.test.xml +++ b/pyfpdb/HUD_config.test.xml @@ -2,7 +2,7 @@ - +