You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(45) |
May
(185) |
Jun
|
Jul
(36) |
Aug
(205) |
Sep
(98) |
Oct
(107) |
Nov
(6) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(1) |
Feb
(2) |
Mar
(19) |
Apr
(26) |
May
(18) |
Jun
|
Jul
(12) |
Aug
(16) |
Sep
(22) |
Oct
(7) |
Nov
(11) |
Dec
(74) |
2006 |
Jan
(14) |
Feb
(1) |
Mar
(3) |
Apr
(3) |
May
(14) |
Jun
(5) |
Jul
(20) |
Aug
(10) |
Sep
(1) |
Oct
|
Nov
(4) |
Dec
(1) |
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(14) |
Aug
|
Sep
|
Oct
(6) |
Nov
(1) |
Dec
|
From: Phil E. <l2...@us...> - 2006-11-03 14:58:40
|
Update of /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/pixmaps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6740 Removed Files: standaloneBuilder.ico Log Message: Updates for standaloneBuilder version 0.3: 1. Major re-design of the user interface 2. Removed the limitation on directories where projects can be created 3. Changed the help --> about dialog to use a tabbed notebook --- standaloneBuilder.ico DELETED --- |
From: Phil E. <l2...@us...> - 2006-11-03 14:57:31
|
Update of /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/pixmaps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6374 Added Files: apollon.ico apollon.png changelog.png inno.png props.png readme.png rebuild.png release.png run.png spec.png Log Message: Updates for standaloneBuilder version 0.3: 1. Major re-design of the user interface 2. Removed the limitation on directories where projects can be created 3. Changed the help --> about dialog to use a tabbed notebook --- NEW FILE: rebuild.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: changelog.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: run.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: inno.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: readme.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: apollon.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: spec.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: apollon.ico --- (This appears to be a binary file; contents omitted.) --- NEW FILE: release.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: props.png --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5994 Modified Files: changelog.txt customDialogs.py helpAbout.rsrc.py standaloneBuilder.gtk.rsrc.py standaloneBuilder.py standaloneBuilder.rsrc.py Log Message: Updates for standaloneBuilder version 0.3: 1. Major re-design of the user interface 2. Removed the limitation on directories where projects can be created 3. Changed the help --> about dialog to use a tabbed notebook Index: standaloneBuilder.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/standaloneBuilder.rsrc.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** standaloneBuilder.rsrc.py 12 May 2006 16:26:20 -0000 1.7 --- standaloneBuilder.rsrc.py 3 Nov 2006 14:56:25 -0000 1.8 *************** *** 4,9 **** {'type':'Background', 'name':'standaloneBuilder', ! 'title':'PythonCard standaloneBuilder', ! 'size':(800, 594), 'statusBar':1, --- 4,9 ---- {'type':'Background', 'name':'standaloneBuilder', ! 'title':u'PythonCard standaloneBuilder', ! 'size':(800, 590), 'statusBar':1, *************** *** 171,188 **** }, 'strings': { ! u'testString':u'This is a test string', }, 'components': [ {'type':'ImageButton', 'name':'newBtn', 'position':(5, 5), 'size':(32, 32), - 'backgroundColor':(255, 255, 255), 'border':'3d', 'command':'newBtn', 'file':'pixmaps/new.png', ! 'toolTip':'Create a new project', 'userdata':'frozen', }, --- 171,217 ---- }, 'strings': { ! u'versionString':u'0.3.0', }, 'components': [ + {'type':'StaticText', + 'name':'StaticText5', + 'position':(15, 155), + 'text':u'Main script file', + }, + + {'type':'StaticText', + 'name':'StaticText4', + 'position':(15, 95), + 'text':u'Description', + }, + + {'type':'StaticText', + 'name':'StaticText9', + 'position':(15, 185), + 'text':u'Icon (Win)', + }, + + {'type':'StaticText', + 'name':'StaticText7', + 'position':(15, 125), + 'text':u'Base directory', + }, + + {'type':'StaticText', + 'name':'StaticText6', + 'position':(15, 65), + 'text':u'Project name', + }, + {'type':'ImageButton', 'name':'newBtn', 'position':(5, 5), 'size':(32, 32), 'border':'3d', 'command':'newBtn', 'file':'pixmaps/new.png', ! 'toolTip':u'Create a new project', 'userdata':'frozen', }, *************** *** 192,212 **** 'position':(40, 5), 'size':(32, 32), - 'backgroundColor':(255, 255, 255), 'border':'3d', 'command':'openBtn', 'file':'pixmaps/open.png', ! 'toolTip':'Open an existing project', 'userdata':'frozen', }, {'type':'ImageButton', ! 'name':'saveBtn', 'position':(75, 5), 'size':(32, 32), ! 'backgroundColor':(255, 255, 255), 'border':'3d', 'command':'saveBtn', 'file':'pixmaps/save.png', ! 'toolTip':'Save the current project', 'userdata':'frozen', }, --- 221,321 ---- 'position':(40, 5), 'size':(32, 32), 'border':'3d', 'command':'openBtn', 'file':'pixmaps/open.png', ! 'toolTip':u'Open an existing project', 'userdata':'frozen', }, {'type':'ImageButton', ! 'name':'propertiesBtn', 'position':(75, 5), 'size':(32, 32), ! 'border':'3d', ! 'command':'editProps', ! 'file':'pixmaps/props.png', ! 'toolTip':u'Edit project properties', ! }, ! ! {'type':'ImageButton', ! 'name':'saveBtn', ! 'position':(111, 5), ! 'size':(32, 32), 'border':'3d', 'command':'saveBtn', 'file':'pixmaps/save.png', ! 'toolTip':u'Save the current project', ! 'userdata':'frozen', ! }, ! ! {'type':'ImageButton', ! 'name':'changelogBtn', ! 'position':(155, 5), ! 'size':(32, 32), ! 'border':'3d', ! 'command':'editChgLog', ! 'file':'pixmaps/changelog.png', ! 'toolTip':u'Edit the changelog file', ! }, ! ! {'type':'ImageButton', ! 'name':'readmeBtn2', ! 'position':(190, 5), ! 'size':(32, 32), ! 'border':'3d', ! 'command':'editReadme', ! 'file':'pixmaps/readme.png', ! 'toolTip':u'Edit the README file', ! }, ! ! {'type':'ImageButton', ! 'name':'specBtn', ! 'position':(225, 5), ! 'size':(32, 32), ! 'border':'3d', ! 'command':'editSpecFile', ! 'file':'pixmaps/spec.png', ! 'toolTip':u'View the applications spec file', ! }, ! ! {'type':'ImageButton', ! 'name':'innoBtn2', ! 'position':(260, 5), ! 'size':(32, 32), ! 'border':'3d', ! 'command':'editInnoFile', ! 'file':'pixmaps/inno.png', ! 'toolTip':u'View the Inno setup script for your application', ! }, ! ! {'type':'ImageButton', ! 'name':'runBtn', ! 'position':(305, 5), ! 'size':(32, 32), ! 'border':'3d', ! 'command':'runMainScript', ! 'file':'pixmaps/run.png', ! 'toolTip':u'Run main script', ! }, ! ! {'type':'ImageButton', ! 'name':'rebuildBtn', ! 'position':(350, 5), ! 'size':(32, 32), ! 'border':'3d', ! 'command':'rebuildCmd', ! 'file':'pixmaps/rebuild.png', ! 'toolTip':u'Rebuild project', ! 'userdata':'frozen', ! }, ! ! {'type':'ImageButton', ! 'name':'releaseBtn', ! 'position':(385, 5), ! 'size':(32, 32), ! 'border':'3d', ! 'command':u'releaseCmd', ! 'file':'pixmaps/release.png', ! 'toolTip':u'Make a release of the finished application', 'userdata':'frozen', }, *************** *** 216,224 **** 'position':(705, 5), 'size':(32, 32), - 'backgroundColor':(255, 255, 255), 'border':'3d', 'command':'editPrefs', 'file':'pixmaps/prefs.png', ! 'toolTip':'standaloneBuilder preferences', 'userdata':'frozen', }, --- 325,332 ---- 'position':(705, 5), 'size':(32, 32), 'border':'3d', 'command':'editPrefs', 'file':'pixmaps/prefs.png', ! 'toolTip':u'standaloneBuilder preferences', 'userdata':'frozen', }, *************** *** 228,236 **** 'position':(750, 5), 'size':(32, 32), - 'backgroundColor':(255, 255, 255), 'border':'3d', 'command':'quitBtn', 'file':'pixmaps/exit.png', ! 'toolTip':'Quit the program', 'userdata':'frozen', }, --- 336,343 ---- 'position':(750, 5), 'size':(32, 32), 'border':'3d', 'command':'quitBtn', 'file':'pixmaps/exit.png', ! 'toolTip':u'Quit the program', 'userdata':'frozen', }, *************** *** 239,301 **** 'name':'projectName', 'position':(95, 60), ! 'size':(250, -1), }, {'type':'TextField', ! 'name':'projectIcon', ! 'position':(500, 60), ! 'size':(250, -1), ! }, ! ! {'type':'Button', ! 'name':'iconBtn', ! 'position':(755, 60), ! 'size':(22, 22), ! 'label':'...', }, {'type':'TextField', 'name':'baseDir', ! 'position':(95, 90), ! 'size':(250, -1), }, {'type':'Button', 'name':'baseDirBtn', ! 'position':(350, 90), 'size':(22, 22), ! 'label':'...', }, {'type':'TextField', ! 'name':'projectDesc', ! 'position':(500, 90), ! 'size':(250, -1), }, ! {'type':'TextField', ! 'name':'mainScript', ! 'position':(95, 120), ! 'size':(250, -1), }, {'type':'Button', 'name':'mainScriptBtn', ! 'position':(350, 120), 'size':(22, 22), ! 'label':'...', }, {'type':'Button', ! 'name':'mainScriptEditBtn', ! 'position':(375, 120), ! 'size':(50, 22), ! 'command':'EditMainScript', ! 'label':'Edit...', }, {'type':'List', 'name':'scriptList', ! 'position':(15, 185), 'size':(360, 95), 'items':[], --- 346,408 ---- 'name':'projectName', 'position':(95, 60), ! 'size':(275, -1), }, {'type':'TextField', ! 'name':'projectDesc', ! 'position':(95, 90), ! 'size':(655, -1), }, {'type':'TextField', 'name':'baseDir', ! 'position':(95, 120), ! 'size':(655, -1), }, {'type':'Button', 'name':'baseDirBtn', ! 'position':(755, 120), 'size':(22, 22), ! 'label':u'...', }, {'type':'TextField', ! 'name':'mainScript', ! 'position':(95, 150), ! 'size':(600, -1), }, ! {'type':'Button', ! 'name':'mainScriptEditBtn', ! 'position':(700, 150), ! 'size':(50, 22), ! 'command':'EditMainScript', ! 'label':u'Edit...', }, {'type':'Button', 'name':'mainScriptBtn', ! 'position':(755, 150), 'size':(22, 22), ! 'label':u'...', ! }, ! ! {'type':'TextField', ! 'name':'projectIcon', ! 'position':(95, 180), ! 'size':(655, -1), }, {'type':'Button', ! 'name':'iconBtn', ! 'position':(755, 180), ! 'size':(22, 22), ! 'label':u'...', }, {'type':'List', 'name':'scriptList', ! 'position':(15, 235), 'size':(360, 95), 'items':[], *************** *** 304,337 **** {'type':'Button', 'name':'scriptAddBtn', ! 'position':(15, 285), 'size':(-1, 22), 'command':'addScript', ! 'label':'Add...', }, {'type':'Button', 'name':'scriptDelBtn', ! 'position':(95, 285), 'size':(-1, 22), ! 'label':'Remove', }, {'type':'Button', 'name':'scriptEditBtn', ! 'position':(175, 285), 'size':(-1, 22), ! 'label':'Edit...', }, {'type':'Button', 'name':'scriptDelAllBtn', ! 'position':(300, 285), 'size':(-1, 22), ! 'label':'Clear all', }, {'type':'List', 'name':'resList', ! 'position':(415, 185), 'size':(360, 95), 'items':[], --- 411,444 ---- {'type':'Button', 'name':'scriptAddBtn', ! 'position':(15, 335), 'size':(-1, 22), 'command':'addScript', ! 'label':u'Add...', }, {'type':'Button', 'name':'scriptDelBtn', ! 'position':(95, 335), 'size':(-1, 22), ! 'label':u'Remove', }, {'type':'Button', 'name':'scriptEditBtn', ! 'position':(175, 335), 'size':(-1, 22), ! 'label':u'Edit...', }, {'type':'Button', 'name':'scriptDelAllBtn', ! 'position':(300, 335), 'size':(-1, 22), ! 'label':u'Clear all', }, {'type':'List', 'name':'resList', ! 'position':(415, 235), 'size':(360, 95), 'items':[], *************** *** 340,373 **** {'type':'Button', 'name':'resAddBtn', ! 'position':(415, 285), 'size':(-1, 22), 'command':'addResource', ! 'label':'Add..', }, {'type':'Button', 'name':'resDelBtn', ! 'position':(495, 285), 'size':(-1, 22), ! 'label':'Remove', }, {'type':'Button', 'name':'resEditBtn', ! 'position':(575, 285), 'size':(-1, 22), ! 'label':'Edit...', }, {'type':'Button', 'name':'resDelAllBtn', ! 'position':(700, 285), 'size':(-1, 22), ! 'label':'Clear all', }, {'type':'List', 'name':'pixmapList', ! 'position':(15, 340), 'size':(360, 95), 'items':[], --- 447,480 ---- {'type':'Button', 'name':'resAddBtn', ! 'position':(415, 335), 'size':(-1, 22), 'command':'addResource', ! 'label':u'Add..', }, {'type':'Button', 'name':'resDelBtn', ! 'position':(495, 335), 'size':(-1, 22), ! 'label':u'Remove', }, {'type':'Button', 'name':'resEditBtn', ! 'position':(575, 335), 'size':(-1, 22), ! 'label':u'Edit...', }, {'type':'Button', 'name':'resDelAllBtn', ! 'position':(701, 336), 'size':(-1, 22), ! 'label':u'Clear all', }, {'type':'List', 'name':'pixmapList', ! 'position':(15, 390), 'size':(360, 95), 'items':[], *************** *** 376,409 **** {'type':'Button', 'name':'pixmapAddBtn', ! 'position':(14, 440), 'size':(-1, 22), 'command':'addPixmap', ! 'label':'Add...', }, {'type':'Button', 'name':'pixmapDelBtn', ! 'position':(95, 440), 'size':(-1, 22), ! 'label':'Remove', }, {'type':'Button', 'name':'pixmapEditBtn', ! 'position':(175, 440), 'size':(-1, 22), ! 'label':'Edit...', }, {'type':'Button', 'name':'pixmapDelAllBtn', ! 'position':(300, 440), 'size':(-1, 22), ! 'label':'Clear all', }, {'type':'List', 'name':'otherList', ! 'position':(415, 340), 'size':(360, 95), 'items':[], --- 483,516 ---- {'type':'Button', 'name':'pixmapAddBtn', ! 'position':(15, 490), 'size':(-1, 22), 'command':'addPixmap', ! 'label':u'Add...', }, {'type':'Button', 'name':'pixmapDelBtn', ! 'position':(95, 490), 'size':(-1, 22), ! 'label':u'Remove', }, {'type':'Button', 'name':'pixmapEditBtn', ! 'position':(175, 490), 'size':(-1, 22), ! 'label':u'Edit...', }, {'type':'Button', 'name':'pixmapDelAllBtn', ! 'position':(300, 490), 'size':(-1, 22), ! 'label':u'Clear all', }, {'type':'List', 'name':'otherList', ! 'position':(415, 390), 'size':(360, 95), 'items':[], *************** *** 412,591 **** {'type':'Button', 'name':'docAddBtn', ! 'position':(414, 440), 'size':(-1, 22), 'command':'addOther', ! 'label':'Add...', }, {'type':'Button', 'name':'docDelBtn', ! 'position':(495, 440), 'size':(-1, 22), ! 'label':'Remove', }, {'type':'Button', 'name':'docEditBtn', ! 'position':(575, 440), 'size':(-1, 22), ! 'label':'Edit...', }, {'type':'Button', 'name':'docDelAllBtn', ! 'position':(700, 440), ! 'size':(-1, 22), ! 'label':'Clear all', ! }, ! ! {'type':'Button', ! 'name':'propertiesBtn', ! 'position':(15, 475), ! 'size':(74, 22), ! 'command':'editProps', ! 'label':'Props...', ! 'toolTip':'Change your projects properties', ! }, ! ! {'type':'Button', ! 'name':'changelogBtn', ! 'position':(95, 475), ! 'size':(76, 22), ! 'command':'editChgLog', ! 'label':'Chglog...', ! 'toolTip':'Edit the changelog file', ! }, ! ! {'type':'Button', ! 'name':'readmeBtn', ! 'position':(95, 500), ! 'size':(-1, 22), ! 'command':'editReadme', ! 'label':'README...', ! 'toolTip':'Edit the README file', ! }, ! ! {'type':'Button', ! 'name':'specBtn', ! 'position':(175, 475), ! 'size':(-1, 22), ! 'command':'editSpecFile', ! 'label':'Spec file...', ! 'toolTip':'Edit the applications spec file', ! }, ! ! {'type':'Button', ! 'name':'innoBtn', ! 'position':(175, 500), ! 'size':(76, 22), ! 'command':'editInnoFile', ! 'label':'Inno script...', ! 'toolTip':'Edit the Inno setup script for your application', ! }, ! ! {'type':'Button', ! 'name':'runBtn', ! 'position':(300, 475), ! 'size':(-1, 22), ! 'command':'runMainScript', ! 'label':'Run...', ! 'toolTip':'Run the application', ! }, ! ! {'type':'Button', ! 'name':'rebuildBtn', ! 'position':(700, 475), ! 'size':(-1, 22), ! 'command':'rebuildCmd', ! 'label':'Rebuild', ! 'toolTip':'Rebuild the standalone version of your application', ! 'userdata':'frozen', ! }, ! ! {'type':'Button', ! 'name':'releaseBtn', ! 'position':(700, 500), 'size':(-1, 22), ! 'command':'releaseCmd', ! 'label':'Release', ! 'toolTip':'Make a release of your finished application', ! 'userdata':'frozen', }, ! {'type':'StaticText', ! 'name':'versionString', ! 'position':(500, 125), ! 'text':'n/a', }, {'type':'StaticBox', 'name':'StaticBox2', ! 'position':(5, 165), 'size':(380, 150), ! 'label':'Script files:', }, {'type':'StaticBox', 'name':'StaticBox3', ! 'position':(405, 165), 'size':(380, 150), ! 'label':'Resource files:', }, {'type':'StaticBox', 'name':'StaticBox4', ! 'position':(5, 320), 'size':(380, 150), ! 'label':'Pixmap files:', }, {'type':'StaticBox', 'name':'StaticBox5', ! 'position':(405, 320), 'size':(380, 150), ! 'label':'Other files:', ! }, ! ! {'type':'StaticBox', ! 'name':'StaticBox1', ! 'position':(5, 40), ! 'size':(780, 125), ! 'label':'Project:', ! }, ! ! {'type':'StaticText', ! 'name':'StaticText5', ! 'position':(15, 125), ! 'text':'Main script file', ! }, ! ! {'type':'StaticText', ! 'name':'StaticText4', ! 'position':(395, 95), ! 'text':'Project description', ! }, ! ! {'type':'StaticText', ! 'name':'StaticText9', ! 'position':(435, 65), ! 'text':'Icon (Win)', ! }, ! ! {'type':'StaticText', ! 'name':'StaticText8', ! 'position':(450, 125), ! 'text':'Version', ! }, ! ! {'type':'StaticText', ! 'name':'StaticText7', ! 'position':(15, 95), ! 'text':'Base directory', ! }, ! ! {'type':'StaticText', ! 'name':'StaticText6', ! 'position':(15, 65), ! 'text':'Name', }, --- 519,582 ---- {'type':'Button', 'name':'docAddBtn', ! 'position':(415, 490), 'size':(-1, 22), 'command':'addOther', ! 'label':u'Add...', }, {'type':'Button', 'name':'docDelBtn', ! 'position':(495, 490), 'size':(-1, 22), ! 'label':u'Remove', }, {'type':'Button', 'name':'docEditBtn', ! 'position':(575, 490), 'size':(-1, 22), ! 'label':u'Edit...', }, {'type':'Button', 'name':'docDelAllBtn', ! 'position':(700, 490), 'size':(-1, 22), ! 'label':u'Clear all', }, ! {'type':'StaticBox', ! 'name':'StaticBox1', ! 'position':(5, 40), ! 'size':(780, 170), ! 'label':u'Project:', }, {'type':'StaticBox', 'name':'StaticBox2', ! 'position':(5, 215), 'size':(380, 150), ! 'label':u'Script files:', }, {'type':'StaticBox', 'name':'StaticBox3', ! 'position':(405, 215), 'size':(380, 150), ! 'label':u'Resource files:', }, {'type':'StaticBox', 'name':'StaticBox4', ! 'position':(5, 370), 'size':(380, 150), ! 'label':u'Pixmap files:', }, {'type':'StaticBox', 'name':'StaticBox5', ! 'position':(405, 370), 'size':(380, 150), ! 'label':u'Other files:', }, Index: helpAbout.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/helpAbout.rsrc.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** helpAbout.rsrc.py 15 Apr 2005 15:18:54 -0000 1.2 --- helpAbout.rsrc.py 3 Nov 2006 14:56:25 -0000 1.3 *************** *** 4,35 **** 'position':(129, 133), 'size':(680, 370), - 'components': [ ! {'type':'Button', ! 'name':'AboutBtn', ! 'position':(10, 5), ! 'size':(-1, 32), ! 'label':'About', }, ! {'type':'Button', ! 'name':'AuthorBtn', ! 'position':(90, 5), ! 'size':(-1, 32), ! 'label':'Author', }, ! {'type':'Button', ! 'name':'LicenseBtn', ! 'position':(170, 5), ! 'size':(-1, 32), ! 'label':'License', }, ! {'type':'HtmlWindow', ! 'name':'HtmlWindow', ! 'position':(5, 40), ! 'size':(668, 255), ! 'backgroundColor':(255, 255, 255), }, --- 4,30 ---- 'position':(129, 133), 'size':(680, 370), ! 'strings': { }, ! 'components': [ ! ! {'type':'Image', ! 'name':'Image1', ! 'position':(10, 10), ! 'file':u'pixmaps/apollon.png', }, ! {'type':'StaticText', ! 'name':'versionString', ! 'position':(70, 35), ! 'font':{'faceName': u'Trebuchet MS', 'family': 'sansSerif', 'size': 14}, ! 'text':u'standaloneBuilder version', }, ! {'type':'Notebook', ! 'name':'notebook', ! 'position':(5, 65), ! 'size':(660, 250), }, *************** *** 37,43 **** 'id':5100, 'name':'btnOK', ! 'position':(590, 305), ! 'size':(-1, 32), ! 'label':'Close', }, --- 32,37 ---- 'id':5100, 'name':'btnOK', ! 'position':(590, 40), ! 'label':u'Close', }, Index: changelog.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/changelog.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** changelog.txt 12 May 2006 16:26:20 -0000 1.10 --- changelog.txt 3 Nov 2006 14:56:25 -0000 1.11 *************** *** 1,2 **** --- 1,31 ---- + standaloneBuilder Version 0.3.0 release date TBA + ------------------------------------------------- + - Inno setup and spec file buttons on the main window now simply + display the files, rather than trying to launch a full blown + editor just to view them + - Toolbar spec file button is disabled when py2exe is selected as + the build tool + - Projects can now be created outside of the main directory + specified in preferences + - changed the 'about' dialog to use a tabbed notebook to display the + pages instead of an HTMLWindow component + - Added code to enable/disable the save button depending upon + whether the project needs to be saved or not + - added the ability to have different project paths on Windows and Linux + to allow projects to be stored on a shared network resource for + cross-platform testing + - edit main script button was crashing the program if the main script text + field was blank + - Fixed problem with toolbar icon transparency under Windows + - Added several new pixmap files to the project file for the new + toolbar buttons + - Moved a number of UI buttons up to the main toolbar for + consistency + - outputwindow was enabling the clipboard button after a successful + rebuild + - Path selection and help buttons were not working for the plain + text editor fields in prefs + + standaloneBuilder Version 0.2.0 release date May 10 2006 -------------------------------------------------------- Index: customDialogs.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/customDialogs.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** customDialogs.py 12 May 2006 16:26:20 -0000 1.6 --- customDialogs.py 3 Nov 2006 14:56:25 -0000 1.7 *************** *** 29,32 **** --- 29,33 ---- from md5 import md5 import copy + from types import * # PythonCard & wxPython imports *************** *** 35,38 **** --- 36,40 ---- import wx from wx.lib import dialogs + import wx.html *************** *** 135,159 **** CustomDialog.__init__(self, aBg, aDialogRsrc) self.parent = aBg ! #self.components.versionText.text = 'Version %s' % self.parent.pimpversion ! ! # links is a 3-element list giving the HTML files to use for the About, Author ! # and License buttons ! if links is None: links = ['doc/about.html', 'doc/author.html', 'doc/license.html'] ! self.links = links ! self.components.HtmlWindow.text = self.links[0] def on_btnOK_mouseClick(self, event): event.Skip() - def on_AboutBtn_mouseClick(self, event): - self.components.HtmlWindow.text = self.links[0] - - def on_AuthorBtn_mouseClick(self, event): - self.components.HtmlWindow.text = self.links[1] - - def on_LicenseBtn_mouseClick(self, event): - self.components.HtmlWindow.text = self.links[2] - class newProjectWizard(CustomDialog): """Displays a wizard for creating a new project""" --- 137,173 ---- CustomDialog.__init__(self, aBg, aDialogRsrc) self.parent = aBg ! self.components.notebook.SetSize((660,270)) ! ! bgval = self.GetBackgroundColour() ! versionString = self.parent.str.versionString ! self.components.versionString.text = 'standaloneBuilder version %s' % versionString ! ! aboutPanel = wx.Panel(self.components.notebook, -1) ! aboutPanelHtmlWindow = wx.html.HtmlWindow(aboutPanel, -1) ! aboutPanelHtmlWindow.SetSize((660,270)) ! aboutPanelHtmlWindow.SetPosition((1,1)) ! aboutPanelHtmlWindow.LoadPage('doc/about.html') ! aboutPanelHtmlWindow.SetBackgroundColour(bgval) ! self.components.notebook.AddPage(aboutPanel, 'About', True) ! authorPanel = wx.Panel(self.components.notebook, -1) ! authorPanelHtmlWindow = wx.html.HtmlWindow(authorPanel, -1) ! authorPanelHtmlWindow.SetSize((660,270)) ! authorPanelHtmlWindow.SetPosition((1,1)) ! authorPanelHtmlWindow.LoadPage('doc/author.html') ! authorPanelHtmlWindow.SetBackgroundColour(bgval) ! self.components.notebook.AddPage(authorPanel, 'Author', False) + licensePanel = wx.Panel(self.components.notebook, -1) + licensePanelHtmlWindow = wx.html.HtmlWindow(licensePanel, -1) + licensePanelHtmlWindow.SetSize((660,270)) + licensePanelHtmlWindow.SetPosition((1,1)) + licensePanelHtmlWindow.LoadPage('doc/license.html') + licensePanelHtmlWindow.SetBackgroundColour(bgval) + self.components.notebook.AddPage(licensePanel, 'License', False) + def on_btnOK_mouseClick(self, event): event.Skip() class newProjectWizard(CustomDialog): """Displays a wizard for creating a new project""" *************** *** 292,309 **** # need an error here if the directory selected is not a subdirectory # of basepath... ! plist = [] ! plist.append(basepath) ! plist.append(str(result.path)) ! if os.path.commonprefix(plist) != basepath: ! title = 'Invalid project base directory' ! txt = 'This version of standaloneBuilder does not allow creation ' ! txt += 'of projects which reside outside of the projects directory ' ! txt += 'specified in your preferences. This issue will be addressed ' ! txt += 'in the next version. Yes, it\'s lame - sorry! :-(' ! bull = dialog.alertDialog(self, wrap_string(txt, 60), title) ! self.components.baseDir.SetFocus() ! else: ! self.components.baseDir.text = result.path ! self.components.nextBtn.enabled = True def getResult(self): --- 306,323 ---- # need an error here if the directory selected is not a subdirectory # of basepath... ! #plist = [] ! #plist.append(basepath) ! #plist.append(str(result.path)) ! #if os.path.commonprefix(plist) != basepath: ! # title = 'Invalid project base directory' ! # txt = 'This version of standaloneBuilder does not allow creation ' ! # txt += 'of projects which reside outside of the projects directory ' ! # txt += 'specified in your preferences. This issue will be addressed ' ! # txt += 'in the next version. Yes, it\'s lame - sorry! :-(' ! # bull = dialog.alertDialog(self, wrap_string(txt, 60), title) ! # self.components.baseDir.SetFocus() ! #else: ! self.components.baseDir.text = result.path ! self.components.nextBtn.enabled = True def getResult(self): *************** *** 435,438 **** --- 449,460 ---- self.showHelp(self.components.srcEditPath.userdata, self.components.StaticText4.text) + def on_txtEditPathBtn_mouseClick(self, event): + result = dialog.fileDialog(self, self.components.StaticText9.text, self.components.txtEditPath.text) + if result.accepted: + self.components.txtEditPath.text = result.paths[0] + + def on_txtEditPathHelpBtn_mouseClick(self, event): + self.showHelp(self.components.txtEditPath.userdata, self.components.StaticText9.text) + def on_pixmapEditPathBtn_mouseClick(self, event): result = dialog.fileDialog(self, self.components.StaticText5.text, self.components.pixmapEditPath.text) Index: standaloneBuilder.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/standaloneBuilder.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** standaloneBuilder.py 12 May 2006 16:26:20 -0000 1.14 --- standaloneBuilder.py 3 Nov 2006 14:56:25 -0000 1.15 *************** *** 46,49 **** --- 46,51 ---- import outputWindow + from PythonCard.components import button, checkbox, choice, image, imagebutton, list, notebook, spinner, staticbox, statictext, textarea, textfield + # temporary hack until we get it working properly under MacOS if wx.Platform == '__WXMAC__': *************** *** 68,73 **** title = 'Required component missing' frame = wxFrame(None, -1, title) ! message = "standaloneBuilder requires that you have a version of the Python win32 extensions " + \ ! "installed - this appears to be missing from your system.\n\nClick OK to exit." dialog = wxMessageDialog(frame, wrap_string(message, 60), title, wxICON_EXCLAMATION | wxOK) dialog.ShowModal() --- 70,75 ---- title = 'Required component missing' frame = wxFrame(None, -1, title) ! message = "standaloneBuilder requires that you have a version of the Python win32 extensions" ! message += " installed - this appears to be missing from your system.\n\nClick OK to exit." dialog = wxMessageDialog(frame, wrap_string(message, 60), title, wxICON_EXCLAMATION | wxOK) dialog.ShowModal() *************** *** 78,88 **** # imports required by mcmillan installer - #from PythonCard.components import statictext, imagebutton, textfield, \ - # textarea, list, staticbox, checkbox, choice from PythonCard.components import button, checkbox, choice, htmlwindow, image, imagebutton, list, spinner, staticbox, statictext, textarea, textfield - class standaloneBuilder(model.Background): - ############################################################################## # generic pythoncard event handlers --- 80,86 ---- *************** *** 171,175 **** def on_menuToolsLogAdd_command(self, event): ! vstring = string.split(self.components.versionString.text, '.') template = {} template['name'] = self.components.projectName.text --- 169,175 ---- def on_menuToolsLogAdd_command(self, event): ! vstring = [self.project.get('Project', 'majorversion')] ! vstring.append((self.project.get('Project', 'minorversion'))) ! vstring.append((self.project.get('Project', 'fixnumber'))) template = {} template['name'] = self.components.projectName.text *************** *** 274,281 **** txt += 'version of standaloneBuilder.' bull = dialog.alertDialog(self, txt, title) - def on_menuHelpAbout_command(self, event): dlg = HTMLHelp(self) dlg.showModal() dlg.destroy() --- 274,281 ---- txt += 'version of standaloneBuilder.' bull = dialog.alertDialog(self, txt, title) def on_menuHelpAbout_command(self, event): dlg = HTMLHelp(self) + #dlg = newHelp(self) dlg.showModal() dlg.destroy() *************** *** 312,316 **** dlg.ShowModal() dlg.Destroy() ! if self.components.projectName.text != '': if self.cfg.get('ConfigData', 'buildtool') != 'pyInstaller': self.components.specBtn.enabled = False --- 312,316 ---- dlg.ShowModal() dlg.Destroy() ! if self.components.projectName.text != '' and self.project.get('Project', 'status') == 'open': if self.cfg.get('ConfigData', 'buildtool') != 'pyInstaller': self.components.specBtn.enabled = False *************** *** 329,339 **** def on_iconBtn_mouseClick(self, event): title = 'Select icon' - basepath = os.path.join(self.cfg.get('ConfigData', 'projects'), self.components.baseDir.text) - #basepath = os.path.join(basepath, self.components.projectIcon.text) wildcard = "Icon files (*.ico)|*.ico;*.ICO|All files (*.*)|*.*" old = self.components.projectIcon.text ! result = dialog.openFileDialog(self, title, basepath, '', wildcard=wildcard) if result.accepted: ! rpath = self.getRelativePath(basepath, result.paths[0]) if rpath != old: self.components.projectIcon.text = rpath --- 329,337 ---- def on_iconBtn_mouseClick(self, event): title = 'Select icon' wildcard = "Icon files (*.ico)|*.ico;*.ICO|All files (*.*)|*.*" old = self.components.projectIcon.text ! result = dialog.openFileDialog(self, title, self.components.baseDir.text, '', wildcard=wildcard) if result.accepted: ! rpath = self.getRelativePath(self.components.baseDir.text, result.paths[0]) if rpath != old: self.components.projectIcon.text = rpath *************** *** 356,361 **** def on_mainScriptBtn_mouseClick(self, event): title = 'Select main script file' ! basepath = os.path.join(self.cfg.get('ConfigData', 'projects'), self.components.baseDir.text) old = self.components.mainScript.text wildcard = "Script files (*.py)|*.py;*.PY" --- 354,362 ---- def on_mainScriptBtn_mouseClick(self, event): + # the main script for the project ought to reside in the project + # base directory,, but there's probably no good reason to enforce + # this, other than to save me some coding effort... :-( title = 'Select main script file' ! basepath = self.components.baseDir.text old = self.components.mainScript.text wildcard = "Script files (*.py)|*.py;*.PY" *************** *** 375,386 **** def on_EditMainScript_command(self, event): ! editor = self.cfg.get('ConfigData', 'codeeditor') ! item = self.pathJoin(self.components.mainScript.text) ! item = os.path.join(self.components.baseDir.text, item) ! item = os.path.join(self.cfg.get('ConfigData', 'projects'), item) ! if sys.platform.startswith('win'): ! os.system('python "' + editor + '" "' + item + '"') ! else: ! os.system('"' + editor + '" "' + item + '"') def on_addScript_command(self, event): --- 376,388 ---- def on_EditMainScript_command(self, event): ! if self.components.mainScript.text != '': ! editor = self.cfg.get('ConfigData', 'codeeditor') ! item = self.pathJoin(self.components.mainScript.text) ! item = os.path.join(self.components.baseDir.text, item) ! item = os.path.join(self.cfg.get('ConfigData', 'projects'), item) ! if sys.platform.startswith('win'): ! os.system('python "' + editor + '" "' + item + '"') ! else: ! os.system('"' + editor + '" "' + item + '"') def on_addScript_command(self, event): *************** *** 535,539 **** def on_editChgLog_command(self, event): # edit changelog, create it if it doesn't exist ! vstring = string.split(self.components.versionString.text, '.') template = {} template['name'] = self.components.projectName.text --- 537,543 ---- def on_editChgLog_command(self, event): # edit changelog, create it if it doesn't exist ! vstring = [(self.project.get('Project', 'majorversion'))] ! vstring.append((self.project.get('Project', 'minorversion'))) ! vstring.append((self.project.get('Project', 'fixnumber'))) template = {} template['name'] = self.components.projectName.text *************** *** 579,591 **** spec = self.components.projectName.text + '.spec' spec = os.path.join(basedir, spec) - cmd = '"' + editor + '" "' + spec + '"' - if sys.platform.startswith('win'): - if editor.endswith('.py'): - os.system('python "' + editor + '" "' + spec + '"') - else: - os.system('"' + editor + '" "' + spec + '"') - else: - os.system(editor + ' ' + spec) def on_editInnoFile_command(self, event): editor = self.cfg.get('ConfigData', 'texteditor') --- 583,599 ---- spec = self.components.projectName.text + '.spec' spec = os.path.join(basedir, spec) + if not os.path.exists(spec): + title = 'Warning' + txt = 'Spec file %s was not found\n\nWould you like to (re)build it now?' % spec + result = dialog.messageDialog(self, wrap_string(txt, 60), title, wx.ICON_EXCLAMATION | wx.YES_NO | wx.YES_DEFAULT) + if result.accepted: + self.buildSpecFile() + else: + return + + msg = open(spec).read() + result = dialog.scrolledMessageDialog(self, msg, 'pyInstaller spec file [%s]' % spec, size=wx.Size(768, 576)) + def on_editInnoFile_command(self, event): editor = self.cfg.get('ConfigData', 'texteditor') *************** *** 593,603 **** spec = self.components.projectName.text + '.iss' spec = os.path.join(basedir, spec) ! if sys.platform.startswith('win'): ! if editor.endswith('.py'): ! os.system('python "' + editor + '" "' + spec + '"') else: ! os.system('"' + editor + '" "' + spec + '"') ! else: ! os.system(editor + ' ' + spec) def on_runMainScript_command(self, event): --- 601,616 ---- spec = self.components.projectName.text + '.iss' spec = os.path.join(basedir, spec) ! ! if not os.path.exists(spec): ! title = 'Warning' ! txt = 'Inno setup file %s was not found\n\nWould you like to (re)build it now?' % spec ! result = dialog.messageDialog(self, wrap_string(txt, 60), title, wx.ICON_EXCLAMATION | wx.YES_NO | wx.YES_DEFAULT) ! if result.accepted: ! self.buildInnoFile() else: ! return ! ! msg = open(spec).read() ! result = dialog.scrolledMessageDialog(self, msg, 'Inno Setup file [%s]' % spec, size=wx.Size(768, 576)) def on_runMainScript_command(self, event): *************** *** 689,694 **** self.outputWindow.components.importError.enabled = False self.outputWindow.components.importError.visible = False ! self.outputWindow.components.txt1a.visible = False # rebuilding spec file ! self.outputWindow.components.txt1b.visible = False # done self.outputWindow.components.txt2a.visible = False # rebuilding versioninfo file self.outputWindow.components.txt2b.visible = False # done --- 702,709 ---- self.outputWindow.components.importError.enabled = False self.outputWindow.components.importError.visible = False ! self.outputWindow.components.importError.enabled = False ! self.outputWindow.components.importError.visible = False ! self.outputWindow.components.clipBoardBtn.visible = False ! self.outputWindow.components.clipBoardBtn.visible = False self.outputWindow.components.txt2a.visible = False # rebuilding versioninfo file self.outputWindow.components.txt2b.visible = False # done *************** *** 702,705 **** --- 717,722 ---- # delete all transient files from previous rebuilds basedir = str(os.path.join(self.cfg.get('ConfigData', 'projects'), self.components.baseDir.text)) + #print 'using [%s] as basedir' % basedir + #bull = raw_input() versionfile = os.path.join(basedir, 'versioninfo.txt') innofile = self.components.projectName.text + '.iss' *************** *** 866,876 **** def checkResourceFile(self, path): ! # when adding a script, see if there is a matching resource file root, ext = os.path.splitext(path) script = os.path.basename(path) ! resfile = root + '.rsrc.py' ! if os.path.isfile(resfile): ! # is it already in the list of resource files? ! if not os.path.basename(resfile) in self.components.resList.items: txt = '%s has a matching PythonCard resource file. Would you like to also' % (script) txt += ' add the resource file to your project?' --- 883,910 ---- def checkResourceFile(self, path): ! # when adding a script, see if there is a matching resource file - if ! # a script is added which resides outside the main project directory, ! # then we will need to store the full path to the resource file. I'm ! # making the assumption here that the resource file will always reside ! # in the same directory as the script it relates to - if this changes ! # in a future release of PythonCard, then this logic will break... :-( root, ext = os.path.splitext(path) script = os.path.basename(path) ! ! resfile = self.getRelativePath(self.components.baseDir.text, root + '.rsrc.py') ! ! if os.path.isabs(resfile): ! fullPath = resfile ! else: ! fullPath = os.path.join(self.components.baseDir.text, resfile) ! ! # at this point, resfile will be either 'blah.rsrc.py' in the case where ! # the script is within the current project base directory, or something ! # like 'C:\Some\random\path\blah.rsrc.py' if it lives outside the ! # project base directory. in either case, we have to use the absolute ! # path name to check for the existence of the file ! if os.path.isfile(fullPath): ! # resource exists, is it already in the list of resource files? ! if not resfile in self.components.resList.items: txt = '%s has a matching PythonCard resource file. Would you like to also' % (script) txt += ' add the resource file to your project?' *************** *** 879,883 **** if result.accepted: x = self.components.resList.items ! x.append(os.path.basename(resfile)) x.sort() self.components.resList.items = x --- 913,917 ---- if result.accepted: x = self.components.resList.items ! x.append(resfile) x.sort() self.components.resList.items = x *************** *** 960,965 **** --- 994,1001 ---- def getRelativePath(self, root, path): # remove the root part of an absolute path + #print 'getRelativePath: root=[%s], path=[%s]' % (root, path) retPath = string.replace(path, root, '') if retPath[0] == os.sep: retPath = retPath[1:] + #print 'getRelativePath: returning [%s]' % retPath #bull = raw_input() return retPath *************** *** 973,976 **** --- 1009,1014 ---- else: # Windows needs to put the config file in C:\Program Files\PM\pm.ini + # this is a bad thing on WindowsXP and won't be allowed at all once + # Vista is released... self.HOMEDIR = os.path.dirname(sys.argv[0]) self.CONFIG = 'standaloneBuilder.ini' *************** *** 1004,1007 **** --- 1042,1046 ---- if btool == 'py2exe': + self.components.specBtn.enabled = False try: from distutils.core import setup as wibble *************** *** 1084,1088 **** self.components.projectDesc.text = wizResult.projectDesc self.components.mainScript.text = '' - self.components.versionString.text = '0.1.1' self.components.scriptList.items = [] self.components.resList.items = [] --- 1123,1126 ---- *************** *** 1095,1098 **** --- 1133,1139 ---- # add in the remainder of the project default properties + self.project.set('Project', 'majorversion', '0') + self.project.set('Project', 'minorversion', '1') + self.project.set('Project', 'fixnumber', '1') self.project.set('Project', 'build', '1') self.project.set('Project', 'docfilespath', 'doc') *************** *** 1112,1116 **** self.project.set('Project', 'status', 'open') ! self.project.set('Project', 'applicence', 'doc,gpl.txt') x = os.path.join('build', '%s.iss' % self.components.projectName.text) --- 1153,1157 ---- self.project.set('Project', 'status', 'open') ! self.project.set('Project', 'applicence', os.path.normpath('doc/gpl.txt')) x = os.path.join('build', '%s.iss' % self.components.projectName.text) *************** *** 1120,1127 **** self.project.set('Project', 'specfile', x) ! self.project.set('Otherfiles', '0', os.path.join('doc', 'about.html')) ! self.project.set('Otherfiles', '1', os.path.join('doc', 'author.html')) ! self.project.set('Otherfiles', '2', os.path.join('doc', 'gpl.txt')) ! self.project.set('Otherfiles', '3', os.path.join('doc', 'gpl.html')) self.project.set('Otherfiles', '4', 'changelog.txt') self.project.set('Otherfiles', '5', 'readme.txt') --- 1161,1168 ---- self.project.set('Project', 'specfile', x) ! self.project.set('Otherfiles', '0', os.path.normpath('doc/about.html')) ! self.project.set('Otherfiles', '1', os.path.normpath('doc/author.html')) ! self.project.set('Otherfiles', '2', os.path.normpath('doc/gpl.txt')) ! self.project.set('Otherfiles', '3', os.path.normpath('doc/gpl.html')) self.project.set('Otherfiles', '4', 'changelog.txt') self.project.set('Otherfiles', '5', 'readme.txt') *************** *** 1172,1176 **** # build a tarball for a Linux system # create a top level directory for the stuff to go in ! vstring = self.components.versionString.text tdir = self.project.get('Project', 'name') tdir += '-' + vstring --- 1213,1219 ---- # build a tarball for a Linux system # create a top level directory for the stuff to go in ! vstring = self.project.get('Project', 'majorversion') ! vstring += '.' + self.project.get('Project', 'minorversion') ! vstring += '.' + self.project.get('Project', 'fixnumber') tdir = self.project.get('Project', 'name') tdir += '-' + vstring *************** *** 1234,1237 **** --- 1277,1286 ---- # if we're building from a PythonCard application, check that the # main script includes imports of the required PythonCard components + ### TODO ############################################################### + # # + # make this work properly for a non-PythonCard project - it should # + # return impFound=True if there are no PythonCard resource files in # + # the project # + ######################################################################## imps = {} impline = 'from PythonCard.components import ' *************** *** 1562,1566 **** inno = [] ! basedir = os.path.join(self.cfg.get('ConfigData', 'projects'), self.components.baseDir.text) innofile = self.components.projectName.text + '.iss' --- 1611,1615 ---- inno = [] ! basedir = self.components.baseDir.text innofile = self.components.projectName.text + '.iss' *************** *** 1700,1704 **** # first confirm what the new version number will be ! vstring = self.components.versionString.text dlg = versionDialog(self, vstring) if dlg.ShowModal() != wx.ID_OK: return 0 --- 1749,1755 ---- # first confirm what the new version number will be ! vstring = self.project.get('Project', 'majorversion') ! vstring += '.' + self.project.get('Project', 'minorversion') ! vstring += '.' + self.project.get('Project', 'fixnumber') dlg = versionDialog(self, vstring) if dlg.ShowModal() != wx.ID_OK: return 0 *************** *** 1739,1743 **** self.project.set('Project', 'build', '1') self.project.set('Project', 'status', 'open') - self.components.versionString.text = vstring[0] + '.' + vstring[1] + '.' + vstring[2] self.documentChanged = True self.updateStatusBar() --- 1790,1793 ---- *************** *** 1827,1846 **** except: pass - - vstring = string.split(self.components.versionString.text, '.') - self.project.set('Project', 'majorversion', str(vstring[0])) - self.project.set('Project', 'minorversion', str(vstring[1])) - self.project.set('Project', 'fixnumber', str(vstring[2])) - self.project.set('Project', 'name', self.components.projectName.text) # set the project basepath, we need to split off the top level projects # folder as defined in prefs ! base = self.getRelativePath(self.cfg.get('ConfigData', 'projects'), self.components.baseDir.text) ! base = self.pathSplit(base) ! self.project.set('Project', 'basepath', base) self.project.set('Project', 'projectdesc', self.components.projectDesc.text) ! self.project.set('Project', 'mainscript', self.pathSplit(self.components.mainScript.text)) ! self.project.set('Project', 'iconfile', self.pathSplit(self.components.projectIcon.text)) self.project.set('Project', 'innoscript', '%s.iss' % self.components.projectName.text) self.project.set('Project', 'specfile', '%s.spec' % self.components.projectName.text) --- 1877,1894 ---- except: pass # set the project basepath, we need to split off the top level projects # folder as defined in prefs ! self.project.set('Project', 'name', self.components.projectName.text) + if sys.platform.startswith('win'): + self.project.set('Project', 'winbasepath', self.components.baseDir.text) + elif sys.platform.startswith('linux'): + self.project.set('Project', 'linuxbasepath', self.components.baseDir.text) + else: + self.project.set('Project', 'basepath', self.components.baseDir.text) self.project.set('Project', 'projectdesc', self.components.projectDesc.text) ! self.project.set('Project', 'mainscript', self.components.mainScript.text) ! self.project.set('Project', 'iconfile', self.components.projectIcon.text) self.project.set('Project', 'innoscript', '%s.iss' % self.components.projectName.text) self.project.set('Project', 'specfile', '%s.spec' % self.components.projectName.text) *************** *** 1854,1858 **** cnt = 0 for item in self.components.scriptList.items: ! self.project.set('Scripts', str(cnt), self.pathSplit(item)) cnt += 1 --- 1902,1906 ---- cnt = 0 for item in self.components.scriptList.items: ! self.project.set('Scripts', str(cnt), item) cnt += 1 *************** *** 1865,1869 **** cnt = 0 for item in self.components.resList.items: ! self.project.set('ResourceFiles', str(cnt), self.pathSplit(item)) cnt += 1 --- 1913,1917 ---- cnt = 0 for item in self.components.resList.items: ! self.project.set('ResourceFiles', str(cnt), item) cnt += 1 *************** *** 1876,1880 **** cnt = 0 for item in self.components.otherList.items: ! self.project.set('Otherfiles', str(cnt), self.pathSplit(item)) cnt += 1 --- 1924,1928 ---- cnt = 0 for item in self.components.otherList.items: ! self.project.set('Otherfiles', str(cnt), item) cnt += 1 *************** *** 1886,1890 **** cnt = 0 for item in self.components.pixmapList.items: ! self.project.set('Pixmaps', str(cnt), self.pathSplit(item)) cnt += 1 --- 1934,1938 ---- cnt = 0 for item in self.components.pixmapList.items: ! self.project.set('Pixmaps', str(cnt), item) cnt += 1 *************** *** 1895,1911 **** def updateStatusBar(self): ! string = self.components.projectName.text string += '-' ! string += self.components.versionString.text string += ' (Build ' + self.project.get('Project', 'build') + ')' string += ' - Release status: %s' % self.project.get('Project', 'status') ! mod = '' ! if self.documentChanged: mod = ' *' if self.documentPath is not None: ! self.SetTitle(self.startTitle + ' - [' + os.path.split(self.documentPath)[-1] + mod + ']') else: ! self.SetTitle(self.startTitle + ' - [Untitled' + mod + ']') self.statusBar.text = string try: wx.Yield() --- 1943,1968 ---- def updateStatusBar(self): ! vstring = (self.project.get('Project', 'majorversion')) +'.' ! vstring += (self.project.get('Project', 'minorversion')) + '.' ! vstring += (self.project.get('Project', 'fixnumber')) ! ! string = ' ' + self.components.projectName.text string += '-' ! string += vstring string += ' (Build ' + self.project.get('Project', 'build') + ')' string += ' - Release status: %s' % self.project.get('Project', 'status') ! ! if self.documentChanged: ! self.components.saveBtn.enabled = True ! else: ! self.components.saveBtn.enabled = False ! if self.documentPath is not None: ! self.SetTitle(self.startTitle + ' - [' + os.path.split(self.documentPath)[-1] + ']') else: ! self.SetTitle(self.startTitle + ' - [Untitled]') self.statusBar.text = string + try: wx.Yield() *************** *** 1915,1919 **** def createProject(self): # create all the folders and other gubbins ! basepath = os.path.join(self.cfg.get('ConfigData', 'projects'), self.pathJoin(self.project.get('Project', 'basepath'))) try: --- 1972,1988 ---- def createProject(self): # create all the folders and other gubbins ! if sys.platform.startswith('win'): ! try: ! basepath = self.project.get('Project', 'winbasepath') ! except ConfigParser.NoOptionError: ! basepath = self.project.get('Project', 'basepath') ! elif sys.platform.startswith('linux'): ! try: ! basepath = self.project.get('Project', 'linuxbasepath') ! except ConfigParser.NoOptionError: ! basepath = self.project.get('Project', 'basepath') ! else: ! basepath = self.project.get('Project', 'basepath') ! #basepath = os.path.join(self.cfg.get('ConfigData', 'projects'), self.pathJoin(self.project.get('Project', 'basepath'))) try: *************** *** 2070,2082 **** def Project2UI(self): - vstring = (self.project.get('Project', 'majorversion')) +'.' - vstring += (self.project.get('Project', 'minorversion')) + '.' - vstring += (self.project.get('Project', 'fixnumber')) - self.components.versionString.text = vstring self.components.projectName.text = self.project.get('Project', 'name') ! self.components.baseDir.text = self.pathJoin(self.project.get('Project', 'basepath')) self.components.projectDesc.text = self.project.get('Project', 'projectdesc') ! self.components.mainScript.text = self.pathJoin(self.project.get('Project', 'mainscript')) ! self.components.projectIcon.text = self.pathJoin(self.project.get('Project', 'iconfile')) self.components.scriptList.items = self.sectionOutput('Scripts') self.components.resList.items = self.sectionOutput('ResourceFiles') --- 2139,2160 ---- def Project2UI(self): self.components.projectName.text = self.project.get('Project', 'name') ! ! if sys.platform.startswith('win'): ! try: ! self.components.baseDir.text = self.project.get('Project', 'winbasepath') ! except ConfigParser.NoOptionError: ! self.components.baseDir.text = self.project.get('Project', 'basepath') ! elif sys.platform.startswith('linux'): ! try: ! self.components.baseDir.text = self.project.get('Project', 'linuxbasepath') ! except ConfigParser.NoOptionError: ! self.components.baseDir.text = self.project.get('Project', 'basepath') ! else: ! self.components.baseDir.text = self.project.get('Project', 'basepath') ! self.components.projectDesc.text = self.project.get('Project', 'projectdesc') ! self.components.mainScript.text = self.project.get('Project', 'mainscript') ! self.components.projectIcon.text = self.project.get('Project', 'iconfile') self.components.scriptList.items = self.sectionOutput('Scripts') self.components.resList.items = self.sectionOutput('ResourceFiles') *************** *** 2099,2107 **** break else: if prefix is not None: item = os.path.join(prefix, item) if fd is None: ! list.append(self.pathJoin(item)) else: ! fd.write(self.pathJoin(item) + '\n') cnt += 1 --- 2177,2186 ---- break else: + item = os.path... [truncated message content] |
From: Phil E. <l2...@us...> - 2006-11-03 14:41:17
|
Update of /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22653 Modified Files: pic11.jpg pic23.jpg pic26.jpg pic2.jpg pic3.jpg pic4.jpg pic5.jpg pic6.jpg pic7.jpg pic8.jpg pic9.jpg standaloneBuilder.html Log Message: Updated documentation and screenshots for standaloneBuilder version 0.3 Index: pic3.jpg =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc/pic3.jpg,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsEGnpxN and /tmp/cvshlLwUI differ Index: pic7.jpg =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc/pic7.jpg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsvviCkO and /tmp/cvsVYG3LJ differ Index: pic5.jpg =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc/pic5.jpg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvstOr9SQ and /tmp/cvsI7cMoM differ Index: pic23.jpg =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc/pic23.jpg,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsHgORfT and /tmp/cvsD8WXPO differ Index: pic6.jpg =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc/pic6.jpg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvscxnXo1 and /tmp/cvs1wOW7W differ Index: pic9.jpg =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc/pic9.jpg,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsRE3298 and /tmp/cvsqe2K64 differ Index: pic4.jpg =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc/pic4.jpg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvs68hEB7 and /tmp/cvsoOoVK3 differ Index: standaloneBuilder.html =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc/standaloneBuilder.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** standaloneBuilder.html 12 May 2005 19:36:04 -0000 1.4 --- standaloneBuilder.html 3 Nov 2006 14:14:01 -0000 1.5 *************** *** 27,34 **** <h2>Pre-Requisites</h2> <p>As well as Python, wxPython and PythonCard, you will need to have installed and configured ! McMillan Installer and Inno Setup on your computer. These packages can be downloaded from the following locations as of the time of writing: ! <ul> ! <li>McMillan Installer: <a href="http://paulbaranowski.org/modules.php?name=Downloads&d_op=getit&lid=8">http://paulbaranowski.org/modules.php?name=Downloads&d_op=getit&lid=8</a></li> <li>Inno Setup: <a href="http://www.jrsoftware.org/isdl.php">http://www.jrsoftware.org/isdl.php</a></li> </ul> --- 27,35 ---- <h2>Pre-Requisites</h2> <p>As well as Python, wxPython and PythonCard, you will need to have installed and configured ! pyInstaller and/or py2exe together with Inno Setup on your computer. These packages can be downloaded from the following locations as of the time of writing: ! <ul> ! <li>pyInstaller: <a href="http://pyinstaller.python-hosting.com/">http://pyinstaller.python-hosting.com/</a></li> ! <li>py2exe: <a href="http://www.py2exe.org/">http://www.py2exe.org/</a></li> <li>Inno Setup: <a href="http://www.jrsoftware.org/isdl.php">http://www.jrsoftware.org/isdl.php</a></li> </ul> *************** *** 86,89 **** --- 87,92 ---- <div align="center"><img src="pic10.jpg" /></div><br /> <div align="center"><img src="pic11.jpg" /></div> + + <p>The program will automatically add in any matching PythonCard resource files, too.</p> <p>A note is probably in order at this point about the <i>Script files</i> box. Generally, *************** *** 101,111 **** simply selecting it in the list and clicking the <i>Edit...</i> button.</p> ! <p>Now, under the <i>Resource files</i> section of the main window, click the Add button. ! Select the <i>counter.rsrc.py</i> file and click on Open. This adds the resource file ! into the project:</p> ! ! <div align="center"><img src="pic12.jpg" /></div> ! ! <p>Having added the resource file, you can now open it in the resource editor simply by clicking on the Edit button on the main window. Files which are added in other sections of the main window can be edited in the same way. Script files will be opened using the --- 104,108 ---- simply selecting it in the list and clicking the <i>Edit...</i> button.</p> ! <p>Any resource files which are added to the project can be opened in the resource editor simply by clicking on the Edit button on the main window. Files which are added in other sections of the main window can be edited in the same way. Script files will be opened using the *************** *** 130,139 **** <ul> ! <li>Projects folder in preferences is <i>P:\</i></li> <li>The project was created in a folder called <i>sab-demo</i></li> <li>The build directory is called simply <i>build</i></li> </ul> ! <p>The full path to the build directory is therefore <i>P:\sab-demo\build</i>. Having all of the folder references relative to each other allows <i>standaloneBuilder</i> to maintain projects on both Windows and Linux platforms, with Python itself taking --- 127,136 ---- <ul> ! <li>Projects folder in preferences is <i>C:\Documents and Settings\pedwards\My Documents\Projects</i></li> <li>The project was created in a folder called <i>sab-demo</i></li> <li>The build directory is called simply <i>build</i></li> </ul> ! <p>The full path to the build directory is therefore <i>C:\Documents and Settings\pedwards\My Documents\Projects\sab-demo\build</i>. Having all of the folder references relative to each other allows <i>standaloneBuilder</i> to maintain projects on both Windows and Linux platforms, with Python itself taking Index: pic11.jpg =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc/pic11.jpg,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsK4tmHe and /tmp/cvsL9bc3a differ Index: pic2.jpg =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc/pic2.jpg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsMj37Lh and /tmp/cvsYlA1ce differ Index: pic26.jpg =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc/pic26.jpg,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvswXfFkr and /tmp/cvsx8lc1n differ Index: pic8.jpg =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc/pic8.jpg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvs8wkn4y and /tmp/cvs3IrJXv differ |
From: Kevin A. <ka...@us...> - 2006-09-15 23:54:13
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30211/modules Modified Files: propertyEditor.py Log Message: added stringItems and other code to avoid eval() on strings Index: propertyEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules/propertyEditor.py,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** propertyEditor.py 3 Oct 2004 19:21:34 -0000 1.56 --- propertyEditor.py 15 Sep 2006 23:54:07 -0000 1.57 *************** *** 34,37 **** --- 34,38 ---- self.cantModify = ['id', 'name', 'alignment', 'layout', 'style', 'border', \ 'horizontalScrollbar', 'min', 'max', 'columns', 'rules', 'labels', 'ticks'] + self.stringItems = self.popItems + ['alignment', 'command', 'file', 'label', 'name', 'text', 'toolTip', 'userdata'] self.editItems = [self.components.wField, self.components.wColor, *************** *** 196,210 **** elif propName in self.popItems: value = self.components.wPop.stringSelection ! elif propName in ('items', 'userdata') or (wClass == 'TextArea' and propName == 'text'): value = self.components.wTextArea.text ! else: ! #value = self.components.wField.GetValue() ! value = self.components.wField.text ! ! if propName not in ['label', 'stringSelection', 'text', 'toolTip', 'userdata']: try: value = eval(value) except: pass # KEA 2004-05-10 --- 197,220 ---- elif propName in self.popItems: value = self.components.wPop.stringSelection ! elif propName == 'items': value = self.components.wTextArea.text ! # KEA 2006-09-15 ! # need better error handling try: value = eval(value) except: pass + elif propName == 'userdata' or (wClass == 'TextArea' and propName == 'text'): + value = self.components.wTextArea.text + else: + value = self.components.wField.text + + if propName not in self.stringItems: + # KEA 2006-09-15 + # need better error handling + try: + value = eval(value) + except: + pass # KEA 2004-05-10 *************** *** 358,362 **** ##widget = self.components[wName] widget = self._comp[wName] ! if propName in ['label', 'stringSelection', 'text', 'toolTip'] or propName in self.checkItems: value = getattr(widget, propName) else: --- 368,372 ---- ##widget = self.components[wName] widget = self._comp[wName] ! if propName in self.stringItems or propName in self.checkItems: value = getattr(widget, propName) else: *************** *** 411,415 **** value = str(size) ! self.components.wField.text = value # this should only display if the attribute is settable # so name, alignment, and others are read-only --- 421,428 ---- value = str(size) ! if value == None: ! self.components.wField.text = '' ! else: ! self.components.wField.text = value # this should only display if the attribute is settable # so name, alignment, and others are read-only |
From: Kevin A. <ka...@us...> - 2006-08-12 17:17:41
|
Update of /cvsroot/pythoncard/PythonCard/docs/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8245/docs/html Modified Files: faq.html Log Message: updated py2exe link and added py2app link on standalones Index: faq.html =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/faq.html,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** faq.html 1 Oct 2004 00:00:45 -0000 1.13 --- faq.html 12 Aug 2006 17:17:38 -0000 1.14 *************** *** 41,45 **** A. Yes</p> <p>Q. Can I build standalone executables?<br /> ! A. Yes, using <a href="http://starship.python.net/crew/theller/py2exe/">py2exe</a> or Gordon McMillan's installer. On Mac OS X, you can use <a href="http://www.python.org/moin/BundleBuilder">BundleBuilder</a> to make standalones. The minimalStandalone sample includes example scripts for all of them.</p> <p>Q. How can I make the Return key act like the Tab key in a field, so that pressing Return navigates to the next component?<br /> --- 41,45 ---- A. Yes</p> <p>Q. Can I build standalone executables?<br /> ! A. Yes, using <a href="http://www.py2exe.org/">py2exe</a> or Gordon McMillan's installer. On Mac OS X, you can use <a href="http://undefined.org/python/#py2app">py2app</a> to make standalones. The minimalStandalone sample includes example scripts for all of them.</p> <p>Q. How can I make the Return key act like the Tab key in a field, so that pressing Return navigates to the next component?<br /> |
From: Kevin A. <ka...@us...> - 2006-08-10 09:40:57
|
Update of /cvsroot/pythoncard/PythonCard/tools/codeEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16193/tools/codeEditor Modified Files: codeEditor.py Log Message: added support for save before opening drag and drop document Index: codeEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/codeEditor/codeEditor.py,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -d -r1.127 -r1.128 *** codeEditor.py 4 Aug 2006 20:26:32 -0000 1.127 --- codeEditor.py 10 Aug 2006 09:40:54 -0000 1.128 *************** *** 86,89 **** --- 86,115 ---- # a cursor location # in the tabcodeEditor could open tabs for each file dropped + + # KEA 2006-08-10 + # modified from on_menuFileOpen_select + # replaced self with self.window + # since codeEditor uses a single window, give the user + # a chance to save the document if it has been changed + # if the user doesn't save, then the drop operation + # won't complete do to the return below + # in tabcodeEditor.py it would probably make more sense to just + # open a new tab if the current document has been modified + if self.window.components.document.GetModify(): + save = self.window.saveChanges() + if save == "Cancel": + # don't do anything, just go back to editing + return + elif save == "No": + # any changes will be lost + pass + else: + if self.window.documentPath is None: + # if the user cancels out of the Save As then go back to editing + if not self.window.on_menuFileSaveAs_select(None): + return + else: + self.window.saveFile(self.window.documentPath) + self.window.openFile(filenames[0]) |
From: Kevin A. <ka...@us...> - 2006-08-09 02:47:06
|
Update of /cvsroot/pythoncard/PythonCard/samples/pictureViewer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17730 Modified Files: pictureViewer.py Log Message: added drag and drop fixed orientation with try/except on Horizontal Index: pictureViewer.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/pictureViewer/pictureViewer.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** pictureViewer.py 13 Dec 2005 11:13:24 -0000 1.25 --- pictureViewer.py 9 Aug 2006 02:47:03 -0000 1.26 *************** *** 11,14 **** --- 11,34 ---- from PythonCard import EXIF + + class MyFileDropTarget(wx.FileDropTarget): + def __init__(self, window): + wx.FileDropTarget.__init__(self) + self.window = window + + def OnDropFiles(self, x, y, filenames): + print "\n%d file(s) dropped at %d,%d:\n" % (len(filenames), x, y) + for f in filenames: + print f + # KEA 2006-08-04 + # first pass support of drag and drop of files on editor + # just open the first one + # could do other stuff like insert the text of the file dropped + # at the cursor which requires converting the x, y coordinates to + # a cursor location + # in the tabcodeEditor could open tabs for each file dropped + self.window.openFile(filenames[0]) + + class PictureViewer(model.Background): *************** *** 50,53 **** --- 70,75 ---- self.visible = True + dt = MyFileDropTarget(self) + self.components.bufOff.SetDropTarget(dt) def on_idle(self, event): *************** *** 167,171 **** # (0x0112) Short=8 @ 54 # but the str() is just 1, 8, etc. ! orientation = int(str(tags['Image Orientation'])) #print path #print 'Image Orientation: %d' % orientation --- 189,198 ---- # (0x0112) Short=8 @ 54 # but the str() is just 1, 8, etc. ! try: ! orientation = int(str(tags['Image Orientation'])) ! except ValueError: ! # Horizontal (normal) ! print "Exception on orientation:", tags['Image Orientation'] ! orientation = 1 #print path #print 'Image Orientation: %d' % orientation |
From: Kevin A. <ka...@us...> - 2006-08-07 00:16:56
|
Update of /cvsroot/pythoncard/PythonCard/docs/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27923/docs/html Modified Files: macosx_tiger_installation.html Log Message: tweaked PythonLauncher and Acid Test sections for 2.4 Index: macosx_tiger_installation.html =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/macosx_tiger_installation.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** macosx_tiger_installation.html 6 Aug 2006 23:54:51 -0000 1.3 --- macosx_tiger_installation.html 7 Aug 2006 00:16:53 -0000 1.4 *************** *** 82,86 **** <p>The default install leaves .py and .pyw files associated with the Python IDE rather than PythonLauncher which is the app used to run Python scripts ! from the Finder. PythonLauncher is located in your Applications/MacPython-2.3 folder</p> <p>If you select a .py file you can choose Get Info from the File menu and then change the files to open with PythonLauncher instead of the IDE if you --- 82,86 ---- <p>The default install leaves .py and .pyw files associated with the Python IDE rather than PythonLauncher which is the app used to run Python scripts ! from the Finder. PythonLauncher is located in your Applications/MacPython 2.4 folder</p> <p>If you select a .py file you can choose Get Info from the File menu and then change the files to open with PythonLauncher instead of the IDE if you *************** *** 93,97 **** <h3>Acid Test</h3> <p>OK, now comes the acid test. Open the folder called "minimal" in ! <span class="code">/Library/Python/2.3/PythonCard/samples</span>. Find the icon labeled minimal.py and double-click it. In a few moments (after an operating system console window has appeared), a small window like the --- 93,97 ---- <h3>Acid Test</h3> <p>OK, now comes the acid test. Open the folder called "minimal" in ! <span class="code">/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PythonCard/samples</span>. Find the icon labeled minimal.py and double-click it. In a few moments (after an operating system console window has appeared), a small window like the |
From: Kevin A. <ka...@us...> - 2006-08-07 00:03:33
|
Update of /cvsroot/pythoncard/PythonCard/docs/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23337 Modified Files: documentation.html Log Message: edit for Tiger Index: documentation.html =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/documentation.html,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** documentation.html 26 May 2006 01:22:20 -0000 1.25 --- documentation.html 7 Aug 2006 00:03:31 -0000 1.26 *************** *** 19,23 **** <p>The <a href="installation.html">installation guide</a> contains instructions for installing the latest versions of Python, wxPython, and ! PythonCard on Mac OS X (Jaguar and Panther), Linux, and Windows.</p> <h2><a name="learning_python">Learning Python</a></h2> <p>We've put together a set of links to some of the --- 19,23 ---- <p>The <a href="installation.html">installation guide</a> contains instructions for installing the latest versions of Python, wxPython, and ! PythonCard on Mac OS X (Tiger, Panther, and Jaguar), Linux, and Windows.</p> <h2><a name="learning_python">Learning Python</a></h2> <p>We've put together a set of links to some of the |
From: Kevin A. <ka...@us...> - 2006-08-06 23:55:55
|
Update of /cvsroot/pythoncard/PythonCard/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20456/docs Modified Files: changelog.txt Log Message: Mac OS X Tiger install docs Index: changelog.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/changelog.txt,v retrieving revision 1.331 retrieving revision 1.332 diff -C2 -d -r1.331 -r1.332 *** changelog.txt 4 Aug 2006 20:26:32 -0000 1.331 --- changelog.txt 6 Aug 2006 23:55:52 -0000 1.332 *************** *** 9,12 **** --- 9,13 ---- Release 0.8.3 2006-08-?? + added Mac OS X Tiger installation instructions added drag and drop file support to codeEditor added dijkstra sample |
From: Kevin A. <ka...@us...> - 2006-08-06 23:54:55
|
Update of /cvsroot/pythoncard/PythonCard/docs/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20073/docs/html Modified Files: installation.html macosx_tiger_installation.html Log Message: added Mac OS X Tiger install instructions Index: macosx_tiger_installation.html =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/macosx_tiger_installation.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** macosx_tiger_installation.html 6 Apr 2006 11:00:25 -0000 1.2 --- macosx_tiger_installation.html 6 Aug 2006 23:54:51 -0000 1.3 *************** *** 5,23 **** <link rel="stylesheet" href="PythonCard.css" type="text/css"/> <meta name="author" content="Kevin Altis" /> ! <title>Installing PythonCard on Mac OS X (Panther)</title> </head> <body> <div id="banner"> ! <h1>How to Install PythonCard on Mac OS X (Panther)</h1> </div> <?php include "sidebar.php" ?> <div id="content"> <p><strong>The instructions below are for installing PythonCard on Mac OS ! 10.3 (Panther). If you are using Mac OS 10.2 (Jaguar), then please use ! <a href="macosx_jaguar_installation.html">these instructions</a> instead. </strong></p> <p>Installing PythonCard on your system requires the following steps:</p> <ol> ! <li>Download MacPython add-ons from MacPython site.</li> <li>Download wxPython from the wxPython.org site.</li> <li>Download PythonCard from the PythonCard site.</li> --- 5,24 ---- <link rel="stylesheet" href="PythonCard.css" type="text/css"/> <meta name="author" content="Kevin Altis" /> ! <title>Installing PythonCard on Mac OS X (Tiger)</title> </head> <body> <div id="banner"> ! <h1>How to Install PythonCard on Mac OS X (Tiger)</h1> </div> <?php include "sidebar.php" ?> <div id="content"> <p><strong>The instructions below are for installing PythonCard on Mac OS ! 10.4 (Tiger). If you are using Mac OS 10.3 (Panther), then please use ! <a href="macosx_panther_installation.html">these instructions</a> instead or ! <a href="macosx_jaguar_installation.html">these instructions</a> if you're using Mac OS 10.2 (Jaguar). </strong></p> <p>Installing PythonCard on your system requires the following steps:</p> <ol> ! <li>Download Python from the python.org site.</li> <li>Download wxPython from the wxPython.org site.</li> <li>Download PythonCard from the PythonCard site.</li> *************** *** 27,39 **** <li>Confirm the installation works</li> </ol> ! <h2>Downloading MacPython add-ons</h2> ! <p>If you're running Panther then you already have Python 2.3 installed on ! your system, but we want to get the MacPython add-ons to get the ! PackageManager and PythonLauncher.</p> ! <p>Click on this <a href="http://ftp.cwi.nl/jack/python/mac/MacPython-Panther-2.3-2.dmg">MacPython-Panther-2.3-2.dmg</a> link to begin the download. Most Mac OS X browsers will save the file to your desktop.</p> <h2>Downloading wxPython</h2> ! <p>PythonCard relies on the wxPython package. Click on this <a href="http://prdownloads.sourceforge.net/wxpython/wxPythonOSX-2.5.2.8-panther-Py2.3.dmg">wxPythonOSX-2.5.2.8-panther-Py2.3.dmg</a> link to begin the download. Again, most Mac OS X browsers will save the file to your desktop.</p> --- 28,39 ---- <li>Confirm the installation works</li> </ol> ! <h2>Downloading Python</h2> ! <p>If you're running Tiger then you already have Python 2.3.5 installed on ! your system, but we want a more up-to-date build of Python.</p> ! <p>Click on this <a href="http://www.python.org/ftp/python/2.4.3/Universal-MacPython-2.4.3.dmg">Universal-MacPython-2.4.3.dmg</a> link to begin the download. Most Mac OS X browsers will save the file to your desktop.</p> <h2>Downloading wxPython</h2> ! <p>PythonCard relies on the wxPython package. Click on this <a href="http://prdownloads.sourceforge.net/wxpython/wxPython2.6-osx-unicode-2.6.3.3-universal10.4-py2.4.dmg">wxPython2.6-osx-unicode-2.6.3.3-universal10.4-py2.4.dmg</a> link to begin the download. Again, most Mac OS X browsers will save the file to your desktop.</p> *************** *** 43,80 **** link to begin the download. Again, most Mac OS X browsers will save the file to your desktop.</p> ! <h2>Installing MacPython add-ons</h2> ! <p>The MacPython add-ons arrive at your system as an installable disk image. ! All you have to do is double-click on the file you downloaded (it's called ! MacPython-Panther-2.3-2.dmg), then double-click the MacPython-Panther.pkg ! icon and follow the instructions in the installation wizard. The installer ! will create a MacPython-2.3 directory in your Applications folder.</p> <h2>Installing wxPython</h2> <p>wxPython also comes as an installable disk image. Just double-click on the ! file you downloaded (it's called wxPythonOSX-2.5.2.8-panther-Py2.3.dmg), then ! double-click the wxPythonOSX-panther.pkg icon and follow the instructions. ! wxPython will be installed into <span class="code">/Library/Python/2.3/</span>. Note that this is the same directory as <span class="code">/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/</span> since the two directories are connected by a symbolic link in the file system.</p> <p>I recommend creating a wxPython folder in your Applications folder and copying the Apps, Docs, Samples, and README 1st.txt files to the wxPython ! folder.</p> <h2>Installing PythonCard</h2> <p>The PythonCard-0.8.2.tar.gz file you downloaded should automatically be decompressed by Stuffit; if the file isn't already decompressed, then double-click the PythonCard-0.8.2.tar.gz file. ! You should now have a PythonCard-0.8 directory on your desktop. Open the Terminal application and do a cd to that directory and then run the setup.py script using the 2.3 Python you just installed. The sudo command will prompt you for your password.</p> <p class="code"> ! [mymachine:~] bob% cd ~/Desktop/PythonCard-0.8<br /> ! [mymachine:~/Desktop/PythonCard-0.8] bob% sudo python setup.py install</p> ! <p>By default, the PythonCard framework will be installed into <span class="code">/Library/Python/2.3/PythonCard/</span>. You'll probably want to make an alias to this directory to keep on your desktop or home folder to make it easier to get to the PythonCard tools and samples.</p> <h2>Confirming Installation</h2> - <p>To run GUI scripts on Mac OS X (i.e. wxPython and PythonCard scripts) from - the Terminal you must start them with pythonw rather than the plain python - interpreter.</p> <h3>Configuring PythonLauncher</h3> <p>The default install leaves .py and .pyw files associated with the Python --- 43,82 ---- link to begin the download. Again, most Mac OS X browsers will save the file to your desktop.</p> ! <h2>Installing Python</h2> ! <p>Python arrives at your system as an installable disk image. All you have ! to do is double-click on the file you downloaded (it's called ! Universal-MacPython-2.4.3.dmg), then double-click the MacPython.mpkg icon and ! follow the instructions in the installation wizard. The installer will create ! a new directory <span class="code">/Library/Frameworks/Python.framework/Versions/2.4/</span> ! to contain the Python executables, documentation, tools, and standard ! libraries. It will also create a folder in your Applications folder called MacPython 2.4 which contains ! the IDLE editor, PythonLauncher, and a large number of demos.</p> <h2>Installing wxPython</h2> <p>wxPython also comes as an installable disk image. Just double-click on the ! file you downloaded (it's called wxPython2.6-osx-unicode-2.6.3.3-universal10.4-py2.4.dmg), then ! double-click the wxPython2.6-osx-unicode-universal10.4-py2.4.pkg icon and follow the instructions. ! wxPython will be installed into <span class="code">/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/</span>. </p> ! You should also download the Docs, Demos, and Samples for wxPython. Click on this <a href="http://prdownloads.sourceforge.net/wxpython/wxPython2.6-osx-docs-demos-2.6.3.3-universal10.4-py2.4.dmg">wxPython2.6-osx-docs-demos-2.6.3.3-universal10.4-py2.4.dmg</a> ! link to begin the download. <p>I recommend creating a wxPython folder in your Applications folder and copying the Apps, Docs, Samples, and README 1st.txt files to the wxPython ! folder once you've opened the disk image.</p> <h2>Installing PythonCard</h2> <p>The PythonCard-0.8.2.tar.gz file you downloaded should automatically be decompressed by Stuffit; if the file isn't already decompressed, then double-click the PythonCard-0.8.2.tar.gz file. ! You should now have a PythonCard-0.8.2 directory on your desktop. Open the Terminal application and do a cd to that directory and then run the setup.py script using the 2.3 Python you just installed. The sudo command will prompt you for your password.</p> <p class="code"> ! [mymachine:~] bob% cd ~/Desktop/PythonCard-0.8.2<br /> ! [mymachine:~/Desktop/PythonCard-0.8.2] bob% sudo python setup.py install</p> ! <p>By default, the PythonCard framework will be installed into <span class="code">/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PythonCard/</span>. You'll probably want to make an alias to this directory to keep on your desktop or home folder to make it easier to get to the PythonCard tools and samples.</p> <h2>Confirming Installation</h2> <h3>Configuring PythonLauncher</h3> <p>The default install leaves .py and .pyw files associated with the Python Index: installation.html =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/installation.html,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** installation.html 26 Jul 2004 15:35:31 -0000 1.17 --- installation.html 6 Aug 2006 23:54:51 -0000 1.18 *************** *** 15,19 **** platforms;</p> <ul> ! <li><a href="macosx_installation.html">Apple Mac OS X (Panther)</a> or <a href="macosx_jaguar_installation.html">Apple Mac OS X (Jaguar)</a></li> <li><a href="linux_installation.html">Linux</a></li> <li><a href="windows_installation.html">Windows</a></li> --- 15,21 ---- platforms;</p> <ul> ! <li><a href="macosx_tiger_installation.html">Apple Mac OS X (Tiger)</a> or ! <a href="macosx_panther_installation.html">Apple Mac OS X (Panther)</a> or ! <a href="macosx_jaguar_installation.html">Apple Mac OS X (Jaguar)</a></li> <li><a href="linux_installation.html">Linux</a></li> <li><a href="windows_installation.html">Windows</a></li> |
From: Kevin A. <ka...@us...> - 2006-08-04 20:26:35
|
Update of /cvsroot/pythoncard/PythonCard/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22173/docs Modified Files: changelog.txt Log Message: added file drag and drop to codeEditor Index: changelog.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/changelog.txt,v retrieving revision 1.330 retrieving revision 1.331 diff -C2 -d -r1.330 -r1.331 *** changelog.txt 30 Jul 2006 01:05:49 -0000 1.330 --- changelog.txt 4 Aug 2006 20:26:32 -0000 1.331 *************** *** 9,12 **** --- 9,13 ---- Release 0.8.3 2006-08-?? + added drag and drop file support to codeEditor added dijkstra sample Dijkstra 's Shortest Path Algorithm Demo by Jure Vrscaj |
From: Kevin A. <ka...@us...> - 2006-08-04 20:26:35
|
Update of /cvsroot/pythoncard/PythonCard/tools/codeEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22173/tools/codeEditor Modified Files: codeEditor.py Log Message: added file drag and drop to codeEditor Index: codeEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/codeEditor/codeEditor.py,v retrieving revision 1.126 retrieving revision 1.127 diff -C2 -d -r1.126 -r1.127 *** codeEditor.py 19 Dec 2005 23:18:04 -0000 1.126 --- codeEditor.py 4 Aug 2006 20:26:32 -0000 1.127 *************** *** 70,73 **** --- 70,92 ---- + class MyFileDropTarget(wx.FileDropTarget): + def __init__(self, window): + wx.FileDropTarget.__init__(self) + self.window = window + + def OnDropFiles(self, x, y, filenames): + print "\n%d file(s) dropped at %d,%d:\n" % (len(filenames), x, y) + for f in filenames: + print f + # KEA 2006-08-04 + # first pass support of drag and drop of files on editor + # just open the first one + # could do other stuff like insert the text of the file dropped + # at the cursor which requires converting the x, y coordinates to + # a cursor location + # in the tabcodeEditor could open tabs for each file dropped + self.window.openFile(filenames[0]) + + class CodeEditor(model.Background): *************** *** 144,147 **** --- 163,168 ---- self.visible = True self.loadShell() + dt = MyFileDropTarget(self) + self.components.document.SetDropTarget(dt) |
From: Kevin A. <ka...@us...> - 2006-08-02 15:41:04
|
Update of /cvsroot/pythoncard/PythonCard/samples/iacGrid In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18621 Modified Files: iacGrid.py Log Message: uncommented event.skip() Index: iacGrid.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/iacGrid/iacGrid.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** iacGrid.py 29 Jul 2006 13:25:42 -0000 1.7 --- iacGrid.py 2 Aug 2006 15:40:54 -0000 1.8 *************** *** 109,113 **** # just for debugging, else clause can go away later print "NOT SELECTING in rangeSelect", event.GetTopLeftCoords(), event.GetBottomRightCoords() ! #event.skip() --- 109,113 ---- # just for debugging, else clause can go away later print "NOT SELECTING in rangeSelect", event.GetTopLeftCoords(), event.GetBottomRightCoords() ! event.skip() *************** *** 120,124 **** # just for debugging, else clause can go away later print "NOT SELECTING in selectCell", event.row, event.column, event.position ! #event.skip() --- 120,124 ---- # just for debugging, else clause can go away later print "NOT SELECTING in selectCell", event.row, event.column, event.position ! event.skip() |
From: Kevin A. <ka...@us...> - 2006-07-30 01:21:33
|
Update of /cvsroot/pythoncard/PythonCard/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18540/samples Modified Files: samples.rsrc.py Log Message: added dijkstra and iacGrid samples Index: samples.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/samples.rsrc.py,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** samples.rsrc.py 5 Jun 2006 12:12:12 -0000 1.63 --- samples.rsrc.py 30 Jul 2006 01:21:31 -0000 1.64 *************** *** 57,61 **** 'position':(0, 0), 'size':(150, 218), ! 'items':[u'addresses', u'ataxx', u'chat', u'companies', u'conversions', u'custdb', u'dbBrowser', u'dialogs', u'doodle', u'flatfileDatabase', u'flock', u'gadflyDatabase', u'gravity', u'hopalong', u'jabberChat', u'life', u'lsystem', u'minimal', u'minimalList', u'minimalTree', u'moderator', u'montyhall', u'mp3player', u'multicolumnexample', u'noresource', u'pictureViewer', u'proof', u'pysshed', u'radioclient', u'redemo', u'reversi', u'rpn', u'samples', u'saveClipboardBitmap', u'searchexplorer', u'simpleBrowser', u'simpleIEBrowser', u'slideshow', u'sounds', u'SourceForgeTracker', u'spirograph', u'spirographInteractive', u'stockprice', u'sudoku', u'sysTray', u'textIndexer', u'textRouter', u'tictactoe', u'turtle', u'twistedEchoClient', u'webgrabber', u'webserver', u'widgets', u'worldclock'], }, --- 57,78 ---- 'position':(0, 0), 'size':(150, 218), ! 'items':[u'addresses', u'ataxx', ! u'chat', u'companies', u'conversions', u'custdb', ! u'dbBrowser', u'dialogs', u'dijkstra', u'doodle', ! u'flatfileDatabase', u'flock', ! u'gadflyDatabase', u'gravity', ! u'iacGrid', ! u'hopalong', u'jabberChat', ! u'life', u'lsystem', ! u'minimal', u'minimalList', u'minimalTree', u'moderator', u'montyhall', ! u'mp3player', u'multicolumnexample', ! u'noresource', ! u'pictureViewer', u'proof', u'pysshed', ! u'radioclient', u'redemo', u'reversi', u'rpn', ! u'samples', u'saveClipboardBitmap', u'searchexplorer', u'simpleBrowser', u'simpleIEBrowser', ! u'slideshow', u'sounds', u'SourceForgeTracker', u'spirograph', u'spirographInteractive', ! u'stockprice', u'sudoku', u'sysTray', ! u'textIndexer', u'textRouter', u'tictactoe', u'turtle', u'twistedEchoClient', ! u'webgrabber', u'webserver', u'widgets', u'worldclock'], }, |
From: Kevin A. <ka...@us...> - 2006-07-30 01:21:33
|
Update of /cvsroot/pythoncard/PythonCard/samples/flock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18540/samples/flock Modified Files: readme.txt Log Message: added dijkstra and iacGrid samples Index: readme.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/flock/readme.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** readme.txt 13 Dec 2005 11:13:23 -0000 1.3 --- readme.txt 30 Jul 2006 01:21:31 -0000 1.4 *************** *** 1,3 **** Builds on the "gravity" sample to show a simple animation of "boids"; shows simple emergent behaviour for a 2-D flock of "boids". ! This sampe uses two images to animate the movement of bird-like objects. --- 1,3 ---- Builds on the "gravity" sample to show a simple animation of "boids"; shows simple emergent behaviour for a 2-D flock of "boids". ! This sample uses two images to animate the movement of bird-like objects. |
From: Kevin A. <ka...@us...> - 2006-07-30 01:21:33
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18540 Modified Files: LICENSE.txt Log Message: added dijkstra and iacGrid samples Index: LICENSE.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/LICENSE.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** LICENSE.txt 30 Jul 2006 01:05:49 -0000 1.7 --- LICENSE.txt 30 Jul 2006 01:21:31 -0000 1.8 *************** *** 19,23 **** Kevin Altis - developer, project lead, <al...@se...> Alex Tweedly - developer, tools, documentation <al...@tw...> ! helpfulWrappers and sudoku samples Rowland Smith - developer Patrick K O'Brien - developer, PyCrust, <po...@or...> --- 19,23 ---- Kevin Altis - developer, project lead, <al...@se...> Alex Tweedly - developer, tools, documentation <al...@tw...> ! flock, helpfulWrappers and sudoku samples Rowland Smith - developer Patrick K O'Brien - developer, PyCrust, <po...@or...> |
Update of /cvsroot/pythoncard/PythonCard/samples/dijkstra In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13249/samples/dijkstra Added Files: .cvsignore dijkstra.py dijkstra.rsrc.py map.xyz priodict.py readme.txt shortpath.py Log Message: added dijkstra sample --- NEW FILE: .cvsignore --- .cvsignore *.pyc *.log *.pyw .DS_Store --- NEW FILE: shortpath.py --- """ Dijkstra's algorithm for shortest paths, David Eppstein, UC Irvine, 4 April 2002 url: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117228 modified by Jure Vrscaj for purposes of dijkstra.py """ import random from priodict import priorityDictionary def Dijkstra(imgdict,start,end=None,zmin=None,zmax=None,can=None,zoom=1): """ Find shortest paths from the start vertex to all vertices nearer than or equal to the end. The input graph G is assumed to have the following representation: A vertex can be any object that can be used as an index into a dictionary. G is a dictionary, indexed by vertices. For any vertex v, G[v] is itself a dictionary, indexed by the neighbors of v. For any edge v->w, G[v][w] is the length of the edge. This is related to the representation in <http://www.python.org/doc/essays/graphs.html> where Guido van Rossum suggests representing graphs as dictionaries mapping vertices to lists of neighbors, however dictionaries of edges have many advantages over lists: they can store extra information (here, the lengths), they support fast existence tests, and they allow easy modification of the graph by edge insertion and removal. Such modifications are not needed here but are important in other graph algorithms. Since dictionaries obey iterator protocol, a graph represented as described here could be handed without modification to an algorithm using Guido's representation. Of course, G and G[v] need not be Python dict objects; they can be any other object that obeys dict protocol, for instance a wrapper in which vertices are URLs and a call to G[v] loads the web page and finds its links. The output is a pair (D,P) where D[v] is the distance from start to v and P[v] is the predecessor of v along the shortest path from s to v. Dijkstra's algorithm is only guaranteed to work correctly when all edge lengths are positive. This code does not verify this property for all edges (only the edges seen before the end vertex is reached), but will correctly compute shortest paths even for some graphs with negative edges, and will raise an exception if it discovers that a negative edge has caused it to make a mistake. """ D = {} # dictionary of final distances P = {} # dictionary of predecessors Q = priorityDictionary() # est.dist. of non-final vert. Q[start] = 0 dirlist = [ (1,0),(-1,0),(0,1),(0,-1), (1,1), (-1,1), (-1,-1), (1,-1), #(2,0),(-2,0),(0,2),(0,-2), (2,2), (-2,2), (-2,-2), (2,-2), ] if can: can.autoRefresh = False refreshtime = len(imgdict)/100 for v in Q: x,y = v z = imgdict.get(v,-1) if z < zmin or z > zmax: continue D[v] = Q[v] if can: if (random.randint(0,refreshtime) == 0): can.refresh() pass can.foregroundColor = can.fillColor = (0x00,(D[v]*10)%255,(D[v]*10)%255) can.drawPoint([a*zoom for a in v]) if v == end: break for dx,dy in dirlist: w = (x+dx, y+dy) z2 = imgdict.get(w) if z2 == None: continue else: dz = z2 - z #vwLength = D[v]+(dx**2 + dy**2)**0.5 vwLength = D[v] + (dx**2 + dy**2 + dz**2)**0.5 if w in D: if vwLength < D[w]: raise ValueError, "Dijkstra: found better path to already-final vertex" elif w not in Q or vwLength < Q[w]: Q[w] = vwLength P[w] = v if can: can.autoRefresh = True can.refresh() return (D,P) def shortestPath(imgdict,start,end,zmin=0,zmax=255,can=None,zoom=1): """ Find a single shortest path from the given start vertex to the given end vertex. The input has the same conventions as Dijkstra(). The output is a list of the vertices in order along the shortest path. sample graph: G = {'s':{'u':10, 'x':5}, 'u':{'v':1, 'x':2}, 'v':{'y':4}, 'x':{'u':3, 'v':9, 'y':2}, 'y':{'s':7, 'v':6}} """ D,P = Dijkstra(imgdict,start,end,zmin,zmax,can,zoom) if False and can: can.foregroundColor = can.fillColor = (0xFF,0x00,0x00) for vert in D: Path = [] while 1: Path.append(vert) if vert == start: break vert = P.get(vert, start) can.drawPointList(Path) Path = [] while 1: Path.append(end) if end == start: break end = P.get(end, start) Path.reverse() return Path --- NEW FILE: priodict.py --- # Priority dictionary using binary heaps # David Eppstein, UC Irvine, 8 Mar 2002 from __future__ import generators class priorityDictionary(dict): def __init__(self): '''Initialize priorityDictionary by creating binary heap of pairs (value,key). Note that changing or removing a dict entry will not remove the old pair from the heap until it is found by smallest() or until the heap is rebuilt.''' self.__heap = [] dict.__init__(self) def smallest(self): '''Find smallest item after removing deleted items from heap.''' if len(self) == 0: raise IndexError, "smallest of empty priorityDictionary" heap = self.__heap while heap[0][1] not in self or self[heap[0][1]] != heap[0][0]: lastItem = heap.pop() insertionPoint = 0 while 1: smallChild = 2*insertionPoint+1 if smallChild+1 < len(heap) and \ heap[smallChild] > heap[smallChild+1]: smallChild += 1 if smallChild >= len(heap) or lastItem <= heap[smallChild]: heap[insertionPoint] = lastItem break heap[insertionPoint] = heap[smallChild] insertionPoint = smallChild return heap[0][1] def __iter__(self): '''Create destructive sorted iterator of priorityDictionary.''' def iterfn(): while len(self) > 0: x = self.smallest() yield x del self[x] return iterfn() def __setitem__(self,key,val): '''Change value stored in dictionary and add corresponding pair to heap. Rebuilds the heap if the number of deleted items grows too large, to avoid memory leakage.''' dict.__setitem__(self,key,val) heap = self.__heap if len(heap) > 2 * len(self): self.__heap = [(v,k) for k,v in self.iteritems()] self.__heap.sort() # builtin sort likely faster than O(n) heapify else: newPair = (val,key) insertionPoint = len(heap) heap.append(None) while insertionPoint > 0 and \ newPair < heap[(insertionPoint-1)//2]: heap[insertionPoint] = heap[(insertionPoint-1)//2] insertionPoint = (insertionPoint-1)//2 heap[insertionPoint] = newPair def setdefault(self,key,val): '''Reimplement setdefault to call our customized __setitem__.''' if key not in self: self[key] = val return self[key] --- NEW FILE: dijkstra.py --- #!/usr/bin/python """ [ Dijkstra's shortest path demo ] A visual demonstration of shortest path algorithm. version: 0.42b date: 2006-7-25 author: Jure Vrscaj <ju...@co...> homepage: http://codeshift.net/dijkstra """ from PythonCard import configuration, dialog, model import time try: import shortpath as dijkstra except: print 'Dijkstra not found, shortest path will not work' dijkstra = None try: import psyco psyco.full() except: print 'Psyco not found, ignoring it' def t(f, *args): start = time.time() #r = eval(s, g) r = f(*args) print " t: %f ms" % ((time.time()-start) * 1000) return r class App(model.Background): imgdict = {} G = {} lastpath = {} scalex = 1 scaley = 1 scalez = 1 offsetx = 0 offsety = 0 offsetz = 0 zoom = 2 startpoint = None endpoint = None zmin = 0 zmax = 255 showplague = False def on_initialize(self, _event): can = self.components.canvas1 self.on_size(None) try: self.imp('map.xyz') self.draw() except: can.drawCircle((100, 100), 10) def status(self, text): print text self.title = text def shortpath(self, mod=dijkstra): can = self.components.canvas1 start = self.startpoint end = self.endpoint zoom = self.zoom print "searching for shortest path... start=%s, end=%s"%(start, end) self.lastpath = t(mod.shortestPath, self.imgdict, start, end, self.zmin, self.zmax, {True:can}.get(self.showplague, False), zoom) can.foregroundColor = can.fillColor = (0x00,0x00,0xFF) for xy in self.lastpath: can.drawCircle([a*zoom for a in xy], zoom/2+1) def draw(self): can = self.components.canvas1 can.clear() colorpoints = {} for point, z in self.imgdict.iteritems(): x,y = point x,y = int(x*self.zoom),int(y*self.zoom) try: colorpoints[z].append((x,y)) except: colorpoints[z] = [(x,y)] try: zoom = int(self.zoom) assert(zoom) except: zoom = 1 ar = can.autoRefresh can.autoRefresh = False for color, points in colorpoints.iteritems(): if color < self.zmin: can.foregroundColor = can.fillColor = (0,color,0) elif color > self.zmax: can.foregroundColor = can.fillColor = (0,color,0) else: can.foregroundColor = can.fillColor = (color,color,color) if zoom == 1: can.drawPointList(points) else: for x,y in points: can.drawRectangle( (x,y), (zoom,zoom) ) can.refresh() can.autoRefresh = ar def imp(self, filename): self.status('Importing %s ...'%filename) self.imgdict = {} f = open(filename) for line in f: try: x,y,z = [float(a) for a in line.split()] except Exception,e: print "ERR: Ignoring line", line, "could not be parsed:", e continue x += self.offsetx y += self.offsety z += self.offsetz x *= self.scalex y *= self.scaley z *= self.scalez x, y, z = int(x), int(y), int(z) self.imgdict[(x,y)] = z self.status('Imported %s points.'%len(self.imgdict)) def on_size(self, event): can = self.components.canvas1 size = self.GetClientSize() can.SetSize(size) try: event.skip() except: pass def on_canvas1_mouseMiddleDown(self, event): self.showplague = not self.showplague def on_canvas1_mouseContextDown(self, event): self.on_canvas1_mouseDown(event, mod=dijkstra_alt) def on_canvas1_mouseDown(self, event, mod=None): if not mod: mod = dijkstra can = event.target x, y = [int(a/self.zoom) for a in event.position] color = self.imgdict.get((x,y)) self.status('color at %s,%s: %s'%(x,y,color)) if self.endpoint or not self.startpoint: self.startpoint = (x,y) self.endpoint = None can.foregroundColor = can.fillColor = (0x0,0xFF,0x0) can.drawCircle((x*self.zoom, y*self.zoom), 2) else: self.endpoint = (x,y) can.foregroundColor = can.fillColor = (0x0,0xFF,0x0) can.drawCircle((x*self.zoom, y*self.zoom), 2) can.redraw() self.shortpath(mod) def on_menuFileImport_select(self, event): wildcard = "*.xyz|*.xyz|*.*|*.*" result = dialog.openFileDialog(wildcard=wildcard) paths = result.paths if not result.accepted: return for a in paths: self.imp(a) self.draw() def on_menuActionDraw_select(self, event): self.draw() if __name__ == '__main__': configuration.setOption('showShell', True) app = model.Application(App) app.MainLoop() --- NEW FILE: map.xyz --- 5 54 133 98 141 63 47 68 156 37 -9 123 17 113 97 169 78 86 118 123 172 178 132 102 141 16 30 23 44 142 89 -15 70 168 1 17 117 34 76 64 82 153 140 95 85 73 132 146 36 24 115 22 95 37 62 -26 133 [...32841 lines suppressed...] 116.0 96.0 146.0 153.0 26.0 36.0 102.0 23.0 99.0 139.0 27.0 48.0 21.0 19.0 119.0 44.0 148.0 103.0 7.0 32.0 119.0 161.0 149.0 68.0 128.0 -8.0 12.0 91.0 -20.0 94.0 92.0 136.0 132.0 115.0 89.0 147.0 78.0 79.0 184.0 48.0 46.0 123.0 157.0 139.0 95.0 82.0 -2.0 7.0 6.0 107.0 77.0 172.0 135.0 48.0 91.0 113.0 150.0 77.0 62.0 153.0 --- NEW FILE: dijkstra.rsrc.py --- {'application':{'type':'Application', 'name':'Template', 'backgrounds': [ {'type':'Background', 'name':'background', 'title':u'shortest path', 'size':(389, 350), 'style':['resizeable'], 'menubar': {'type':'MenuBar', 'menus': [ {'type':'Menu', 'name':'menuFile', 'label':'&File', 'items': [ {'type':'MenuItem', 'name':'menuFileImport', 'label':u'&Import', }, {'type':'MenuItem', 'name':'menuFileExit', 'label':'E&xit', 'command':'exit', }, ] }, {'type':'Menu', 'name':'menuAction', 'label':u'&Action', 'items': [ {'type':'MenuItem', 'name':'menuActionDraw', 'label':u'Draw', }, ] }, {'type':'Menu', 'name':'menu', 'label':u'', 'items': [ ] }, ] }, 'components': [ {'type':'BitmapCanvas', 'name':'canvas1', 'position':(0, 0), 'size':(180, 146), 'backgroundColor':(255, 255, 255), 'foregroundColor':(0, 0, 0), }, ] # end components } # end background ] # end backgrounds } } --- NEW FILE: readme.txt --- Dijkstra's Shortest Path Algorithm Demo by Jure Vrscaj Click anywhere on the map to set the starting point and another click to set the end point, after that you should see a blue line connecting the two points. If you want to see how dijkstra does the trick, use the shell window and type: >>> self.showplague = True http://codeshift.net/dijkstra |
From: Kevin A. <ka...@us...> - 2006-07-30 01:05:51
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12898 Modified Files: LICENSE.txt Log Message: moved Alex up in list and added more people and samples Index: LICENSE.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/LICENSE.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LICENSE.txt 27 Dec 2005 04:19:51 -0000 1.6 --- LICENSE.txt 30 Jul 2006 01:05:49 -0000 1.7 *************** *** 1,3 **** ! Copyright (c) 2001-2005 PythonCard developers All rights reserved. --- 1,3 ---- ! Copyright (c) 2001-2006 PythonCard developers All rights reserved. *************** *** 18,21 **** --- 18,23 ---- The PythonCard developers and contributors are; Kevin Altis - developer, project lead, <al...@se...> + Alex Tweedly - developer, tools, documentation <al...@tw...> + helpfulWrappers and sudoku samples Rowland Smith - developer Patrick K O'Brien - developer, PyCrust, <po...@or...> *************** *** 23,30 **** Robin Dunn - developer, wxPython, <ro...@al...> Andy Todd - developer, dbBrowser sample, gadflyDatabase.py, documentation, <an...@ha...> - Alex Tweedly - developer, codeEditor & resourceEditor additions, documentation Arlo Belshee - developer, lsystem sample Kim Wallmark - developer, lsystem sample ! Phil Edwards - developer, documentation, pysshed sample, Linux RPMs, <ph...@li...> Dan Winkler - developer, textIndexer sample, co-Godfather ;-) Kenneth Pronovici - Debian builds --- 25,32 ---- Robin Dunn - developer, wxPython, <ro...@al...> Andy Todd - developer, dbBrowser sample, gadflyDatabase.py, documentation, <an...@ha...> Arlo Belshee - developer, lsystem sample Kim Wallmark - developer, lsystem sample ! Phil Edwards - developer, documentation, Linux RPMs, <ph...@li...> ! standaloneBuilder tool, pysshed and sysTray samples Dan Winkler - developer, textIndexer sample, co-Godfather ;-) Kenneth Pronovici - Debian builds *************** *** 47,48 **** --- 49,52 ---- Stephen Waterbury - twistedEchoClient sample Ward Cunningham - lsystem sample + Raymond Hettinger - iacGrid sample + Jure Vrscaj - dijkstra sample |
From: Kevin A. <ka...@us...> - 2006-07-30 01:05:51
|
Update of /cvsroot/pythoncard/PythonCard/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12898/docs Modified Files: changelog.txt Log Message: moved Alex up in list and added more people and samples Index: changelog.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/changelog.txt,v retrieving revision 1.329 retrieving revision 1.330 diff -C2 -d -r1.329 -r1.330 *** changelog.txt 28 Jul 2006 15:38:21 -0000 1.329 --- changelog.txt 30 Jul 2006 01:05:49 -0000 1.330 *************** *** 8,13 **** ! Release 0.8.3 2006-06-?? ! added iacGrid sample updated changelog.txt url --- 8,18 ---- ! Release 0.8.3 2006-08-?? ! added dijkstra sample ! Dijkstra 's Shortest Path Algorithm Demo by Jure Vrscaj ! added iacGrid sample ! Data Mining with Neural Nets using an ! interactive-competition-and-activation model to analyze a database ! by Raymond Hettinger and Kevin Altis updated changelog.txt url |
From: Kevin A. <ka...@us...> - 2006-07-30 00:46:13
|
Update of /cvsroot/pythoncard/PythonCard/samples/dijkstra In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6098/dijkstra Log Message: Directory /cvsroot/pythoncard/PythonCard/samples/dijkstra added to the repository |
From: Kevin A. <ka...@us...> - 2006-07-29 13:26:59
|
Update of /cvsroot/pythoncard/PythonCard/samples/iacGrid In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25077 Modified Files: iacGrid.py Log Message: turned off cell editing and added dynamic grid expansion these don't seem to be causing a crash, so the earlier problem might have been the ansi version of wxPython renamed the main class to IacGrid removed self.log and some extra comments Index: iacGrid.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/iacGrid/iacGrid.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** iacGrid.py 28 Jul 2006 22:05:38 -0000 1.6 --- iacGrid.py 29 Jul 2006 13:25:42 -0000 1.7 *************** *** 20,37 **** ! class Minimal(model.Background): def on_initialize(self, event): - self.log = sys.stdout - self.mygrid = mygrid = self.components.mygrid # KEA 2006-07-28 - # until we figure out dynamic resizing of the grid - # we could set the initial grid to a reasonably large - # value for in memory tests # to support very large arbitrary size data sets will # require the use of a wx.GridTableBase ! mygrid.CreateGrid(30, 6) self.populate_cells_from_file() --- 20,36 ---- ! class IacGrid(model.Background): def on_initialize(self, event): self.mygrid = mygrid = self.components.mygrid + self.rowcnt = 0 + self.colcnt = 0 # KEA 2006-07-28 # to support very large arbitrary size data sets will # require the use of a wx.GridTableBase ! mygrid.CreateGrid(5, 5) ! ! mygrid.EnableEditing(False) self.populate_cells_from_file() *************** *** 46,57 **** self.panel.Layout() - # KEA 2006-07-27 - # apparently there is a bug, probably a race condition when the control - # is first created in wxWidgets on the Mac which requires that this call - # be done late rather than immediately after the grid creation - # on Windows, even this caused a crash, so commenting it out until - # I can figure out the problem - ## mygrid.EnableEditing(False) - def populate_cells_from_file(self, filename='jets.txt'): --- 45,48 ---- *************** *** 60,76 **** for row, line in enumerate(open(filename)): fields = line.rstrip().split() ! # KEA 2006-07-28 ! # in order to dynamically size the grid ! # according to the docs it looks like we would use AppendRows ! # and AppendCols but this also appears to cause a crash ! ## if row >= mygrid.GetNumberRows(): ! ## print "adding row" ! ## mygrid.AppendRows() for col, value in enumerate(fields): print row, col, value mygrid.SetCellValue(row, col, value) self.rowcnt = row + 1 self.colcnt = col + 1 ! print self.rowcnt, self.colcnt --- 51,66 ---- for row, line in enumerate(open(filename)): fields = line.rstrip().split() ! if row == mygrid.GetNumberRows(): ! print "adding row", row ! mygrid.AppendRows() for col, value in enumerate(fields): + if col == mygrid.GetNumberCols(): + print "adding column", col + mygrid.AppendCols() print row, col, value mygrid.SetCellValue(row, col, value) self.rowcnt = row + 1 self.colcnt = col + 1 ! print "self.rowcnt: %d, self.colcnt: %d" % (self.rowcnt, self.colcnt) *************** *** 111,117 **** def on_mygrid_rangeSelect(self, event): if event.Selecting(): - self.log.write("rangeSelect: top-left %s, bottom-right %s\n" % - (event.GetTopLeftCoords(), event.GetBottomRightCoords())) - result = [] for row, col in self.getSelectedCells(): --- 101,104 ---- *************** *** 126,131 **** def on_mygrid_selectCell(self, event): - self.log.write("selectCell: (%d,%d) %s\n" % - (event.row, event.column, event.position)) if event.Selecting(): result = [self.mygrid.GetCellValue(event.row, event.column)] --- 113,116 ---- *************** *** 150,153 **** if __name__ == '__main__': ! app = model.Application(Minimal) app.MainLoop() --- 135,138 ---- if __name__ == '__main__': ! app = model.Application(IacGrid) app.MainLoop() |
From: Kevin A. <ka...@us...> - 2006-07-28 22:05:46
|
Update of /cvsroot/pythoncard/PythonCard/samples/iacGrid In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27476 Modified Files: iacGrid.py Log Message: added selectCell and hopefully fixed both events to handle all cases Index: iacGrid.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/iacGrid/iacGrid.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** iacGrid.py 28 Jul 2006 21:23:40 -0000 1.5 --- iacGrid.py 28 Jul 2006 22:05:38 -0000 1.6 *************** *** 7,12 **** import sys ! import wx ! from wx import grid from PythonCard import dialog, model --- 7,11 ---- import sys ! import wx # used for sizer constants from PythonCard import dialog, model *************** *** 25,29 **** def on_initialize(self, event): self.log = sys.stdout - self.moveTo = None self.mygrid = mygrid = self.components.mygrid --- 24,27 ---- *************** *** 77,90 **** - """ - KEA 2006-07-28 - in order to support discontinuous selections it appears - we need to check the grid for which cells are actually - selected on selectCell and rangeSelect and/or keep - an updated dictionary of cells after each selection is - made. GetSelectedCells() appears to only return an empty - list, which is probably another bug - """ - def getSelectedCells(self): if self.mygrid.IsSelection(): --- 75,78 ---- *************** *** 92,114 **** sel = [] - """ - # KEA 2006-07-28 - # probably a much more efficient way of building - # this list so that we only return a list of - # unique cells in the selection - for c in mygrid.GetSelectedCols(): - for r in range(mygrid.GetNumberRows()): - if (r, c) not in sel: - sel.append((r, c)) - for r in mygrid.GetSelectedRows(): - for c in range(mygrid.GetNumberCols()): - if (r, c) not in sel: - sel.append((r, c)) - for rc in mygrid.GetSelectedCells(): - if rc not in sel: - sel.append(rc) - # deal with GetSelectionBlockTopLeft, GetSelectionBlockBottomRight here - """ - # brute force solution # possibly even easier to reduce to a single statement --- 80,83 ---- *************** *** 117,129 **** if mygrid.IsInSelection(row, col): sel.append((row, col)) return sel else: return [] ! def updateDisplay(self): ! result = [] ! for row, col in self.getSelectedCells(): ! result.append(self.mygrid.GetCellValue(row, col)) ! iac.reset() print 'Touching', ' '.join(result) --- 86,95 ---- if mygrid.IsInSelection(row, col): sel.append((row, col)) + print "Current Selection:", sel return sel else: return [] ! def updateDisplay(self, result): iac.reset() print 'Touching', ' '.join(result) *************** *** 148,153 **** (event.GetTopLeftCoords(), event.GetBottomRightCoords())) ! self.updateDisplay() ! event.skip() --- 114,126 ---- (event.GetTopLeftCoords(), event.GetBottomRightCoords())) ! result = [] ! for row, col in self.getSelectedCells(): ! result.append(self.mygrid.GetCellValue(row, col)) ! print "rangeSelect result:", result ! self.updateDisplay(result) ! else: ! # just for debugging, else clause can go away later ! print "NOT SELECTING in rangeSelect", event.GetTopLeftCoords(), event.GetBottomRightCoords() ! #event.skip() *************** *** 155,161 **** self.log.write("selectCell: (%d,%d) %s\n" % (event.row, event.column, event.position)) ! ! self.updateDisplay() ! event.skip() --- 128,139 ---- self.log.write("selectCell: (%d,%d) %s\n" % (event.row, event.column, event.position)) ! if event.Selecting(): ! result = [self.mygrid.GetCellValue(event.row, event.column)] ! print "selectCell result:", result ! self.updateDisplay(result) ! else: ! # just for debugging, else clause can go away later ! print "NOT SELECTING in selectCell", event.row, event.column, event.position ! #event.skip() |
From: Kevin A. <ka...@us...> - 2006-07-28 21:25:58
|
Update of /cvsroot/pythoncard/PythonCard/samples/iacGrid In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11706 Modified Files: iacGrid.py iacGrid.rsrc.py Log Message: added getSelectedCells method and factored out display update code to updateDisplay method so both rangeSelect and selectCell could call it Index: iacGrid.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/iacGrid/iacGrid.rsrc.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** iacGrid.rsrc.py 28 Jul 2006 15:37:29 -0000 1.2 --- iacGrid.rsrc.py 28 Jul 2006 21:23:40 -0000 1.3 *************** *** 1,5 **** { 'application':{ 'type':'Application', ! 'name':'SimpleGrid', 'backgrounds': --- 1,5 ---- { 'application':{ 'type':'Application', ! 'name':'IACGrid', 'backgrounds': *************** *** 7,11 **** { 'type':'Background', 'name':'bgMin', ! 'title':'Simple Grid PythonCard Application', 'size':( 600, 400 ), 'style':['resizeable'], --- 7,11 ---- { 'type':'Background', 'name':'bgMin', ! 'title':'IAC Grid', 'size':( 600, 400 ), 'style':['resizeable'], Index: iacGrid.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/iacGrid/iacGrid.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** iacGrid.py 28 Jul 2006 16:22:30 -0000 1.4 --- iacGrid.py 28 Jul 2006 21:23:40 -0000 1.5 *************** *** 87,108 **** """ ! def on_mygrid_rangeSelect(self, event): ! if event.Selecting(): ! self.log.write("rangeSelect: top-left %s, bottom-right %s\n" % ! (event.GetTopLeftCoords(), event.GetBottomRightCoords())) ! tl = r1, c1 = event.GetTopLeftCoords() ! br = r2, c2 = event.GetBottomRightCoords() result = [] ! if r1 == r2: ! for col in range(c1, c2+1): ! result.append(self.mygrid.GetCellValue(r1, col)) ! elif c1 == c2: ! for row in range(r1, r2+1): ! result.append(self.mygrid.GetCellValue(row, c1)) ! else: ! for row in range(r1, r2+1): ! for col in range(c1, c2+1): ! result.append(self.mygrid.GetCellValue(row, col)) iac.reset() print 'Touching', ' '.join(result) --- 87,129 ---- """ ! def getSelectedCells(self): ! if self.mygrid.IsSelection(): ! mygrid = self.mygrid ! sel = [] ! ! """ ! # KEA 2006-07-28 ! # probably a much more efficient way of building ! # this list so that we only return a list of ! # unique cells in the selection ! for c in mygrid.GetSelectedCols(): ! for r in range(mygrid.GetNumberRows()): ! if (r, c) not in sel: ! sel.append((r, c)) ! for r in mygrid.GetSelectedRows(): ! for c in range(mygrid.GetNumberCols()): ! if (r, c) not in sel: ! sel.append((r, c)) ! for rc in mygrid.GetSelectedCells(): ! if rc not in sel: ! sel.append(rc) ! # deal with GetSelectionBlockTopLeft, GetSelectionBlockBottomRight here ! """ ! ! # brute force solution ! # possibly even easier to reduce to a single statement ! for row in xrange(mygrid.GetNumberRows()): ! for col in xrange(mygrid.GetNumberCols()): ! if mygrid.IsInSelection(row, col): ! sel.append((row, col)) ! return sel ! else: ! return [] ! def updateDisplay(self): result = [] ! for row, col in self.getSelectedCells(): ! result.append(self.mygrid.GetCellValue(row, col)) ! iac.reset() print 'Touching', ' '.join(result) *************** *** 118,125 **** mygrid.SetCellBackgroundColour(r, c, color) ! # force refresh mygrid.Refresh() mygrid.Update() event.skip() --- 139,152 ---- mygrid.SetCellBackgroundColour(r, c, color) ! # force refresh, may not be necessary depending on platform mygrid.Refresh() mygrid.Update() + def on_mygrid_rangeSelect(self, event): + if event.Selecting(): + self.log.write("rangeSelect: top-left %s, bottom-right %s\n" % + (event.GetTopLeftCoords(), event.GetBottomRightCoords())) + + self.updateDisplay() event.skip() *************** *** 129,142 **** (event.row, event.column, event.position)) ! # Another way to stay in a cell that has a bad value... ! mygrid = self.components.mygrid ! row = mygrid.GetGridCursorRow() ! col = mygrid.GetGridCursorCol() ! if mygrid.IsCellEditControlEnabled(): ! mygrid.HideCellEditControl() ! mygrid.DisableCellEditControl() ! value = mygrid.GetCellValue(row, col) ! if value == 'no good 2': ! return # cancels the cell selection event.skip() --- 156,160 ---- (event.row, event.column, event.position)) ! self.updateDisplay() event.skip() |