From fcde707644ddc32de385e332911a0851bd3a1c70 Mon Sep 17 00:00:00 2001 From: gimick Date: Fri, 2 Jul 2010 23:13:36 +0100 Subject: [PATCH] version -pre4; graph export fix; add mysql-python123.exe walkthrough --- .../MySqlPython1.2.3WalkthroughPython26.txt | 119 ++++++++++++++++++ .../windows/py2exeWalkthroughPython26.txt | 2 +- pyfpdb/GuiGraphViewer.py | 2 +- pyfpdb/fpdb.pyw | 2 +- pyfpdb/py2exe_setup.py | 4 +- 5 files changed, 124 insertions(+), 5 deletions(-) create mode 100644 packaging/windows/MySqlPython1.2.3WalkthroughPython26.txt diff --git a/packaging/windows/MySqlPython1.2.3WalkthroughPython26.txt b/packaging/windows/MySqlPython1.2.3WalkthroughPython26.txt new file mode 100644 index 00000000..829aa12e --- /dev/null +++ b/packaging/windows/MySqlPython1.2.3WalkthroughPython26.txt @@ -0,0 +1,119 @@ +Create MySqlPython windows installer for Python26 +created by Gimick on 29th June 2010 + +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. + +This walkthrough is derived from excellent installation instructions here ... http://www.bcspcsonline.com/wiki/index.php?title=MySQL-5.1.34_Python-2.6_Module_Build_Instructions + + +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.6.5 ... http://www.python.org/ftp/python/2.6.5/python-2.6.5.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.2/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.6/s/setuptools/setuptools-0.6c11-py2.6.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:\Python26\python.exe ez_setup.py setuptools-0.6c11-py2.6.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:\python26\python.exe setup.py build + +* Note: You will probably get a bunch of warnings and maybe a manifest error, 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:\python26\python.exe setup.py bdist_wininst + + +Step 10, done +------------- + +10.1/ the \dist directory will contain MySQL-python-1.2.3.win32-py2.6.exe !!!!! +10.2/ rename to MySQL-python-1.2.3.win32-py2.6-fpdb0.20.exe diff --git a/packaging/windows/py2exeWalkthroughPython26.txt b/packaging/windows/py2exeWalkthroughPython26.txt index 207d1cc3..8e8870e2 100644 --- a/packaging/windows/py2exeWalkthroughPython26.txt +++ b/packaging/windows/py2exeWalkthroughPython26.txt @@ -25,7 +25,7 @@ psycopg2 ... http://www.stickpeople.com/projects/python/win-psycopg/psycopg2-2.2 1.2/ MySQL -MySQL-python-1.2.2.win32-py2.6-fpdb0.20.exe ... http://www.mediafire.com/file/zjyljynz2mz/MySQL-python-1.2.2.win32-py2.6-fpdb0.20.exe +MySQL-python-1.2.3.win32-py2.6-fpdb0.20.exe ... http://www.mediafire.com/file/iodnnnznmj1/MySQL-python-1.2.3.win32-py2.6-fpdb0.20.exe This is an intaller built from source by gimick. There are no official mysql-python2.6 build for windows. diff --git a/pyfpdb/GuiGraphViewer.py b/pyfpdb/GuiGraphViewer.py index 94cd92d3..a9aa124a 100644 --- a/pyfpdb/GuiGraphViewer.py +++ b/pyfpdb/GuiGraphViewer.py @@ -349,7 +349,7 @@ class GuiGraphViewer (threading.Thread): response = dia_chooser.run() - if response == gtk.RESPONSE_CANCEL: + if response <> gtk.RESPONSE_OK: print 'Closed, no graph exported' dia_chooser.destroy() return diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index 542769db..1c16162b 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -111,7 +111,7 @@ import Database import Configuration import Exceptions -VERSION = "0.20-pre3" +VERSION = "0.20-pre4" class fpdb: diff --git a/pyfpdb/py2exe_setup.py b/pyfpdb/py2exe_setup.py index 8a87daad..a6ac9675 100644 --- a/pyfpdb/py2exe_setup.py +++ b/pyfpdb/py2exe_setup.py @@ -132,7 +132,7 @@ test_and_remove(dist_dir) setup( name = 'fpdb', description = 'Free Poker DataBase', - version = '0.12', + version = '0.20', windows = [ {'script': 'fpdb.pyw', "icon_resources": [(1, "../gfx/fpdb_large_icon.ico")]}, {'script': 'HUD_main.pyw', }, @@ -157,7 +157,7 @@ setup( # 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', '../THANKS.txt']) + data_files = [('', ['HUD_config.xml.example', 'Cards01.png', 'logging.conf', '../agpl-3.0.txt', '../fdl-1.2.txt', '../THANKS.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')