blob: 48c4539171fc9df7eb68886acdb4d684c6a97f75 [file] [log] [blame]
Jack Jansen6655c4e1995-09-01 12:03:32 +00001#
2# fullbuild creates everything that needs to be created before a
3# distribution can be made, and puts it all in the right place.
4#
5# It expects the projects to be in the places where Jack likes them:
Jack Jansenfaad9951997-09-01 15:37:07 +00006# in directories named like 'build.mac'. That is fixable,
Jack Jansen6655c4e1995-09-01 12:03:32 +00007# however.
8#
9# NOTE: You should proably make a copy of python with which to execute this
10# script, rebuilding running programs does not work...
11
Jack Jansenfaad9951997-09-01 15:37:07 +000012MACBUILDNO=":Mac:Include:macbuildno.h"
13
Jack Jansen6655c4e1995-09-01 12:03:32 +000014import os
15import sys
16import macfs
Jack Jansen1023dff1996-02-21 15:28:49 +000017import MacOS
Jack Jansenf04fa721996-04-10 14:51:14 +000018import EasyDialogs
Jack Jansenbe614ee2001-01-02 22:02:02 +000019import re
Jack Jansenfaad9951997-09-01 15:37:07 +000020import string
Jack Jansen6655c4e1995-09-01 12:03:32 +000021
Jack Jansen6655c4e1995-09-01 12:03:32 +000022import aetools
Jack Jansen1023dff1996-02-21 15:28:49 +000023import AppleEvents
Jack Jansen87426b92000-08-17 22:12:12 +000024
25OLDAESUPPORT = 0
26
27if OLDAESUPPORT:
28 from Metrowerks_Shell_Suite import Metrowerks_Shell_Suite
29 from CodeWarrior_suite import CodeWarrior_suite
30 from Metrowerks_Standard_Suite import Metrowerks_Standard_Suite
31 from Required_Suite import Required_Suite
32else:
33 import CodeWarrior
Jack Jansen0f00c5e1997-05-06 16:15:32 +000034
35import Res
36import Dlg
Jack Jansen6655c4e1995-09-01 12:03:32 +000037
Jack Jansen490ec9c1998-07-31 09:45:27 +000038import buildtools
Jack Jansen0f00c5e1997-05-06 16:15:32 +000039import cfmfile
40
41# Dialog resource. Note that the item numbers should correspond
42# to those in the DITL resource. Also note that the order is important:
43# things are built in this order, so there should be no forward dependencies.
44DIALOG_ID = 512
45
46I_OK=1
47I_CANCEL=2
Jack Jansene56e87d2001-01-03 11:12:21 +000048# label 3
49I_PPC_EXTLIBS=4
50I_GEN_PROJECTS=5
Jack Jansen1f5cd702001-01-21 22:25:11 +000051I_GEN_PROJECTS_FORCE=6
52I_GEN_IMGPROJECTS=7
53I_GEN_IMGPROJECTS_FORCE=8
54I_INC_BUILDNO=9
55# label 10
56I_PPC_CORE=11
57I_PPC_PLUGINS=12
58I_PPC_EXTENSIONS=13
59# label 14
60I_CARBON_CORE=15
61I_CARBON_PLUGINS=16
62I_CARBON_EXTENSIONS=17
Jack Jansen5288c472001-02-12 14:46:53 +000063I_INTERPRETER=18
64# label 19
65I_PPC_FULL=20
66I_PPC_SMALL=21
67# label 22
68I_CARBON_FULL=23
69I_CARBON_SMALL=24
70# label 25
71I_APPLETS=26
Jack Jansen0f00c5e1997-05-06 16:15:32 +000072
Jack Jansen5288c472001-02-12 14:46:53 +000073N_BUTTONS=27
Jack Jansen6655c4e1995-09-01 12:03:32 +000074
Jack Jansen87426b92000-08-17 22:12:12 +000075if OLDAESUPPORT:
76 class MwShell(Metrowerks_Shell_Suite, CodeWarrior_suite, Metrowerks_Standard_Suite,
77 Required_Suite, aetools.TalkTo):
78 pass
79else:
80 MwShell = CodeWarrior.CodeWarrior
Jack Jansen6655c4e1995-09-01 12:03:32 +000081
Jack Jansenf04fa721996-04-10 14:51:14 +000082RUNNING=[]
Jack Jansen6655c4e1995-09-01 12:03:32 +000083
84def buildmwproject(top, creator, projects):
85 """Build projects with an MW compiler"""
Jack Jansenb9e5e141996-09-20 15:30:52 +000086 mgr = MwShell(creator, start=1)
Jack Jansen1023dff1996-02-21 15:28:49 +000087 mgr.send_timeout = AppleEvents.kNoTimeOut
88
Jack Jansenbc66f952000-07-24 19:45:07 +000089 failed = []
Jack Jansen6655c4e1995-09-01 12:03:32 +000090 for file in projects:
Jack Jansen82bfde91997-08-27 14:10:29 +000091 if type(file) == type(()):
92 file, target = file
93 else:
94 target = ''
Jack Jansen6655c4e1995-09-01 12:03:32 +000095 file = os.path.join(top, file)
Just van Rossum2607a441999-01-30 18:27:12 +000096 try:
97 fss = macfs.FSSpec(file)
Jack Jansene56e87d2001-01-03 11:12:21 +000098 except MacOS.Error:
Just van Rossum2607a441999-01-30 18:27:12 +000099 print '** file not found:', file
100 continue
Jack Jansen82bfde91997-08-27 14:10:29 +0000101 print 'Building', file, target
Just van Rossum2607a441999-01-30 18:27:12 +0000102 try:
103 mgr.open(fss)
104 except aetools.Error, detail:
105 print '**', detail, file
106 continue
Jack Jansen82bfde91997-08-27 14:10:29 +0000107 if target:
108 try:
109 mgr.Set_Current_Target(target)
110 except aetools.Error, arg:
111 print '**', file, target, 'Cannot select:', arg
Jack Jansen1023dff1996-02-21 15:28:49 +0000112 try:
113 mgr.Make_Project()
Jack Jansenb9e5e141996-09-20 15:30:52 +0000114 except aetools.Error, arg:
Jack Jansen82bfde91997-08-27 14:10:29 +0000115 print '**', file, target, 'Failed:', arg
Jack Jansenbc66f952000-07-24 19:45:07 +0000116 failed.append(fss)
Jack Jansen6655c4e1995-09-01 12:03:32 +0000117 mgr.Close_Project()
Jack Jansenbc66f952000-07-24 19:45:07 +0000118 if failed:
119 print 'Open failed projects and exit?',
120 rv = sys.stdin.readline()
121 if rv[0] in ('y', 'Y'):
122 for fss in failed:
123 mgr.open(fss)
124 sys.exit(0)
Jack Jansenf04fa721996-04-10 14:51:14 +0000125## mgr.quit()
Jack Jansen6655c4e1995-09-01 12:03:32 +0000126
127def buildapplet(top, dummy, list):
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000128 """Create python applets"""
Jack Jansencbb5d492001-02-17 23:31:48 +0000129 for src, dst, tmpl in list:
130 template = buildtools.findtemplate(tmpl)
Jack Jansen6655c4e1995-09-01 12:03:32 +0000131 if src[-3:] != '.py':
132 raise 'Should end in .py', src
133 base = os.path.basename(src)
Jack Jansen6655c4e1995-09-01 12:03:32 +0000134 src = os.path.join(top, src)
Just van Rossum9d609b41999-02-01 01:21:18 +0000135 dst = os.path.join(top, dst)
Jack Jansen6655c4e1995-09-01 12:03:32 +0000136 try:
137 os.unlink(dst)
138 except os.error:
139 pass
140 print 'Building applet', dst
Jack Jansencbb5d492001-02-17 23:31:48 +0000141 try:
142 buildtools.process(template, src, dst, 1)
143 except buildtools.BuildError, arg:
144 print '**', dst, arg
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000145
Jack Jansen1f5cd702001-01-21 22:25:11 +0000146def buildprojectfile(top, arg, list):
Jack Jansene56e87d2001-01-03 11:12:21 +0000147 """Create CodeWarrior project files with a script"""
148 for folder, module, routine in list:
149 print "Generating project files with", module
150 sys.path.insert(0, os.path.join(top, folder))
151 m = __import__(module)
152 r = getattr(m, routine)
Jack Jansen1f5cd702001-01-21 22:25:11 +0000153 r(arg)
Jack Jansene56e87d2001-01-03 11:12:21 +0000154 del sys.path[0]
155
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000156def buildfat(top, dummy, list):
157 """Build fat binaries"""
158 for dst, src1, src2 in list:
159 dst = os.path.join(top, dst)
160 src1 = os.path.join(top, src1)
161 src2 = os.path.join(top, src2)
162 print 'Building fat binary', dst
163 cfmfile.mergecfmfiles((src1, src2), dst)
164
Jack Jansen5288c472001-02-12 14:46:53 +0000165def buildcopy(top, dummy, list):
166 import macostools
167 for src, dst in list:
168 src = os.path.join(top, src)
169 dst = os.path.join(top, dst)
170 macostools.copy(src, dst)
171
Jack Jansen675cda01997-09-09 13:57:15 +0000172def handle_dialog(filename):
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000173 """Handle selection dialog, return list of selected items"""
174 d = Dlg.GetNewDialog(DIALOG_ID, -1)
175 d.SetDialogDefaultItem(I_OK)
176 d.SetDialogCancelItem(I_CANCEL)
177 results = [0]*N_BUTTONS
178 while 1:
179 n = Dlg.ModalDialog(None)
180 if n == I_OK:
181 break
182 if n == I_CANCEL:
183 return []
Jack Jansen675cda01997-09-09 13:57:15 +0000184 if n == I_INC_BUILDNO:
185 incbuildno(filename)
186 continue
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000187 if n < len(results):
188 results[n] = (not results[n])
Jack Jansenc9b1e901999-12-24 13:39:23 +0000189 ctl = d.GetDialogItemAsControl(n)
190 ctl.SetControlValue(results[n])
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000191 rv = []
192 for i in range(len(results)):
193 if results[i]:
194 rv.append(i)
195 return rv
Jack Jansen6655c4e1995-09-01 12:03:32 +0000196
197#
198# The build instructions. Entries are (routine, arg, list-of-files)
199# XXXX We could also include the builds for stdwin and such here...
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000200BUILD_DICT = {
Jack Jansen1f5cd702001-01-21 22:25:11 +0000201I_GEN_PROJECTS : (buildprojectfile, 0, [
Jack Jansene56e87d2001-01-03 11:12:21 +0000202 (":Mac:scripts", "genpluginprojects", "genallprojects")
203 ]),
204
Jack Jansen1f5cd702001-01-21 22:25:11 +0000205I_GEN_PROJECTS_FORCE : (buildprojectfile, 1, [
206 (":Mac:scripts", "genpluginprojects", "genallprojects")
207 ]),
208
209I_GEN_IMGPROJECTS : (buildprojectfile, 0, [
Jack Jansene56e87d2001-01-03 11:12:21 +0000210 (":Extensions:img:Mac", "genimgprojects", "genallprojects")
211 ]),
212
Jack Jansen1f5cd702001-01-21 22:25:11 +0000213I_GEN_IMGPROJECTS_FORCE : (buildprojectfile, 1, [
214 (":Extensions:img:Mac", "genimgprojects", "genallprojects")
215 ]),
216
Jack Jansen5288c472001-02-12 14:46:53 +0000217I_INTERPRETER : (buildcopy, None, [
218 ("PythonInterpreterCarbon", "PythonInterpreter"),
219 ]),
220
Jack Jansen1f5cd702001-01-21 22:25:11 +0000221I_PPC_CORE : (buildmwproject, "CWIE", [
Jack Jansena5d384d2000-12-03 22:36:42 +0000222 (":Mac:Build:PythonCore.mcp", "PythonCore"),
Jack Jansen5288c472001-02-12 14:46:53 +0000223 (":Mac:Build:PythonInterpreter.mcp", "PythonInterpreterClassic"),
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000224 ]),
225
Jack Jansen1f5cd702001-01-21 22:25:11 +0000226I_CARBON_CORE : (buildmwproject, "CWIE", [
227 (":Mac:Build:PythonCore.mcp", "PythonCoreCarbon"),
228 (":Mac:Build:PythonInterpreter.mcp", "PythonInterpreterCarbon"),
229 ]),
230
Jack Jansene56e87d2001-01-03 11:12:21 +0000231I_PPC_EXTLIBS : (buildmwproject, "CWIE", [
232## (":Mac:Build:buildlibs.mcp", "buildlibs ppc plus tcl/tk"),
233 (":Mac:Build:buildlibs.mcp", "buildlibs ppc"),
234 ]),
235
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000236I_PPC_PLUGINS : (buildmwproject, "CWIE", [
Jack Jansen5288c472001-02-12 14:46:53 +0000237 (":Mac:Build:_weakref.mcp", "_weakref.ppc"),
238 (":Mac:Build:_symtable.mcp", "_symtable.ppc"),
239 (":Mac:Build:_testcapi.mcp", "_testcapi.ppc"),
Jack Jansena5d384d2000-12-03 22:36:42 +0000240 (":Mac:Build:pyexpat.mcp", "pyexpat.ppc"),
241 (":Mac:Build:calldll.mcp", "calldll.ppc"),
242 (":Mac:Build:ctb.mcp", "ctb.ppc"),
243 (":Mac:Build:gdbm.mcp", "gdbm.ppc"),
244 (":Mac:Build:icglue.mcp", "icglue.ppc"),
245 (":Mac:Build:macspeech.mcp", "macspeech.ppc"),
246 (":Mac:Build:waste.mcp", "waste.ppc"),
247 (":Mac:Build:zlib.mcp", "zlib.ppc"),
248## (":Mac:Build:_tkinter.mcp", "_tkinter.ppc"),
Jack Jansen07d69f62001-01-01 21:51:33 +0000249 (":Extensions:Imaging:_tkinter.mcp", "_tkinter.ppc"),
Jack Jansena5d384d2000-12-03 22:36:42 +0000250 (":Mac:Build:ColorPicker.mcp", "ColorPicker.ppc"),
251 (":Mac:Build:Printing.mcp", "Printing.ppc"),
252 (":Mac:Build:App.mcp", "App.ppc"),
253 (":Mac:Build:Cm.mcp", "Cm.ppc"),
Jack Jansena5d384d2000-12-03 22:36:42 +0000254 (":Mac:Build:Fm.mcp", "Fm.ppc"),
255 (":Mac:Build:Help.mcp", "Help.ppc"),
256 (":Mac:Build:Icn.mcp", "Icn.ppc"),
257 (":Mac:Build:List.mcp", "List.ppc"),
258 (":Mac:Build:Qdoffs.mcp", "Qdoffs.ppc"),
259 (":Mac:Build:Qt.mcp", "Qt.ppc"),
260 (":Mac:Build:Scrap.mcp", "Scrap.ppc"),
261 (":Mac:Build:Snd.mcp", "Snd.ppc"),
262 (":Mac:Build:Sndihooks.mcp", "Sndihooks.ppc"),
263 (":Mac:Build:TE.mcp", "TE.ppc"),
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000264 ]),
265
Jack Jansenc3fc51f2001-01-23 22:36:52 +0000266I_CARBON_PLUGINS : (buildmwproject, "CWIE", [
Jack Jansen5288c472001-02-12 14:46:53 +0000267 (":Mac:Build:_weakref.carbon.mcp", "_weakref.carbon"),
268 (":Mac:Build:_symtable.carbon.mcp", "_symtable.carbon"),
269 (":Mac:Build:_testcapi.carbon.mcp", "_testcapi.carbon"),
Jack Jansenc3fc51f2001-01-23 22:36:52 +0000270 (":Mac:Build:pyexpat.carbon.mcp", "pyexpat.carbon"),
271 (":Mac:Build:calldll.carbon.mcp", "calldll.carbon"),
272 (":Mac:Build:gdbm.carbon.mcp", "gdbm.carbon"),
Jack Jansen5a8115c2001-01-29 13:27:46 +0000273 (":Mac:Build:icglue.carbon.mcp", "icglue.carbon"),
Jack Jansen8c982662001-01-24 16:02:07 +0000274 (":Mac:Build:waste.carbon.mcp", "waste.carbon"),
Jack Jansenc3fc51f2001-01-23 22:36:52 +0000275 (":Mac:Build:zlib.carbon.mcp", "zlib.carbon"),
Jack Jansen7b7e7132001-01-23 23:19:41 +0000276## (":Mac:Build:_tkinter.mcp", "_tkinter.carbon"),
Jack Jansenc3fc51f2001-01-23 22:36:52 +0000277## (":Extensions:Imaging:_tkinter.carbon.mcp", "_tkinter.carbon"),
278 (":Mac:Build:ColorPicker.carbon.mcp", "ColorPicker.carbon"),
279 (":Mac:Build:App.carbon.mcp", "App.carbon"),
280 (":Mac:Build:Cm.carbon.mcp", "Cm.carbon"),
281 (":Mac:Build:Fm.carbon.mcp", "Fm.carbon"),
282 (":Mac:Build:Icn.carbon.mcp", "Icn.carbon"),
283 (":Mac:Build:List.carbon.mcp", "List.carbon"),
284 (":Mac:Build:Qdoffs.carbon.mcp", "Qdoffs.carbon"),
285 (":Mac:Build:Qt.carbon.mcp", "Qt.carbon"),
Jack Jansen8c982662001-01-24 16:02:07 +0000286 (":Mac:Build:Scrap.carbon.mcp", "Scrap.carbon"),
Jack Jansenc3fc51f2001-01-23 22:36:52 +0000287 (":Mac:Build:Snd.carbon.mcp", "Snd.carbon"),
288 (":Mac:Build:Sndihooks.carbon.mcp", "Sndihooks.carbon"),
289 (":Mac:Build:TE.carbon.mcp", "TE.carbon"),
290 ]),
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000291
Jack Jansen131c2882001-01-24 14:06:35 +0000292I_PPC_FULL : (buildmwproject, "CWIE", [
293 (":Mac:Build:PythonStandalone.mcp", "PythonStandalone"),
294 ]),
295
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000296I_PPC_SMALL : (buildmwproject, "CWIE", [
Jack Jansena5d384d2000-12-03 22:36:42 +0000297 (":Mac:Build:PythonStandSmall.mcp", "PythonStandSmall"),
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000298 ]),
299
Jack Jansen5288c472001-02-12 14:46:53 +0000300I_CARBON_FULL : (buildmwproject, "CWIE", [
301 (":Mac:Build:PythonStandalone.mcp", "PythonCarbonStandalone"),
302 ]),
303
304I_CARBON_SMALL : (buildmwproject, "CWIE", [
305 (":Mac:Build:PythonStandSmall.mcp", "PythonStandSmallCarbon"),
306 ]),
307
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000308I_PPC_EXTENSIONS : (buildmwproject, "CWIE", [
Jack Jansena5d384d2000-12-03 22:36:42 +0000309 (":Extensions:Imaging:_imaging.mcp", "_imaging.ppc"),
310## (":Extensions:Imaging:_tkinter.mcp", "_tkinter.ppc"),
Jack Jansen7b7e7132001-01-23 23:19:41 +0000311 (":Extensions:img:Mac:imgmodules.mcp", "imgmodules.ppc"),
Jack Jansena5d384d2000-12-03 22:36:42 +0000312## (":Extensions:Numerical:Mac:numpymodules.mcp", "multiarraymodule"),
313## (":Extensions:Numerical:Mac:numpymodules.mcp", "_numpy"),
314## (":Extensions:Numerical:Mac:numpymodules.mcp", "umathmodule"),
315## (":Extensions:Numerical:Mac:numpymodules.mcp", "arrayfns"),
316## (":Extensions:Numerical:Packages:FFT:Mac:fftpack.mcp", "fftpack.ppc"),
317## (":Extensions:Numerical:Packages:LALITE:Mac:lapack_lite.mcp", "lapack_lite.ppc"),
318## (":Extensions:Numerical:Packages:RANLIB:Mac:ranlib.mcp", "ranlib.ppc"),
319## (":Extensions:Numerical:Packages:RNG:Mac:RNG.mcp", "RNG.ppc"),
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000320 ]),
321
Jack Jansen7b7e7132001-01-23 23:19:41 +0000322I_CARBON_EXTENSIONS : (buildmwproject, "CWIE", [
323## (":Extensions:Imaging:_imaging.mcp", "_imaging.carbon"),
324## (":Extensions:Imaging:_tkinter.mcp", "_tkinter.carbon"),
325 (":Extensions:img:Mac:imgmodules.mcp", "imgmodules.carbon"),
326## (":Extensions:Numerical:Mac:numpymodules.mcp", "multiarraymodule"),
327## (":Extensions:Numerical:Mac:numpymodules.mcp", "_numpy"),
328## (":Extensions:Numerical:Mac:numpymodules.mcp", "umathmodule"),
329## (":Extensions:Numerical:Mac:numpymodules.mcp", "arrayfns"),
330## (":Extensions:Numerical:Packages:FFT:Mac:fftpack.mcp", "fftpack.ppc"),
331## (":Extensions:Numerical:Packages:LALITE:Mac:lapack_lite.mcp", "lapack_lite.ppc"),
332## (":Extensions:Numerical:Packages:RANLIB:Mac:ranlib.mcp", "ranlib.ppc"),
333## (":Extensions:Numerical:Packages:RNG:Mac:RNG.mcp", "RNG.ppc"),
334 ]),
335
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000336I_APPLETS : (buildapplet, None, [
Jack Jansencbb5d492001-02-17 23:31:48 +0000337 (":Mac:scripts:EditPythonPrefs.py", "EditPythonPrefs", None),
338 (":Mac:scripts:BuildApplet.py", "BuildApplet", None),
339 (":Mac:scripts:BuildApplication.py", "BuildApplication", None),
340 (":Mac:scripts:ConfigurePython.py", "ConfigurePython", None),
341 (":Mac:scripts:ConfigurePython.py", "ConfigurePythonCarbon", "PythonInterpreterCarbon"),
342 (":Mac:scripts:ConfigurePython.py", "ConfigurePythonClassic", "PythonInterpreterClassic"),
343 (":Mac:Tools:IDE:PythonIDE.py", "Python IDE", None),
344 (":Mac:Tools:CGI:PythonCGISlave.py", ":Mac:Tools:CGI:PythonCGISlave", None),
345 (":Mac:Tools:CGI:BuildCGIApplet.py", ":Mac:Tools:CGI:BuildCGIApplet", None),
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000346 ]),
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000347}
Jack Jansenfaad9951997-09-01 15:37:07 +0000348
349def incbuildno(filename):
350 fp = open(filename)
351 line = fp.readline()
352 fp.close()
353
Jack Jansenbe614ee2001-01-02 22:02:02 +0000354 pat = re.compile('#define BUILD ([0-9]+)')
355 m = pat.search(line)
356 if not m or not m.group(1):
Jack Jansenfaad9951997-09-01 15:37:07 +0000357 raise 'Incorrect macbuildno.h line', line
Jack Jansenbe614ee2001-01-02 22:02:02 +0000358 buildno = m.group(1)
Jack Jansenfaad9951997-09-01 15:37:07 +0000359 new = string.atoi(buildno) + 1
360 fp = open(filename, 'w')
361 fp.write('#define BUILD %d\n'%new)
362 fp.close()
Jack Jansen6655c4e1995-09-01 12:03:32 +0000363
364def main():
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000365 try:
Jack Jansend13c3852000-06-20 21:59:25 +0000366 h = Res.FSpOpenResFile('fullbuild.rsrc', 1)
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000367 except Res.Error:
368 pass # Assume we already have acces to our own resource
369
Jack Jansen6655c4e1995-09-01 12:03:32 +0000370 dir, ok = macfs.GetDirectory('Python source folder:')
371 if not ok:
372 sys.exit(0)
373 dir = dir.as_pathname()
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000374
Jack Jansen675cda01997-09-09 13:57:15 +0000375 todo = handle_dialog(os.path.join(dir, MACBUILDNO))
376
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000377 instructions = []
378 for i in todo:
379 instructions.append(BUILD_DICT[i])
380
381 for routine, arg, list in instructions:
Jack Jansen8b4c9871997-05-07 15:52:12 +0000382 routine(dir, arg, list)
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000383
Jack Jansene56e87d2001-01-03 11:12:21 +0000384 if todo:
385 print "All done!"
Jack Jansen6655c4e1995-09-01 12:03:32 +0000386
387if __name__ == '__main__':
388 main()
389