22# dynamically-loaded modules that "live in" in a single
33# shared library.
44# It needs a fully functional non-dynamic python to work
5- # (since it creates aliases to stuff it needs itself),
6- # you should probably drag it onto your non-dynamic python.
7- #
8- # If you compare it to MkPluginAliases.as it also serves
9- # as a comparison between python and AppleScript:-)
5+ # but you can run it in a shared python as long as you can point
6+ # it to toolboxmodules.slb
107#
118# Jack Jansen, CWI, August 1995
129
@@ -16,10 +13,10 @@ def help():
1613 print """
1714Try the following:
18151. Remove any old "Python Preferences" files from the system folder.
19- 2. Remove any old "PythonCore" files from the system folder.
20- 3. Make sure this script, PythonPPC and PythonCore are all located in the
21- python home folder (where the Lib and PlugIns folders are)
22- 4. Run this script again, by dropping it on PythonPPC .
16+ 2. Remove any old "PythonCore" or "PythonCoreCFM68K" files from the system folder.
17+ 3. Make sure this script, your interpreter and your PythonCore are all located in the
18+ same folder.
19+ 4. Run this script again, by dropping it on your interpreter .
2320
2421If this fails try removing starting afresh from the distribution archive.
2522"""
@@ -36,26 +33,12 @@ def help():
3633try :
3734 import Res
3835except ImportError :
36+ import macfs
3937 #
4038 # Check that we are actually in the main python directory
4139 #
42- try :
43- os .chdir (':PlugIns' )
44- except IOError :
45- print """
46- I cannot find the 'PlugIns' folder, so I am obviously not run from the Python
47- home folder.
48- """
49- help ()
50- import imp
51- cwd = os .getcwd ()
52- tblibname = os .path .join (cwd , "toolboxmodules.slb" )
53- if not os .path .exists (tblibname ):
54- print """
55- I cannot find the 'toolboxmodules.slb' file in the PlugIns directory.
56- Start afresh from a clean distribution.
57- """
58- sys .exit (1 )
40+ fss , ok = macfs .StandardGetFile ('Where are the toolbox modules?' , 'shlb' )
41+ tblibname = fss .as_pathname ()
5942 try :
6043 for wtd in ["Ctl" , "Dlg" , "Evt" , "Qd" , "Res" , "Win" ]:
6144 imp .load_dynamic (wtd , tblibname )
@@ -71,32 +54,53 @@ def help():
7154import EasyDialogs
7255import macostools
7356
74- goals = [
75- ("AE.slb" , "toolboxmodules.slb" ),
76- ("Cm.slb" , "toolboxmodules.slb" ),
77- ("Ctl.slb" , "toolboxmodules.slb" ),
78- ("Dlg.slb" , "toolboxmodules.slb" ),
79- ("Evt.slb" , "toolboxmodules.slb" ),
80- ("Fm.slb" , "toolboxmodules.slb" ),
81- ("Menu.slb" , "toolboxmodules.slb" ),
82- ("List.slb" , "toolboxmodules.slb" ),
83- ("Qd.slb" , "toolboxmodules.slb" ),
84- ("Qt.slb" , "toolboxmodules.slb" ),
85- ("Res.slb" , "toolboxmodules.slb" ),
86- ("Scrap.slb" , "toolboxmodules.slb" ),
87- ("Snd.slb" , "toolboxmodules.slb" ),
88- ("TE.slb" , "toolboxmodules.slb" ),
89- ("Win.slb" , "toolboxmodules.slb" ),
90- ("imgcolormap.slb" , "imgmodules.slb" ),
91- ("imgformat.slb" , "imgmodules.slb" ),
92- ("imggif.slb" , "imgmodules.slb" ),
93- ("imgjpeg.slb" , "imgmodules.slb" ),
94- ("imgop.slb" , "imgmodules.slb" ),
95- ("imgpbm.slb" , "imgmodules.slb" ),
96- ("imgpgm.slb" , "imgmodules.slb" ),
97- ("imgppm.slb" , "imgmodules.slb" ),
98- ("imgtiff.slb" , "imgmodules.slb" ),
99- ("imgsgi.slb" , "imgmodules.slb" )
57+ ppc_goals = [
58+ ("AE.ppc.slb" , "toolboxmodules.ppc.slb" ),
59+ ("Ctl.ppc.slb" , "toolboxmodules.ppc.slb" ),
60+ ("Dlg.ppc.slb" , "toolboxmodules.ppc.slb" ),
61+ ("Evt.ppc.slb" , "toolboxmodules.ppc.slb" ),
62+ ("Fm.ppc.slb" , "toolboxmodules.ppc.slb" ),
63+ ("Menu.ppc.slb" , "toolboxmodules.ppc.slb" ),
64+ ("List.ppc.slb" , "toolboxmodules.ppc.slb" ),
65+ ("Qd.ppc.slb" , "toolboxmodules.ppc.slb" ),
66+ ("Res.ppc.slb" , "toolboxmodules.ppc.slb" ),
67+ ("Scrap.ppc.slb" , "toolboxmodules.ppc.slb" ),
68+ ("Snd.ppc.slb" , "toolboxmodules.ppc.slb" ),
69+ ("TE.ppc.slb" , "toolboxmodules.ppc.slb" ),
70+ ("Win.ppc.slb" , "toolboxmodules.ppc.slb" ),
71+
72+ ("Cm.ppc.slb" , "qtmodules.ppc.slb" ),
73+ ("Qt.ppc.slb" , "qtmodules.ppc.slb" ),
74+
75+ ("imgcolormap.ppc.slb" , "imgmodules.ppc.slb" ),
76+ ("imgformat.ppc.slb" , "imgmodules.ppc.slb" ),
77+ ("imggif.ppc.slb" , "imgmodules.ppc.slb" ),
78+ ("imgjpeg.ppc.slb" , "imgmodules.ppc.slb" ),
79+ ("imgop.ppc.slb" , "imgmodules.ppc.slb" ),
80+ ("imgpbm.ppc.slb" , "imgmodules.ppc.slb" ),
81+ ("imgpgm.ppc.slb" , "imgmodules.ppc.slb" ),
82+ ("imgppm.ppc.slb" , "imgmodules.ppc.slb" ),
83+ ("imgtiff.ppc.slb" , "imgmodules.ppc.slb" ),
84+ ("imgsgi.ppc.slb" , "imgmodules.ppc.slb" )
85+ ]
86+
87+ cfm68k_goals = [
88+ ("AE.CFM68K.slb" , "toolboxmodules.CFM68K.slb" ),
89+ ("Ctl.CFM68K.slb" , "toolboxmodules.CFM68K.slb" ),
90+ ("Dlg.CFM68K.slb" , "toolboxmodules.CFM68K.slb" ),
91+ ("Evt.CFM68K.slb" , "toolboxmodules.CFM68K.slb" ),
92+ ("Fm.CFM68K.slb" , "toolboxmodules.CFM68K.slb" ),
93+ ("Menu.CFM68K.slb" , "toolboxmodules.CFM68K.slb" ),
94+ ("List.CFM68K.slb" , "toolboxmodules.CFM68K.slb" ),
95+ ("Qd.CFM68K.slb" , "toolboxmodules.CFM68K.slb" ),
96+ ("Res.CFM68K.slb" , "toolboxmodules.CFM68K.slb" ),
97+ ("Scrap.CFM68K.slb" , "toolboxmodules.CFM68K.slb" ),
98+ ("Snd.CFM68K.slb" , "toolboxmodules.CFM68K.slb" ),
99+ ("TE.CFM68K.slb" , "toolboxmodules.CFM68K.slb" ),
100+ ("Win.CFM68K.slb" , "toolboxmodules.CFM68K.slb" ),
101+
102+ ("Cm.CFM68K.slb" , "qtmodules.CFM68K.slb" ),
103+ ("Qt.CFM68K.slb" , "qtmodules.CFM68K.slb" ),
100104]
101105
102106
@@ -121,13 +125,18 @@ def main():
121125
122126 print LibFiles
123127 # Create the new aliases.
124- if EasyDialogs .AskYesNoCancel ('Proceed with creating new ones?' ) <= 0 :
125- sys .exit (0 )
126- for dst , src in goals :
127- if src in LibFiles :
128- macostools .mkalias (src , dst )
129- else :
130- EasyDialogs .Message (dst + ' not created: ' + src + ' not found' )
128+ if EasyDialogs .AskYesNoCancel ('Proceed with creating PPC aliases?' ) > 0 :
129+ for dst , src in ppc_goals :
130+ if src in LibFiles :
131+ macostools .mkalias (src , dst )
132+ else :
133+ EasyDialogs .Message (dst + ' not created: ' + src + ' not found' )
134+ if EasyDialogs .AskYesNoCancel ('Proceed with creating CFM68K aliases?' ) > 0 :
135+ for dst , src in cfm68k_goals :
136+ if src in LibFiles :
137+ macostools .mkalias (src , dst )
138+ else :
139+ EasyDialogs .Message (dst + ' not created: ' + src + ' not found' )
131140
132141 EasyDialogs .Message ('All done!' )
133142
0 commit comments