comparison Mac/scripts/ConfigurePython.py @ 10040:3ad2b2e31f53 legacy-trunk

Fixed two typo's (Plugins -> PlugIns) and added some explicit path munging to allow the script to also work from the Scripts folder. Somehow either of these fixes solved a problem where it suddenly refused to make a PythonCore alias in the Extensions folder. -- jvr
author Just van Rossum <just@lettererror.com>
date Sat, 30 Jan 1999 17:46:34 +0000
parents 124ef694c284
children 32652f6996e3
comparison
equal deleted inserted replaced
10039:6dff7696e358 10040:3ad2b2e31f53
87 87
88 def gotopluginfolder(): 88 def gotopluginfolder():
89 """Go to the plugin folder, assuming we are somewhere in the Python tree""" 89 """Go to the plugin folder, assuming we are somewhere in the Python tree"""
90 import os 90 import os
91 91
92 while not os.path.isdir(":Mac:Plugins"): 92 while not os.path.isdir(":Mac:PlugIns"):
93 os.chdir("::") 93 os.chdir("::")
94 os.chdir(":Mac:Plugins") 94 os.chdir(":Mac:PlugIns")
95 if verbose: print "current directory is", os.getcwd() 95 if verbose: print "current directory is", os.getcwd()
96 96
97 def loadtoolboxmodules(): 97 def loadtoolboxmodules():
98 """Attempt to load the Res module""" 98 """Attempt to load the Res module"""
99 try: 99 try:
144 def mkcorealias(src, altsrc): 144 def mkcorealias(src, altsrc):
145 import string 145 import string
146 import macostools 146 import macostools
147 version = string.split(sys.version)[0] 147 version = string.split(sys.version)[0]
148 dst = getextensiondirfile(src+ ' ' + version) 148 dst = getextensiondirfile(src+ ' ' + version)
149 if not os.path.exists(src): 149 if not os.path.exists(os.path.join(sys.exec_prefix, src)):
150 if not os.path.exists(altsrc): 150 if not os.path.exists(os.path.join(sys.exec_prefix, altsrc)):
151 if verbose: print '*', src, 'not found' 151 if verbose: print '*', src, 'not found'
152 return 0 152 return 0
153 src = altsrc 153 src = altsrc
154 try: 154 try:
155 os.unlink(dst) 155 os.unlink(dst)
156 except os.error: 156 except os.error:
157 pass 157 pass
158 macostools.mkalias(src, dst) 158 macostools.mkalias(os.path.join(sys.exec_prefix, src), dst)
159 if verbose: print ' ', dst, '->', src 159 if verbose: print ' ', dst, '->', src
160 return 1 160 return 1
161 161
162 162
163 def main(): 163 def main():