]> git.saurik.com Git - wxWidgets.git/commitdiff
Make batch files for the tool scripts, and other related changes for
authorRobin Dunn <robin@alldunn.com>
Thu, 8 Aug 2002 20:14:13 +0000 (20:14 +0000)
committerRobin Dunn <robin@alldunn.com>
Thu, 8 Aug 2002 20:14:13 +0000 (20:14 +0000)
win32.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16422 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/CHANGES.txt
wxPython/demo/encode_bitmaps.py
wxPython/distrib/make_installer.py
wxPython/scripts/CreateBatchFiles.py [new file with mode: 0644]
wxPython/scripts/img2png.bat [new file with mode: 0755]
wxPython/scripts/img2py.bat [new file with mode: 0755]
wxPython/scripts/img2xpm.bat [new file with mode: 0755]
wxPython/scripts/xrced.bat [new file with mode: 0755]

index 579493668d3caa3ef0118e1eeb7b0edf26dc3adb..bb5c94c72a7494ef7ad35e550128da13a57b974b 100644 (file)
@@ -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.
+
 
 
 
index 702a630d232445a6727cc0c166b0bfb1b521b6a3..8abc04575e3d31c6c00eb3a9b5238e3e89262235 100644 (file)
@@ -7,9 +7,7 @@ files...
 """
 
 import sys, string
-sys.path.insert(0, "../tools")
-
-import img2py
+from wxPython.tools import img2py
 
 
 command_lines = [
index b7ed38f9a09b58bf49ed824341d29eab9bf9b59c..23418db29aa29f3afc1a6f14cd9e91bc6ef54f24 100644 (file)
@@ -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 (file)
index 0000000..4427ce4
--- /dev/null
@@ -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 (executable)
index 0000000..76c0311
--- /dev/null
@@ -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 (executable)
index 0000000..f1f4024
--- /dev/null
@@ -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 (executable)
index 0000000..5fe28d9
--- /dev/null
@@ -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 (executable)
index 0000000..4f80e8a
--- /dev/null
@@ -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