1 """Build a "big" applet for the IDE, and put it in the Python home
2 directory. It will contain all IDE-specific modules as PYC resources,
3 which reduces the startup time (especially on slower machines)."""
13 template
= buildtools
.findtemplate()
15 ide_home
= os
.path
.join(sys
.exec_prefix
, ":Mac:Tools:IDE")
17 mainfilename
= os
.path
.join(ide_home
, "PythonIDE.py")
18 dstfilename
= os
.path
.join(sys
.exec_prefix
, "Python IDE")
20 buildtools
.process(template
, mainfilename
, dstfilename
, 1)
22 targetref
= Res
.FSpOpenResFile(dstfilename
, 3)
23 Res
.UseResFile(targetref
)
25 files
= os
.listdir(ide_home
)
27 # skip this script and the main program
28 files
= filter(lambda x
: x
[-3:] == '.py' and
29 x
not in ("BuildIDE.py", "PythonIDE.py"), files
)
31 # add the modules as PYC resources
34 fullpath
= os
.path
.join(ide_home
, name
)
35 id, name
= py_resource
.frompyfile(fullpath
, name
[:-3], preload
=1,
39 wresref
= Res
.FSpOpenResFile(os
.path
.join(ide_home
, "Widgets.rsrc"), 1)
40 buildtools
.copyres(wresref
, targetref
, [], 0)