From e0b51bee07419de438c84b454cd73802c298f2e3 Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 25 Jun 2010 16:58:14 +0800 Subject: [PATCH 1/7] Really add the 0.20/0.40 limit level Limit occurs in Stars 8 game --- pyfpdb/PokerStarsToFpdb.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/pyfpdb/PokerStarsToFpdb.py b/pyfpdb/PokerStarsToFpdb.py index 89071ae7..c460e6ff 100644 --- a/pyfpdb/PokerStarsToFpdb.py +++ b/pyfpdb/PokerStarsToFpdb.py @@ -145,14 +145,12 @@ class PokerStars(HandHistoryConverter): mg = m.groupdict() # translations from captured groups to fpdb info strings Lim_Blinds = { '0.04': ('0.01', '0.02'), '0.10': ('0.02', '0.05'), '0.20': ('0.05', '0.10'), - '0.80': ('0.20', '0.40'), - '0.50': ('0.10', '0.25'), '1.00': ('0.25', '0.50'), '2.00': ('0.50', '1.00'), - '2': ('0.50', '1.00'), '4': ('1.00', '2.00'), '6': ('1.00', '3.00'), - '4.00': ('1.00', '2.00'), '6.00': ('1.00', '3.00'), '10.00': ('2.00', '5.00'), - '20.00': ('5.00', '10.00'), '30.00': ('10.00', '15.00'), '60.00': ('15.00', '30.00'), - '100.00': ('25.00', '50.00'),'200.00': ('50.00', '100.00'),'400.00': ('100.00', '200.00'), - '1000.00': ('250.00', '500.00')} - + '0.40': ('0.10', '0.20'), '0.50': ('0.10', '0.25'), '1.00': ('0.25', '0.50'), + '2.00': ('0.50', '1.00'), '2': ('0.50', '1.00'), '4' : ('1.00', '2.00'), + '4.00': ('1.00', '2.00'), '6': ('1.00', '3.00'), '6.00': ('1.00', '3.00'), + '10.00': ('2.00', '5.00'), '20.00': ('5.00', '10.00'), '30.00': ('10.00', '15.00'), + '60.00': ('15.00', '30.00'), '100.00': ('25.00', '50.00'), '200.00': ('50.00', '100.00'), + '400.00': ('100.00', '200.00'), '1000.00': ('250.00', '500.00')} limits = { 'No Limit':'nl', 'Pot Limit':'pl', 'Limit':'fl', 'LIMIT':'fl' } games = { # base, category @@ -197,7 +195,6 @@ class PokerStars(HandHistoryConverter): log.error("determineGameType: Raising FpdbParseError") raise FpdbParseError("Lim_Blinds has no lookup for '%s'" % mg['BB']) - # NB: SB, BB must be interpreted as blinds or bets depending on limit type. return info def readHandInfo(self, hand): From cde793a4a11236bef5f9f1fe44c6361d14c303a5 Mon Sep 17 00:00:00 2001 From: gimick Date: Fri, 25 Jun 2010 18:06:51 +0100 Subject: [PATCH 2/7] fix tray->quit lockup if child windows open --- pyfpdb/fpdb.pyw | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index ffc83602..df7bbb31 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -496,7 +496,7 @@ class fpdb: response = self.dia_confirm.run() if response == gtk.RESPONSE_YES: - #FIXME these progress messages do not seem to work + #FIXME these progress messages do not seem to work in *nix lbl = gtk.Label(" Rebuilding Indexes ... ") self.dia_confirm.vbox.add(lbl) lbl.show() @@ -845,6 +845,7 @@ class fpdb: def quit(self, widget, data=None): # TODO: can we get some / all of the stuff done in this function to execute on any kind of abort? + #FIXME get two "quitting normally" messages, following the addition of the self.window.destroy() call print "Quitting normally" # TODO: check if current settings differ from profile, if so offer to save or abort try: @@ -853,6 +854,8 @@ class fpdb: except _mysql_exceptions.OperationalError: # oh, damn, we're already disconnected pass self.statusIcon.set_visible(False) + + self.window.destroy() # explicitly destroy to allow child windows to close cleanly gtk.main_quit() def release_global_lock(self): @@ -987,14 +990,10 @@ This program is licensed under the AGPL3, see agpl-3.0.txt in the fpdb installat menuItem = gtk.ImageMenuItem(gtk.STOCK_ABOUT) menuItem.connect('activate', self.dia_about) self.statusMenu.append(menuItem) - -# do not allow quit - if any transient (popup) windows are open (rebuild cache, rebuild index etc) -# quit from the tray causes a very very unclean shutdown, lockup of python process and failure to release global lock. -# fpdb window must be re-opened and the windows closed to quit -# menuItem = gtk.ImageMenuItem(gtk.STOCK_QUIT) -# menuItem.connect('activate', self.quit) -# self.statusMenu.append(menuItem) + menuItem = gtk.ImageMenuItem(gtk.STOCK_QUIT) + menuItem.connect('activate', self.quit) + self.statusMenu.append(menuItem) self.statusIcon.connect('popup-menu', self.statusicon_menu, self.statusMenu) self.statusIcon.set_visible(True) @@ -1042,7 +1041,7 @@ This program is licensed under the AGPL3, see agpl-3.0.txt in the fpdb installat self.window.present() def info_box(self, str1, str2): - diapath = gtk.MessageDialog( parent=self.window, flags=0, type=gtk.MESSAGE_INFO + diapath = gtk.MessageDialog( parent=self.window, flags=gtk.DIALOG_DESTROY_WITH_PARENT, type=gtk.MESSAGE_INFO , buttons=(gtk.BUTTONS_OK), message_format=str1 ) diapath.format_secondary_text(str2) response = diapath.run() @@ -1050,7 +1049,7 @@ This program is licensed under the AGPL3, see agpl-3.0.txt in the fpdb installat return response def warning_box(self, str, diatitle="FPDB WARNING"): - diaWarning = gtk.Dialog(title=diatitle, parent=self.window, flags=0, buttons=(gtk.STOCK_OK,gtk.RESPONSE_OK)) + diaWarning = gtk.Dialog(title=diatitle, parent=self.window, flags=gtk.DIALOG_DESTROY_WITH_PARENT, buttons=(gtk.STOCK_OK,gtk.RESPONSE_OK)) label = gtk.Label(str) diaWarning.vbox.add(label) From 222b70fbb454f0b22d17f24880fef5ae3aa52d64 Mon Sep 17 00:00:00 2001 From: gimick Date: Sat, 26 Jun 2010 00:48:55 +0100 Subject: [PATCH 3/7] add mysql to build instructions, py2.6 mods to py2exe, set ver 0.20pre3 --- packaging/windows/py2exeWalkthroughPython26.txt | 2 ++ pyfpdb/fpdb.pyw | 2 +- pyfpdb/py2exe_setup.py | 15 ++++++++++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/packaging/windows/py2exeWalkthroughPython26.txt b/packaging/windows/py2exeWalkthroughPython26.txt index c7ad72fe..de46a15e 100644 --- a/packaging/windows/py2exeWalkthroughPython26.txt +++ b/packaging/windows/py2exeWalkthroughPython26.txt @@ -20,6 +20,8 @@ pygtk 2.16.0 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.16/pygtk- pycairo 1.8.6 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/1.8/pycairo-1.8.6.win32-py2.6.exe pyGobject 2.20.0 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/2.20/pygobject-2.20.0.win32-py2.6.exe py2exe 0.6.9 ... http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/py2exe-0.6.9.win32-py2.6.exe/download +MySQL-python 1.2.3c1 ... http://www.codegood.com/download/4/ (MySQL-python-1.2.3c1.win32-py2.6.exe) + Step 2 Setup GTK diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index df7bbb31..5715b884 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -111,7 +111,7 @@ import Database import Configuration import Exceptions -VERSION = "0.20-pre1" +VERSION = "0.20-pre3" class fpdb: diff --git a/pyfpdb/py2exe_setup.py b/pyfpdb/py2exe_setup.py index be6caf2a..ceb490bc 100644 --- a/pyfpdb/py2exe_setup.py +++ b/pyfpdb/py2exe_setup.py @@ -63,6 +63,10 @@ Py2exe script for fpdb. # # 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 +# Updated to this script have broken python 2.5 compatibility (gio module, new licence file locations) import os @@ -77,7 +81,9 @@ from datetime import date origIsSystemDLL = py2exe.build_exe.isSystemDLL def isSystemDLL(pathname): - if os.path.basename(pathname).lower() in ("msvcp71.dll", "dwmapi.dll"): + #VisC++ runtime msvcp71.dll removed; py2.6 needs msvcp90.dll which will not be distributed. + #dwmapi appears to be vista-specific file, not XP + if os.path.basename(pathname).lower() in ("dwmapi.dll"): return 0 return origIsSystemDLL(pathname) py2exe.build_exe.isSystemDLL = isSystemDLL @@ -150,7 +156,8 @@ setup( }, # files in 2nd value in tuple are moved to dir named in 1st value - data_files = [('', ['HUD_config.xml.example', 'Cards01.png', 'logging.conf', '../docs/readme.txt']) + #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']) ,(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') @@ -174,7 +181,7 @@ dest = dest.replace('\\', '\\\\') os.rename( 'pyfpdb', dest ) -print "Enter directory name for GTK 2.14 (e.g. c:\code\gtk_2.14.7-20090119)\n: ", # the comma means no newline +print "Enter directory name for GTK (e.g. c:\code\gtk_2.14.7-20090119)\n: ", # the comma means no newline gtk_dir = sys.stdin.readline().rstrip() @@ -223,6 +230,8 @@ pyfpdb/share/locale pyfpdb/share/man pyfpdb/share/themes/Default +Please double-check that msvcp90.dll is NOT in the distribution tree + Use 7-zip to zip up the distribution and create a self extracting archive and that's it! """ From 40745ace130f949d62f42964b7c1d0b178f8a75e Mon Sep 17 00:00:00 2001 From: gimick Date: Sat, 26 Jun 2010 13:46:33 +0100 Subject: [PATCH 4/7] improve walkthrough and include postgresql - tweak script for python 2.6 --- .../windows/py2exeWalkthroughPython26.txt | 54 +++++++++++++------ pyfpdb/py2exe_setup.py | 6 +-- 2 files changed, 40 insertions(+), 20 deletions(-) diff --git a/packaging/windows/py2exeWalkthroughPython26.txt b/packaging/windows/py2exeWalkthroughPython26.txt index de46a15e..080bd8e4 100644 --- a/packaging/windows/py2exeWalkthroughPython26.txt +++ b/packaging/windows/py2exeWalkthroughPython26.txt @@ -20,8 +20,17 @@ pygtk 2.16.0 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.16/pygtk- pycairo 1.8.6 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/1.8/pycairo-1.8.6.win32-py2.6.exe pyGobject 2.20.0 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/2.20/pygobject-2.20.0.win32-py2.6.exe py2exe 0.6.9 ... http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/py2exe-0.6.9.win32-py2.6.exe/download -MySQL-python 1.2.3c1 ... http://www.codegood.com/download/4/ (MySQL-python-1.2.3c1.win32-py2.6.exe) +psycopg2 ... http://www.stickpeople.com/projects/python/win-psycopg/psycopg2-2.2.1.win32-py2.6-pg8.4.3-release.exe +1.2/ MySQL + +mysql-python is needed +The sourceforge page is http://sourceforge.net/projects/mysql-python/files/ +Unfortunately there is no py2.6 build for windows yet. +Instructions to build the installer package can be found here +http://www.bcspcsonline.com/wiki/index.php?title=MySQL-5.1.34_Python-2.6_Module_Build_Instructions +A pre-built intaller is available here +MySQL-python 1.2.3c1 ... http://www.codegood.com/download/4/ (MySQL-python-1.2.3c1.win32-py2.6.exe) Step 2 Setup GTK @@ -63,13 +72,15 @@ 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 -Step 5 Put MSVCP90.dll temporarily into the fpdb folder -------------------------------------------------------- +#Step 5 Put MSVCP90.dll temporarily into the fpdb folder +#------------------------------------------------------- -py2exe will check for MSVCP90.dll. The version installed by python2.6.5runtime is not in the path, so we will put it in place TEMPORARILY. This will/must be removed manually once the exe has been created, as we do not have a licence to redistribute. - -Search for MSVCP90.dll (should be found in C:\WINDOWS\WinSxS\... -copy this file TEMPORARILY to the Desktop\fpdb\pyfpdb folder +###### Step 5 no longer required as py2exe is instructed not to include the visualc/c++ dll's +# +#py2exe will check for MSVCP90.dll. The version installed by python2.6.5runtime is not in the path, so we will put it in place #TEMPORARILY. This will/must be removed manually once the exe has been created, as we do not have a licence to redistribute. +# +#Search for MSVCP90.dll (should be found in C:\WINDOWS\WinSxS\... +#copy this file TEMPORARILY to the Desktop\fpdb\pyfpdb folder Step 6 Run py2exe to generate fpdb.exe -------------------------------------- @@ -86,17 +97,29 @@ c:\GTK 6.3/ If there are no errors reported, it has probably worked, we will test soon. -Step 7 Delete C++runtime ------------------------- +Build notes: -This is really really important, this file must NOT be distributed, so get rid of it now to avoid issues. +There is a warning "c:\Python26\lib\site-packages\py2exe\build_exe.py:16: DeprecationWarning: the sets module is deprecated import sets". This is probably coming from mysql-python see here https://bugs.launchpad.net/python-mysqldb/+bug/338387 -7.1/ in Desktop\fpdb\pyfpdb\ remove the file msvcp90.dll +There is a warning about dll's not included "umath.pyd - c:\Python26\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 Delete C++runtime +#------------------------ +# +###### Step 7 is no longer required (see step 5 for reason) +# +#This is really really important, this file must NOT be distributed, so get rid of it now to avoid issues. +# +#7.1/ in Desktop\fpdb\pyfpdb\ remove the file msvcp90.dll +# 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 +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\ @@ -109,11 +132,8 @@ Step 9 Initial run 9.3/ Double click run_fpdb.bat 9.4/ check the contents of pyfpdb\fpdb.exe.log, deal with any errors thrown -Step 10 drum roll....... ------------------------- - -10.1/ hopefully, fpdb will run -10.2/ Try out a few options, deal with any errors reported +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. diff --git a/pyfpdb/py2exe_setup.py b/pyfpdb/py2exe_setup.py index ceb490bc..8a87daad 100644 --- a/pyfpdb/py2exe_setup.py +++ b/pyfpdb/py2exe_setup.py @@ -66,7 +66,7 @@ Py2exe script for fpdb. # # Now updated to work with python 2.6 + related dependencies # See walkthrough in packaging directory for versions used -# Updated to this script have broken python 2.5 compatibility (gio module, new licence file locations) +# Updates to this script have broken python 2.5 compatibility (gio module, msvcr71 references now msvcp90) import os @@ -151,7 +151,7 @@ setup( ], 'excludes' : ['_tkagg', '_agg2', 'cocoaagg', 'fltkagg'], # surely we need this? '_gtkagg' 'dll_excludes': ['libglade-2.0-0.dll', 'libgdk-win32-2.0-0.dll' - ,'libgobject-2.0-0.dll'], + ,'libgobject-2.0-0.dll', 'msvcr90.dll', 'MSVCP90.dll', 'MSVCR90.dll','msvcr90.dll'], } }, @@ -230,7 +230,7 @@ pyfpdb/share/locale pyfpdb/share/man pyfpdb/share/themes/Default -Please double-check that msvcp90.dll is NOT in the distribution tree +Please double-check that msvcr90.dll is NOT in the distribution tree Use 7-zip to zip up the distribution and create a self extracting archive and that's it! """ From cd3ed9a9372750c49a89e9985b6abb68691fb5ef Mon Sep 17 00:00:00 2001 From: steve Date: Sun, 27 Jun 2010 23:21:40 +0100 Subject: [PATCH 5/7] fix graph export to png. More focus fixes --- pyfpdb/GuiAutoImport.py | 5 ++++- pyfpdb/GuiGraphViewer.py | 48 +++++++++++++++++++++++++++++----------- pyfpdb/fpdb.pyw | 4 ++-- 3 files changed, 41 insertions(+), 16 deletions(-) diff --git a/pyfpdb/GuiAutoImport.py b/pyfpdb/GuiAutoImport.py index 6dd67ba5..113f7af1 100755 --- a/pyfpdb/GuiAutoImport.py +++ b/pyfpdb/GuiAutoImport.py @@ -32,11 +32,12 @@ import Configuration import string class GuiAutoImport (threading.Thread): - def __init__(self, settings, config, sql): + def __init__(self, settings, config, sql, parent): self.importtimer = 0 self.settings = settings self.config = config self.sql = sql + self.parent = parent imp = self.config.get_import_parameters() @@ -138,6 +139,8 @@ class GuiAutoImport (threading.Thread): #dia_chooser.set_current_folder(pathname) dia_chooser.set_filename(current_path) #dia_chooser.set_select_multiple(select_multiple) #not in tv, but want this in bulk import + dia_chooser.set_destroy_with_parent(True) + dia_chooser.set_transient_for(self.parent) response = dia_chooser.run() if response == gtk.RESPONSE_OK: diff --git a/pyfpdb/GuiGraphViewer.py b/pyfpdb/GuiGraphViewer.py index add48696..94cd92d3 100644 --- a/pyfpdb/GuiGraphViewer.py +++ b/pyfpdb/GuiGraphViewer.py @@ -23,6 +23,7 @@ import os import sys import traceback from time import * +from datetime import datetime #import pokereval try: @@ -48,11 +49,12 @@ import Charset class GuiGraphViewer (threading.Thread): - def __init__(self, querylist, config, debug=True): + def __init__(self, querylist, config, parent, debug=True): """Constructor for GraphViewer""" self.sql = querylist self.conf = config self.debug = debug + self.parent = parent #print "start of GraphViewer constructor" self.db = Database.Database(self.conf, sql=self.sql) @@ -334,21 +336,41 @@ class GuiGraphViewer (threading.Thread): def exportGraph (self, widget, data): if self.fig is None: return # Might want to disable export button until something has been generated. + dia_chooser = gtk.FileChooserDialog(title="Please choose the directory you wish to export to:", - action=gtk.FILE_CHOOSER_ACTION_OPEN, - buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK)) - #TODO: Suggest path and filename to start with + action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, + buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OK,gtk.RESPONSE_OK)) + dia_chooser.set_destroy_with_parent(True) + dia_chooser.set_transient_for(self.parent) + try: + dia_chooser.set_filename(self.exportFile) # use previously chosen export path as default + except: + pass response = dia_chooser.run() - if response == gtk.RESPONSE_OK: - self.exportDir = dia_chooser.get_filename() - print "DEBUG: self.exportDir = %s" %(self.exportDir) - elif response == gtk.RESPONSE_CANCEL: + + if response == gtk.RESPONSE_CANCEL: print 'Closed, no graph exported' + dia_chooser.destroy() + return + + # generate a unique filename for export + now = datetime.now() + now_formatted = now.strftime("%Y%m%d%H%M%S") + self.exportFile = dia_chooser.get_filename() + "/fpdb" + now_formatted + ".png" dia_chooser.destroy() - #TODO: Check to see if file exists - #NOTE: Dangerous - will happily overwrite any file we have write access too - #TODO: This asks for a directory but will take a filename and overwrite it. - self.fig.savefig(self.exportDir, format="png") - + + #print "DEBUG: self.exportFile = %s" %(self.exportFile) + self.fig.savefig(self.exportFile, format="png") + #display info box to confirm graph created + diainfo = gtk.MessageDialog(parent=self.parent, + flags=gtk.DIALOG_DESTROY_WITH_PARENT, + type=gtk.MESSAGE_INFO, + buttons=gtk.BUTTONS_OK, + message_format="Graph created") + diainfo.format_secondary_text(self.exportFile) + diainfo.run() + diainfo.destroy() + + #end of def exportGraph diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index 5715b884..542769db 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -867,7 +867,7 @@ class fpdb: def tab_auto_import(self, widget, data=None): """opens the auto import tab""" - new_aimp_thread = GuiAutoImport.GuiAutoImport(self.settings, self.config, self.sql) + new_aimp_thread = GuiAutoImport.GuiAutoImport(self.settings, self.config, self.sql, self.window) self.threads.append(new_aimp_thread) aimp_tab=new_aimp_thread.get_vbox() self.add_and_display_tab(aimp_tab, "Auto Import") @@ -918,7 +918,7 @@ This program is licensed under the AGPL3, see agpl-3.0.txt in the fpdb installat def tabGraphViewer(self, widget, data=None): """opens a graph viewer tab""" - new_gv_thread = GuiGraphViewer.GuiGraphViewer(self.sql, self.config) + new_gv_thread = GuiGraphViewer.GuiGraphViewer(self.sql, self.config, self.window) self.threads.append(new_gv_thread) gv_tab = new_gv_thread.get_vbox() self.add_and_display_tab(gv_tab, "Graphs") From 034ac470ecbadea81354ea20d481dd8e7e0abdec Mon Sep 17 00:00:00 2001 From: gimick Date: Tue, 29 Jun 2010 20:58:54 +0100 Subject: [PATCH 6/7] MySql-python windows installer walkthrough added --- .../MySqlPython1.2.2WalkthroughPython26.txt | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 packaging/windows/MySqlPython1.2.2WalkthroughPython26.txt diff --git a/packaging/windows/MySqlPython1.2.2WalkthroughPython26.txt b/packaging/windows/MySqlPython1.2.2WalkthroughPython26.txt new file mode 100644 index 00000000..fa3a75d6 --- /dev/null +++ b/packaging/windows/MySqlPython1.2.2WalkthroughPython26.txt @@ -0,0 +1,136 @@ +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.2.tar.gz/download + +5.2/ extract MySQL-python-1.2.2 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.2 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.2, overwriting any existing files + + +Step 7, install the build tool +------------------------------ + +dos> cd Desktop\MySQL-python-1.2.2 +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.2 + +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 + +8.2/ dos> write _mysql.c + +Find the following lines + +... +#include +#include +... + +Insert an additional winsock2 line + +... +#include +#include +#include +... + + +Step 9, build +------------- + +dos> cd Desktop\MySQL-python-1.2.2 + +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.2/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.2.win32-py2.6.exe !!!!! +10.2/ rename to MySQL-python-1.2.2.win32-py2.6-fpdb0.20.exe From 812f9759b30ffc5f7cfe932da2d6bc84604bdef3 Mon Sep 17 00:00:00 2001 From: gimick Date: Tue, 29 Jun 2010 21:42:23 +0100 Subject: [PATCH 7/7] update py2exe walkthrough for mysql-python package changes --- packaging/windows/py2exeWalkthroughPython26.txt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packaging/windows/py2exeWalkthroughPython26.txt b/packaging/windows/py2exeWalkthroughPython26.txt index 080bd8e4..207d1cc3 100644 --- a/packaging/windows/py2exeWalkthroughPython26.txt +++ b/packaging/windows/py2exeWalkthroughPython26.txt @@ -21,16 +21,15 @@ pycairo 1.8.6 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/1.8/pyca pyGobject 2.20.0 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/2.20/pygobject-2.20.0.win32-py2.6.exe py2exe 0.6.9 ... http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/py2exe-0.6.9.win32-py2.6.exe/download psycopg2 ... http://www.stickpeople.com/projects/python/win-psycopg/psycopg2-2.2.1.win32-py2.6-pg8.4.3-release.exe +(Note: stickpeople is the offical repository, not a community build) 1.2/ MySQL -mysql-python is needed -The sourceforge page is http://sourceforge.net/projects/mysql-python/files/ -Unfortunately there is no py2.6 build for windows yet. -Instructions to build the installer package can be found here -http://www.bcspcsonline.com/wiki/index.php?title=MySQL-5.1.34_Python-2.6_Module_Build_Instructions -A pre-built intaller is available here -MySQL-python 1.2.3c1 ... http://www.codegood.com/download/4/ (MySQL-python-1.2.3c1.win32-py2.6.exe) +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 + +This is an intaller built from source by gimick. There are no official mysql-python2.6 build for windows. + +Community builds are also available from some developers. see www.codegood.com for example. Step 2 Setup GTK