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

Skip to content

Commit 25b361f

Browse files
committed
Adapted for cfm68k, new names and split off of qt.
1 parent e420178 commit 25b361f

2 files changed

Lines changed: 92 additions & 67 deletions

File tree

Mac/scripts/ConfigurePython.py

Lines changed: 68 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
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"""
1714
Try the following:
1815
1. 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
2421
If this fails try removing starting afresh from the distribution archive.
2522
"""
@@ -36,26 +33,12 @@ def help():
3633
try:
3734
import Res
3835
except 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():
7154
import EasyDialogs
7255
import 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

Mac/scripts/fullbuild.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,29 @@ def buildapplet(top, dummy, list):
8181
":build.macppc.shared:PythonApplet.µ",
8282
])
8383
]
84+
CFM68K_INSTRUCTIONS=[
85+
(buildmwproject, "CWIE", [
86+
":build.mac68k.shared:PythonCoreCFM68K.µ",
87+
":build.mac68k.shared:PythonCFM68K.µ",
88+
":build.mac68k.shared:PythonAppletCFM68K.µ",
89+
])
90+
]
8491
PLUGIN_INSTRUCTIONS=[
8592
(buildmwproject, "CWIE", [
86-
":PlugIns:ctbmodule.µ",
87-
":PlugIns:imgmodules.µ",
88-
":PlugIns:macspeechmodule.µ",
89-
":PlugIns:toolboxmodules.µ",
90-
":PlugIns:wastemodule.µ",
91-
":PlugIns:_tkintermodule.µ",
93+
":PlugIns:ctbmodule.ppc.µ",
94+
":PlugIns:imgmodules.ppc.µ",
95+
":PlugIns:macspeechmodule.ppc.µ",
96+
":PlugIns:toolboxmodules.ppc.µ",
97+
":PlugIns:wastemodule.ppc.µ",
98+
":PlugIns:_tkintermodule.ppc.µ",
99+
])
100+
]
101+
CFM68KPLUGIN_INSTRUCTIONS=[
102+
(buildmwproject, "CWIE", [
103+
":PlugIns:ctbmodule.CFM68K.µ",
104+
":PlugIns:toolboxmodules.CFM68K.µ",
105+
":PlugIns:wastemodule.CFM68K.µ",
106+
":PlugIns:_tkintermodule.CFM68K.µ",
92107
])
93108
]
94109
M68K_INSTRUCTIONS=[
@@ -108,8 +123,9 @@ def buildapplet(top, dummy, list):
108123
ALLINST=[
109124
("PPC shared executable", PPC_INSTRUCTIONS),
110125
("PPC plugin modules", PLUGIN_INSTRUCTIONS),
111-
("68K executable", M68K_INSTRUCTIONS),
112-
("PPC applets", APPLET_INSTRUCTIONS)
126+
("CFM68K shared executable", CFM68K_INSTRUCTIONS),
127+
("68K standalone executable", M68K_INSTRUCTIONS),
128+
("Applets", APPLET_INSTRUCTIONS)
113129
]
114130

115131
def main():

0 commit comments

Comments
 (0)