]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/samples/ide/activegrid/util/__init__.py
fixed assert when dumping a string which is locked for writing
[wxWidgets.git] / wxPython / samples / ide / activegrid / util / __init__.py
index edcfb1ca9511aaf499d04f4a203dc6ddafde0196..943607976fb1a401a2da1d7d0c737edc4c0e6436 100644 (file)
@@ -14,15 +14,35 @@ import traceback
 import sys
 import os
 
-def _registerMainModuleDir():
-    global mainModuleDir
+def isWindows():
+    return os.name == 'nt'
+
+def _generateMainModuleDir():
     if sys.executable.find('python') != -1:
         utilModuleDir = os.path.dirname(__file__)
         if not os.path.isabs(utilModuleDir):
             utilModuleDir = os.path.join(os.getcwd(), utilModuleDir)
         mainModuleDir = os.path.normpath(os.path.join(utilModuleDir, os.path.join(os.path.pardir, os.path.pardir)))
+        if mainModuleDir.endswith('.zip'):
+            mainModuleDir = os.path.dirname(mainModuleDir) # Get rid of library.zip
     else:
         mainModuleDir = os.path.dirname(sys.executable)
+    return mainModuleDir
+
+mainModuleDir = _generateMainModuleDir()
+
+
+def _generatePythonExecPath():
+    if sys.executable.find('python') != -1:
+        pythonExecPath = sys.executable
+    else:
+        pythonExecPath = os.path.join(os.path.dirname(sys.executable), '3rdparty\python2.3\python')
+    return pythonExecPath
+
+pythonExecPath = _generatePythonExecPath()
 
-_registerMainModuleDir()
+def getCommandNameForExecPath(execPath):
+    if isWindows():
+        return '"%s"' % execPath
+    return execPath