summaryrefslogtreecommitdiffstats
path: root/Mac/Tools/IDE/BuildIDE.py
blob: ad6a4ea436e3e3f3e3c9d5e1f1e14f2697c281eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import sys
import os
import buildtools
import Res
import py_resource

buildtools.DEBUG=1

template = buildtools.findtemplate()

ide_home = os.path.join(sys.exec_prefix, ":Mac:Tools:IDE")

mainfilename = os.path.join(ide_home, "PythonIDE.py")
dstfilename = os.path.join(sys.exec_prefix, "Python IDE")

buildtools.process(template, mainfilename, dstfilename, 1)

targetref = Res.OpenResFile(dstfilename)
Res.UseResFile(targetref)

files = os.listdir(ide_home)

files = filter(lambda x: x[-3:] == '.py' and x not in ("BuildIDE.py", "PythonIDE.py"), files)

for name in files:
	print "adding", name
	fullpath = os.path.join(ide_home, name)
	id, name = py_resource.frompyfile(fullpath, name[:-3], preload=1,
		ispackage=0)

wresref = Res.OpenResFile(os.path.join(ide_home, "Widgets.rsrc"))
buildtools.copyres(wresref, targetref, [], 0)