Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d09deac

Browse files
committed
Also put aliases to PythonCore{PPC,CFM68K} in the extensions folder
1 parent 2d359bf commit d09deac

1 file changed

Lines changed: 35 additions & 1 deletion

File tree

Mac/scripts/ConfigurePython.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,31 @@ def loadtoolboxmodules():
120120
print "load from toolboxmodules.ppc.slb:", err3
121121
sys.exit(1)
122122

123-
123+
def getextensiondirfile(fname):
124+
import macfs
125+
import MACFS
126+
vrefnum, dirid = macfs.FindFolder(MACFS.kOnSystemDisk, MACFS.kExtensionFolderType, 0)
127+
fss = macfs.FSSpec((vrefnum, dirid, fname))
128+
return fss.as_pathname()
129+
130+
def mkcorealias(src, altsrc):
131+
import string
132+
import macostools
133+
version = string.split(sys.version)[0]
134+
dst = getextensiondirfile(src+ ' ' + version)
135+
if not os.path.exists(src):
136+
if not os.path.exists(altsrc):
137+
print '*', src, 'not found'
138+
return 0
139+
src = altsrc
140+
try:
141+
os.unlink(dst)
142+
except os.error:
143+
pass
144+
macostools.mkalias(src, dst)
145+
print ' ', dst, '->', src
146+
return 1
147+
124148

125149
def main():
126150
gotopluginfolder()
@@ -162,6 +186,16 @@ def main():
162186
print ' ', dst, '->', src
163187
else:
164188
print '*', dst, 'not created:', src, 'not found'
189+
print
190+
191+
# Create the PythonCore alias(es)
192+
print 'Creating PythonCore aliases in Extensions folder...'
193+
os.chdir('::')
194+
n = 0
195+
n = n + mkcorealias('PythonCorePPC', ':build.macppc.shared:PythonCorePPC')
196+
n = n + mkcorealias('PythonCoreCFM68K', ':build.mac68k.shared:PythonCoreCFM68K')
197+
if n == 0:
198+
sys.exit(1)
165199

166200
if __name__ == '__main__':
167201
main()

0 commit comments

Comments
 (0)