comparison Mac/Tools/IDE/PythonIDE.py @ 26269:6b556c545ffb legacy-trunk

Another workaround, to find the IDE directory when we're in MacPython-OSX on Jaguar. Ceteram censeam W era packagendam esse.
author Jack Jansen <jack.jansen@cwi.nl>
date Mon, 18 Nov 2002 15:29:02 +0000
parents 4c4f92b0af90
children 5d4d4ebfd317
comparison
equal deleted inserted replaced
26268:83ccaaab3e5e 26269:6b556c545ffb
18 import macresource 18 import macresource
19 import sys, os 19 import sys, os
20 macresource.need('DITL', 468, "PythonIDE.rsrc") 20 macresource.need('DITL', 468, "PythonIDE.rsrc")
21 widgetrespathsegs = [sys.exec_prefix, "Mac", "Tools", "IDE", "Widgets.rsrc"] 21 widgetrespathsegs = [sys.exec_prefix, "Mac", "Tools", "IDE", "Widgets.rsrc"]
22 widgetresfile = os.path.join(*widgetrespathsegs) 22 widgetresfile = os.path.join(*widgetrespathsegs)
23 if not os.path.exists(widgetresfile):
24 widgetrespathsegs = [os.pardir, "Tools", "IDE", "Widgets.rsrc"]
25 widgetresfile = os.path.join(*widgetrespathsegs)
23 refno = macresource.need('CURS', 468, widgetresfile) 26 refno = macresource.need('CURS', 468, widgetresfile)
24 if os.environ.has_key('PYTHONIDEPATH'): 27 if os.environ.has_key('PYTHONIDEPATH'):
25 # For development set this environment variable 28 # For development set this environment variable
26 ide_path = os.environ['PYTHONIDEPATH'] 29 ide_path = os.environ['PYTHONIDEPATH']
27 elif refno: 30 elif refno:
28 # We're not a fullblown application 31 # We're not a fullblown application
29 idepathsegs = [sys.exec_prefix, "Mac", "Tools", "IDE"] 32 idepathsegs = [sys.exec_prefix, "Mac", "Tools", "IDE"]
30 ide_path = os.path.join(*idepathsegs) 33 ide_path = os.path.join(*idepathsegs)
34 if not os.path.exists(ide_path):
35 idepathsegs = [os.pardir, "Tools", "IDE"]
36 for p in sys.path:
37 ide_path = os.path.join(*([p]+idepathsegs))
38 if os.path.exists(ide_path):
39 break
40
31 else: 41 else:
32 # We are a fully frozen application 42 # We are a fully frozen application
33 ide_path = sys.argv[0] 43 ide_path = sys.argv[0]
34 if ide_path not in sys.path: 44 if ide_path not in sys.path:
35 sys.path.insert(0, ide_path) 45 sys.path.insert(0, ide_path)