Just van Rossum | 40f9b7b | 1999-01-30 22:39:17 +0000 | [diff] [blame] | 1 | import sys |
| 2 | import os |
| 3 | import buildtools |
| 4 | import Res |
| 5 | import py_resource |
| 6 | |
| 7 | buildtools.DEBUG=1 |
| 8 | |
| 9 | template = buildtools.findtemplate() |
| 10 | |
| 11 | ide_home = os.path.join(sys.exec_prefix, ":Mac:Tools:IDE") |
| 12 | |
| 13 | mainfilename = os.path.join(ide_home, "PythonIDE.py") |
| 14 | dstfilename = os.path.join(sys.exec_prefix, "Python IDE") |
| 15 | |
| 16 | buildtools.process(template, mainfilename, dstfilename, 1) |
| 17 | |
| 18 | targetref = Res.OpenResFile(dstfilename) |
| 19 | Res.UseResFile(targetref) |
| 20 | |
| 21 | files = os.listdir(ide_home) |
| 22 | |
| 23 | files = filter(lambda x: x[-3:] == '.py' and x not in ("BuildIDE.py", "PythonIDE.py"), files) |
| 24 | |
| 25 | for name in files: |
| 26 | print "adding", name |
| 27 | fullpath = os.path.join(ide_home, name) |
| 28 | id, name = py_resource.frompyfile(fullpath, name[:-3], preload=1, |
| 29 | ispackage=0) |
| 30 | |
| 31 | wresref = Res.OpenResFile(os.path.join(ide_home, "Widgets.rsrc")) |
| 32 | buildtools.copyres(wresref, targetref, [], 0) |