From: Robin Dunn Date: Thu, 8 Aug 2002 20:14:13 +0000 (+0000) Subject: Make batch files for the tool scripts, and other related changes for X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/bd4b9c8c54a9befa699cf9d410c4c5010544b030 Make batch files for the tool scripts, and other related changes for win32. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16422 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/CHANGES.txt b/wxPython/CHANGES.txt index 579493668d..bb5c94c72a 100644 --- a/wxPython/CHANGES.txt +++ b/wxPython/CHANGES.txt @@ -139,7 +139,7 @@ other menu stuff. Added wxIEHtmlWin. This is essentially the same as using IE with the ActiveXWrapper already in the library, but it is implemented all in -C++ and therefore does not need any of the modules from win32 all and +C++ and therefore does not need any of the modules from win32all and so it is less fragile in the face of changes. Fixed the ActiveXWrapper problem. Looks like when the win32com @@ -156,7 +156,9 @@ Changed the wxDateTime.Parse* methods to return an int that will be -1 on failure, and the index where parsing stopped otherwise. Moved tools to be a Python package in wxPython.tools, added scripts to -import and launch each tool. +import and launch each tool. This will let you import and use the +tools in your own scripts or apps as needed. + diff --git a/wxPython/demo/encode_bitmaps.py b/wxPython/demo/encode_bitmaps.py index 702a630d23..8abc04575e 100644 --- a/wxPython/demo/encode_bitmaps.py +++ b/wxPython/demo/encode_bitmaps.py @@ -7,9 +7,7 @@ files... """ import sys, string -sys.path.insert(0, "../tools") - -import img2py +from wxPython.tools import img2py command_lines = [ diff --git a/wxPython/distrib/make_installer.py b/wxPython/distrib/make_installer.py index b7ed38f9a0..23418db29a 100644 --- a/wxPython/distrib/make_installer.py +++ b/wxPython/distrib/make_installer.py @@ -145,7 +145,12 @@ Source: "wxPython\tools\XRCed\*.xrc"; DestDir: "{app}\wxPython\tools\XRCed Source: "wxPython\tools\XRCed\*.ico"; DestDir: "{app}\wxPython\tools\XRCed"; Components: tools Source: "wxPython\tools\XRCed\*.sh"; DestDir: "{app}\wxPython\tools\XRCed"; Components: tools -;; Where to put the scripts on Win32??? +Source: "scripts\*.bat"; DestDir: "{code:GetPythonDir}\Scripts"; Components: tools +Source: "scripts\*.py"; DestDir: "{code:GetPythonDir}\Scripts"; Components: tools +Source: "scripts\img2png"; DestDir: "{code:GetPythonDir}\Scripts"; Components: tools +Source: "scripts\img2py"; DestDir: "{code:GetPythonDir}\Scripts"; Components: tools +Source: "scripts\img2xpm"; DestDir: "{code:GetPythonDir}\Scripts"; Components: tools +Source: "scripts\xrced"; DestDir: "{code:GetPythonDir}\Scripts"; Components: tools Source: "samples\doodle\*.py"; DestDir: "{app}\wxPython\samples\doodle"; Components: samples Source: "samples\doodle\*.txt"; DestDir: "{app}\wxPython\samples\doodle"; Components: samples @@ -178,6 +183,13 @@ Source: "samples\embedded\*.unx"; DestDir: "{app}\wxPython\samples\embe Source: "samples\embedded\*.ico"; DestDir: "{app}\wxPython\samples\embedded"; Components: samples Source: "samples\embedded\*.xpm"; DestDir: "{app}\wxPython\samples\embedded"; Components: samples +;;------------------------------------------------------------ + +[Run] +;; Recreate the tool scripts to use the paths on the users machine +Filename: "{code:GetPythonDir}\python.exe"; Parameters: "CreateBatchFiles.py"; WorkingDir: "{code:GetPythonDir}\Scripts"; Components: tools + + ;;------------------------------------------------------------ [Icons] @@ -206,6 +218,10 @@ Type: files; Name: "{app}\wxPython\lib\mixins\*.pyc"; Type: files; Name: "{app}\wxPython\lib\mixins\*.pyo"; Type: files; Name: "{app}\wxPython\lib\PyCrust\*.pyc"; Type: files; Name: "{app}\wxPython\lib\PyCrust\*.pyo"; +Type: files; Name: "{app}\wxPython\tools\*.pyc"; +Type: files; Name: "{app}\wxPython\tools\*.pyo"; +Type: files; Name: "{app}\wxPython\tools\XRCed\*.pyc"; +Type: files; Name: "{app}\wxPython\tools\XRCed\*.pyo"; Type: files; Name: "{app}\wxPython\demo\*.pyc"; Type: files; Name: "{app}\wxPython\demo\*.pyo"; Type: files; Name: "{app}\wxPython\demo\data\showTips"; diff --git a/wxPython/scripts/CreateBatchFiles.py b/wxPython/scripts/CreateBatchFiles.py new file mode 100644 index 0000000000..4427ce4c61 --- /dev/null +++ b/wxPython/scripts/CreateBatchFiles.py @@ -0,0 +1,36 @@ +#---------------------------------------------------------------------- +# Name: CreateBatchFiles.py +# Purpose: Run by the InnoSetup installer to create a DOS batch +# file for each of the wxPython tool scripts. +# +# Author: Robin Dunn +# +# Created: 8-Aug-2002 +# Copyright: (c) 2002 by Total Control Software +# Licence: wxWindows license +#---------------------------------------------------------------------- + +import sys, os + +python = sys.executable +scriptdir = os.getcwd() + +scripts = [ "img2png", + "img2py", + "img2xpm", + "xrced", + ] + +template = """\ +@echo off +%(python)s %(scriptdir)s\\%(script)s %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 %%9 +""" + +for script in scripts: + batfile = os.path.join(scriptdir, script + '.bat') + print "Creating", batfile + f = open(batfile, 'w') + f.write(template % vars()) + f.close() + + diff --git a/wxPython/scripts/img2png.bat b/wxPython/scripts/img2png.bat new file mode 100755 index 0000000000..76c0311539 --- /dev/null +++ b/wxPython/scripts/img2png.bat @@ -0,0 +1,2 @@ +@echo off +C:\TOOLS\PYTHON22\PYTHON.EXE C:\projects\wx\wxPython\scripts\img2png %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/wxPython/scripts/img2py.bat b/wxPython/scripts/img2py.bat new file mode 100755 index 0000000000..f1f402483c --- /dev/null +++ b/wxPython/scripts/img2py.bat @@ -0,0 +1,2 @@ +@echo off +C:\TOOLS\PYTHON22\PYTHON.EXE C:\projects\wx\wxPython\scripts\img2py %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/wxPython/scripts/img2xpm.bat b/wxPython/scripts/img2xpm.bat new file mode 100755 index 0000000000..5fe28d9794 --- /dev/null +++ b/wxPython/scripts/img2xpm.bat @@ -0,0 +1,2 @@ +@echo off +C:\TOOLS\PYTHON22\PYTHON.EXE C:\projects\wx\wxPython\scripts\img2xpm %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/wxPython/scripts/xrced.bat b/wxPython/scripts/xrced.bat new file mode 100755 index 0000000000..4f80e8a937 --- /dev/null +++ b/wxPython/scripts/xrced.bat @@ -0,0 +1,2 @@ +@echo off +C:\TOOLS\PYTHON22\PYTHON.EXE C:\projects\wx\wxPython\scripts\xrced %1 %2 %3 %4 %5 %6 %7 %8 %9