]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/scripts/CreateMacSripts.py
1 #----------------------------------------------------------------------
2 # Name: CreateMacScriptspy
3 # Purpose: Massages the scripts to be usable with MachoPython
8 # Copyright: (c) 2002 by Total Control Software
9 # Licence: wxWindows license
10 #----------------------------------------------------------------------
14 python
= sys
.executable
15 destdir
= os
.path
.split(python
)[0]
16 pythonw
= os
.path
.join(destdir
, 'pythonw')
17 scriptdir
= os
.getcwd()
19 from CreateBatchFiles
import scripts
20 repltxt
= "#!/usr/bin/env python"
24 exec /Applications/Python.app/Contents/MacOS/python %s.py
28 for script
, usegui
in scripts
:
29 destfile
= os
.path
.join(destdir
, script
)
30 print "Creating", destfile
31 thescript
= open(script
).read()
33 f
= open(destfile
+'.py', 'w')
34 f
.write(thescript
.replace(repltxt
, ''))
36 f
= open(destfile
, 'w')
37 f
.write(gui_template
% destfile
)
41 thescript
= thescript
.replace(repltxt
, '#!'+python
)
42 f
= open(destfile
, 'w')
46 os
.chmod(destfile
, 0755)
49 if __name__
== '__main__':