]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/ide/activegrid/util/__init__.py
1 #----------------------------------------------------------------------------
9 # Copyright: (c) 2004-2005 ActiveGrid, Inc.
10 # License: wxWindows License
11 #----------------------------------------------------------------------------
18 return os
.name
== 'nt'
20 def _generateMainModuleDir():
21 if sys
.executable
.find('python') != -1:
22 utilModuleDir
= os
.path
.dirname(__file__
)
23 if not os
.path
.isabs(utilModuleDir
):
24 utilModuleDir
= os
.path
.join(os
.getcwd(), utilModuleDir
)
25 mainModuleDir
= os
.path
.normpath(os
.path
.join(utilModuleDir
, os
.path
.join(os
.path
.pardir
, os
.path
.pardir
)))
26 if mainModuleDir
.endswith('.zip'):
27 mainModuleDir
= os
.path
.dirname(mainModuleDir
) # Get rid of library.zip
29 mainModuleDir
= os
.path
.dirname(sys
.executable
)
32 mainModuleDir
= _generateMainModuleDir()
35 def _generatePythonExecPath():
36 if sys
.executable
.find('python') != -1:
37 pythonExecPath
= sys
.executable
39 pythonExecPath
= os
.path
.join(os
.path
.dirname(sys
.executable
), '3rdparty\python2.3\python')
42 pythonExecPath
= _generatePythonExecPath()
44 def getCommandNameForExecPath(execPath
):
46 return '"%s"' % execPath