1 | #!/usr/bin/env python |
---|
2 | |
---|
3 | |
---|
4 | from ll import make, url |
---|
5 | from ll.xist import xsc, parse, css |
---|
6 | from ll.xist.ns import html, doc, fo, specials, abbr, code, chars |
---|
7 | |
---|
8 | |
---|
9 | class XISTFOAction(make.TransformAction): |
---|
10 | def execute(self, project, data): |
---|
11 | project.writestep("Wrapping input in fodoc") |
---|
12 | return doc.fodoc(data) |
---|
13 | |
---|
14 | |
---|
15 | class ExtractContentAction(make.TransformAction): |
---|
16 | def execute(self, project, data): |
---|
17 | project.writestep("Extracting content") |
---|
18 | return data.walknode(css.selector("div.content"))[0].content |
---|
19 | |
---|
20 | |
---|
21 | class Project(make.Project): |
---|
22 | name = "LivingLogic.Python.WWW" |
---|
23 | |
---|
24 | def create(self): |
---|
25 | make.Project.create(self) |
---|
26 | here = url.here() |
---|
27 | root = url.root() |
---|
28 | home = url.home() |
---|
29 | srcdir = here |
---|
30 | builddir = here/"../build/" |
---|
31 | installdir = here/"../install/" |
---|
32 | repositorydir = home/"checkouts/" |
---|
33 | xistdir = url.firstdir([here/"../xist_src/", home/"checkouts/LivingLogic.Python.xist/"]) |
---|
34 | |
---|
35 | build = self.add(make.PhonyAction(), "build") |
---|
36 | install = self.add(make.PhonyAction(), "install") |
---|
37 | clean = self.add( |
---|
38 | make.PhonyAction( |
---|
39 | make.CommandAction("rm -rf %s" % builddir.local(), make.alwaysaction), |
---|
40 | doc="clean the build directory", |
---|
41 | ), |
---|
42 | "clean" |
---|
43 | ) |
---|
44 | |
---|
45 | installclean = self.add( |
---|
46 | make.PhonyAction( |
---|
47 | make.CommandAction("rm -rf %s*" % installdir.local(), clean), |
---|
48 | doc="clean the build and install directory", |
---|
49 | ), |
---|
50 | "installclean" |
---|
51 | ) |
---|
52 | |
---|
53 | namespaces = [] |
---|
54 | files = list(srcdir.walkfiles()) |
---|
55 | |
---|
56 | pixelfiles = [ file for file in xistdir.walkfiles() if str(file).startswith("px/") and file.ext=="gif" ] |
---|
57 | |
---|
58 | copyextensions = {"gif": True, "jpg": True, "png": True, "css": False, "js": False} |
---|
59 | auxFiles = [] |
---|
60 | for id in files: |
---|
61 | ext = id.ext |
---|
62 | try: |
---|
63 | aux = copyextensions[ext] |
---|
64 | except KeyError: |
---|
65 | continue |
---|
66 | f1 = self.add(make.FileAction(srcdir/id)) |
---|
67 | f2 = self.add(make.FileAction(builddir/id, f1)) |
---|
68 | f3 = self.add(make.FileAction(installdir/id, f2).chmod(0o644)) |
---|
69 | if aux: |
---|
70 | auxFiles.append(f2) |
---|
71 | build.addinputs(f2) |
---|
72 | install.addinputs(f3) |
---|
73 | |
---|
74 | for id in pixelfiles: |
---|
75 | f1 = self.add(make.FileAction(xistdir/id)) |
---|
76 | f2 = self.add(make.FileAction(builddir/id, f1)) |
---|
77 | f3 = self.add(make.FileAction(installdir/id, f2).chmod(0o644)) |
---|
78 | auxFiles.append(f2) |
---|
79 | build.addinputs(f2) |
---|
80 | install.addinputs(f3) |
---|
81 | |
---|
82 | publisher = xsc.Publisher(encoding="utf-8", xhtml=1) |
---|
83 | fopublisher = xsc.Publisher(prefixes={fo: "fo", doc: "doc", "specials": specials}, encoding="utf-8", xhtml=2) |
---|
84 | |
---|
85 | # These are not the real installed modules, but their source |
---|
86 | file_core = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.core/src/ll/__init__.py")) |
---|
87 | file_xist = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/__init__.py")) |
---|
88 | file_xist_xsc = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/xsc.py")) |
---|
89 | file_xist_ns = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/__init__.py")) |
---|
90 | file_xist_ns_html = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/html.py")) |
---|
91 | file_xist_ns_xml = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/xml.py")) |
---|
92 | file_xist_ns_wml = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/wml.py")) |
---|
93 | file_xist_ns_ihtml = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/ihtml.py")) |
---|
94 | file_xist_ns_docbook = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/docbook.py")) |
---|
95 | file_xist_ns_abbr = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/abbr.py")) |
---|
96 | file_xist_ns_cond = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/cond.py")) |
---|
97 | file_xist_ns_form = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/form.py")) |
---|
98 | file_xist_ns_php = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/php.py")) |
---|
99 | file_xist_ns_jsp = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/jsp.py")) |
---|
100 | file_xist_ns_meta = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/meta.py")) |
---|
101 | file_xist_ns_ruby = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/ruby.py")) |
---|
102 | file_xist_ns_specials = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/specials.py")) |
---|
103 | file_xist_ns_htmlspecials = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/htmlspecials.py")) |
---|
104 | file_xist_ns_strutshtml = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/struts_html.py")) |
---|
105 | file_xist_ns_strutsconfig = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/struts_config.py")) |
---|
106 | file_xist_ns_doc = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/doc.py")) |
---|
107 | file_xist_ns_rng = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/rng.py")) |
---|
108 | file_xist_ns_kid = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/kid.py")) |
---|
109 | file_xist_ns_detox = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/detox.py")) |
---|
110 | file_xist_ns_toxic = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/ns/toxic.py")) |
---|
111 | file_xist_parse = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/parse.py")) |
---|
112 | file_xist_present = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/present.py")) |
---|
113 | file_xist_sims = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/sims.py")) |
---|
114 | file_xist_xfind = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/xfind.py")) |
---|
115 | file_xist_css = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/css.py")) |
---|
116 | file_xist_scripts = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/scripts/__init__.py")) |
---|
117 | file_xist_scripts_dtd2xsc = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/scripts/dtd2xsc.py")) |
---|
118 | file_xist_scripts_xml2xsc = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/scripts/xml2xsc.py")) |
---|
119 | file_xist_scripts_tld2xsc = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/scripts/tld2xsc.py")) |
---|
120 | file_xist_scripts_doc2txt = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/scripts/doc2txt.py")) |
---|
121 | file_xist_scripts_uhpp = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/xist/scripts/uhpp.py")) |
---|
122 | file_misc = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/misc.py")) |
---|
123 | file_url = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/url.py")) |
---|
124 | file_ul4 = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/ul4c.py")) |
---|
125 | file_make = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/make.py")) |
---|
126 | file_sisyphus = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/sisyphus.py")) |
---|
127 | file_daemon = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/daemon.py")) |
---|
128 | file_color = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/color.py")) |
---|
129 | file_oradd = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/oradd.py")) |
---|
130 | file_orasql = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/orasql/__init__.py")) |
---|
131 | file_orasql_scripts = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/orasql/scripts/__init__.py")) |
---|
132 | file_orasql_scripts_oracreate = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/orasql/scripts/oracreate.py")) |
---|
133 | file_orasql_scripts_oradrop = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/orasql/scripts/oradrop.py")) |
---|
134 | file_orasql_scripts_oradelete = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/orasql/scripts/oradelete.py")) |
---|
135 | file_orasql_scripts_oragrant = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/orasql/scripts/oragrant.py")) |
---|
136 | file_orasql_scripts_orafind = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/orasql/scripts/orafind.py")) |
---|
137 | file_orasql_scripts_oradiff = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/orasql/scripts/oradiff.py")) |
---|
138 | file_orasql_scripts_oramerge = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/orasql/scripts/oramerge.py")) |
---|
139 | file_nightshade = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/nightshade.py")) |
---|
140 | file_scripts = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/scripts/__init__.py")) |
---|
141 | file_scripts_db2ul4 = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/scripts/db2ul4.py")) |
---|
142 | file_scripts_uls = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/scripts/uls.py")) |
---|
143 | file_scripts_ucp = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/scripts/ucp.py")) |
---|
144 | file_scripts_ucat = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.xist/src/ll/scripts/ucat.py")) |
---|
145 | file_pycoco = self.add(make.FileAction(here/repositorydir/"LivingLogic.Python.pycoco/src/pycoco/__init__.py")) |
---|
146 | |
---|
147 | # Data for Additional dependencies (News & Install) |
---|
148 | docdeps = { |
---|
149 | "xist/History": "LivingLogic.Python.xist/NEWS.rst", |
---|
150 | "xist/OldHistory": "LivingLogic.Python.xist/OLDNEWS.rst", |
---|
151 | "xist/Installation": "LivingLogic.Python.xist/INSTALL.rst", |
---|
152 | "xist/Howto": "LivingLogic.Python.xist/docs/XIST_Howto.xml", |
---|
153 | "xist/Advanced": "LivingLogic.Python.xist/docs/XIST_Advanced.xml", |
---|
154 | "xist/Searching": "LivingLogic.Python.xist/docs/XIST_Searching.xml", |
---|
155 | "xist/Transformation": "LivingLogic.Python.xist/docs/XIST_Transformation.xml", |
---|
156 | "xist/Misc": "LivingLogic.Python.xist/docs/XIST_Misc.xml", |
---|
157 | "xist/Examples": "LivingLogic.Python.xist/docs/XIST_Examples.xml", |
---|
158 | "xist/Migration": "LivingLogic.Python.xist/MIGRATION.rst", |
---|
159 | "xist/OldMigration": "LivingLogic.Python.xist/OLDMIGRATION.rst", |
---|
160 | "ul4/Howto": "LivingLogic.Python.xist/docs/UL4.rst", |
---|
161 | "url/Howto": "LivingLogic.Python.xist/docs/URL_Howto.xml", |
---|
162 | "aplora/History": "LivingLogic.Python.aplora/NEWS.rst", |
---|
163 | "aplora/Installation": "LivingLogic.Python.aplora/INSTALL.rst", |
---|
164 | "pycoco/History": "LivingLogic.Python.pycoco/NEWS.rst", |
---|
165 | "pycoco/Installation": "LivingLogic.Python.pycoco/INSTALL.rst", |
---|
166 | } |
---|
167 | |
---|
168 | # Docstring and module source dependencies |
---|
169 | moddeps = { |
---|
170 | "core/index": (file_core, file_xist_ns_doc), |
---|
171 | "url/index": (file_url, file_xist_ns_doc), |
---|
172 | "ul4/index": (file_ul4, file_xist_ns_doc), |
---|
173 | "make/index": (file_make, file_xist_ns_doc), |
---|
174 | "sisyphus/index": (file_sisyphus, file_xist_ns_doc), |
---|
175 | "daemon/index": (file_daemon, file_xist_ns_doc), |
---|
176 | "misc/index": (file_misc, file_xist_ns_doc), |
---|
177 | "color/index": (file_color, file_xist_ns_doc), |
---|
178 | "xist/index": (file_xist, file_xist_ns_doc), |
---|
179 | "xist/xsc/index": (file_xist_xsc, file_xist_ns_doc), |
---|
180 | "xist/ns/index": (file_xist_ns, file_xist_ns_doc), |
---|
181 | "xist/ns/html/index": (file_xist_ns_html, file_xist_ns_doc), |
---|
182 | "xist/ns/xml/index": (file_xist_ns_xml, file_xist_ns_doc), |
---|
183 | "xist/ns/wml/index": (file_xist_ns_wml, file_xist_ns_doc), |
---|
184 | "xist/ns/ihtml/index": (file_xist_ns_ihtml, file_xist_ns_doc), |
---|
185 | "xist/ns/docbook/index": (file_xist_ns_docbook, file_xist_ns_doc), |
---|
186 | "xist/ns/abbr/index": (file_xist_ns_abbr, file_xist_ns_doc), |
---|
187 | "xist/ns/cond/index": (file_xist_ns_cond, file_xist_ns_doc), |
---|
188 | "xist/ns/form/index": (file_xist_ns_form, file_xist_ns_doc), |
---|
189 | "xist/ns/php/index": (file_xist_ns_php, file_xist_ns_doc), |
---|
190 | "xist/ns/jsp/index": (file_xist_ns_jsp, file_xist_ns_doc), |
---|
191 | "xist/ns/meta/index": (file_xist_ns_meta, file_xist_ns_doc), |
---|
192 | "xist/ns/ruby/index": (file_xist_ns_ruby, file_xist_ns_doc), |
---|
193 | "xist/ns/specials/index": (file_xist_ns_specials, file_xist_ns_doc), |
---|
194 | "xist/ns/htmlspecials/index": (file_xist_ns_htmlspecials, file_xist_ns_doc), |
---|
195 | "xist/ns/struts_html/index": (file_xist_ns_strutshtml, file_xist_ns_doc), |
---|
196 | "xist/ns/struts_config/index": (file_xist_ns_strutsconfig, file_xist_ns_doc), |
---|
197 | "xist/ns/doc/index": (file_xist_ns_doc, ), |
---|
198 | "xist/ns/rng/index": (file_xist_ns_rng, file_xist_ns_doc), |
---|
199 | "xist/ns/kid/index": (file_xist_ns_kid, file_xist_ns_doc), |
---|
200 | "xist/ns/detox/index": (file_xist_ns_detox, file_xist_ns_doc), |
---|
201 | "xist/ns/toxic/index": (file_xist_ns_toxic, file_xist_ns_doc), |
---|
202 | "xist/parse/index": (file_xist_parse, file_xist_ns_doc), |
---|
203 | "xist/present/index": (file_xist_present, file_xist_ns_doc), |
---|
204 | "xist/sims/index": (file_xist_sims, file_xist_ns_doc), |
---|
205 | "xist/xfind/index": (file_xist_xfind, file_xist_ns_doc), |
---|
206 | "xist/css/index": (file_xist_css, file_xist_ns_doc), |
---|
207 | "xist/scripts/index": (file_xist_scripts, file_xist_ns_doc), |
---|
208 | "xist/scripts/dtd2xsc": (file_xist_scripts_dtd2xsc, file_xist_ns_doc), |
---|
209 | "xist/scripts/xml2xsc": (file_xist_scripts_xml2xsc, file_xist_ns_doc), |
---|
210 | "xist/scripts/tld2xsc": (file_xist_scripts_tld2xsc, file_xist_ns_doc), |
---|
211 | "xist/scripts/doc2txt": (file_xist_scripts_doc2txt, file_xist_ns_doc), |
---|
212 | "xist/scripts/uhpp": (file_xist_scripts_uhpp, file_xist_ns_doc), |
---|
213 | "oradd/index": (file_oradd, file_xist_ns_doc), |
---|
214 | "orasql/index": (file_orasql, file_xist_ns_doc), |
---|
215 | "orasql/scripts/index": (file_orasql_scripts, file_xist_ns_doc), |
---|
216 | "orasql/scripts/oracreate": (file_orasql_scripts_oracreate, file_xist_ns_doc), |
---|
217 | "orasql/scripts/oradrop": (file_orasql_scripts_oradrop, file_xist_ns_doc), |
---|
218 | "orasql/scripts/oradelete": (file_orasql_scripts_oradelete, file_xist_ns_doc), |
---|
219 | "orasql/scripts/oragrant": (file_orasql_scripts_oragrant, file_xist_ns_doc), |
---|
220 | "orasql/scripts/orafind": (file_orasql_scripts_orafind, file_xist_ns_doc), |
---|
221 | "orasql/scripts/oradiff": (file_orasql_scripts_oradiff, file_xist_ns_doc), |
---|
222 | "orasql/scripts/oramerge": (file_orasql_scripts_oramerge, file_xist_ns_doc), |
---|
223 | "nightshade/index": (file_nightshade, file_xist_ns_doc), |
---|
224 | "scripts/index": (file_scripts, file_xist_ns_doc), |
---|
225 | "scripts/db2ul4": (file_scripts_db2ul4, file_xist_ns_doc), |
---|
226 | "scripts/uls": (file_scripts_uls, file_xist_ns_doc), |
---|
227 | "scripts/ucp": (file_scripts_ucp, file_xist_ns_doc), |
---|
228 | "scripts/ucat": (file_scripts_ucat, file_xist_ns_doc), |
---|
229 | "pycoco/index": (file_pycoco, file_xist_ns_doc), |
---|
230 | } |
---|
231 | |
---|
232 | def makens(id): |
---|
233 | f1 = self.add(make.FileAction(srcdir/id)) |
---|
234 | buildid = builddir/id |
---|
235 | f2 = make.FileAction(buildid, f1) |
---|
236 | f2 = make.ModuleAction(f2) |
---|
237 | return f2 |
---|
238 | |
---|
239 | pynspool = make.CallAction(xsc.Pool, makens("Python_xmlns.py")) |
---|
240 | |
---|
241 | tree = make.ObjectAction(parse.tree) |
---|
242 | node = make.ObjectAction(parse.Node) |
---|
243 | pool = make.ObjectAction(xsc.Pool) |
---|
244 | |
---|
245 | for id in files: |
---|
246 | ext = id.ext |
---|
247 | if ext and ext.endswith("xsc"): |
---|
248 | newid = id.withext(ext[:-3]) |
---|
249 | |
---|
250 | path = str(id.withoutext().path) |
---|
251 | |
---|
252 | f = self.add(make.FileAction(srcdir/id)) |
---|
253 | |
---|
254 | collect = make.CollectAction(f) |
---|
255 | collect.addinputs(*auxFiles) |
---|
256 | |
---|
257 | if path in docdeps: |
---|
258 | docxml = self.add(make.FileAction(repositorydir/docdeps[path])) |
---|
259 | collect.addinputs(docxml) |
---|
260 | if path in moddeps: |
---|
261 | mods = moddeps[path] |
---|
262 | collect.addinputs(*mods) |
---|
263 | mod2 = self.add(make.FileAction(builddir/(path + "_module.py"), mods[0])) |
---|
264 | mod3 = self.add(make.FileAction(installdir/(path + "_module.py"), mod2).chmod(0o644)) |
---|
265 | build.addinputs(mod2) |
---|
266 | install.addinputs(mod3) |
---|
267 | |
---|
268 | f2 = tree.call( |
---|
269 | collect, |
---|
270 | parse.Expat(ns=True), |
---|
271 | node.call( |
---|
272 | pool=pool.call(chars, abbr, doc, specials, code, html, pynspool), |
---|
273 | base=root/newid |
---|
274 | ) |
---|
275 | ).callattr("conv").callattr("bytes", base=root/newid, publisher=publisher) |
---|
276 | f2 = make.FileAction(builddir/newid, f2) |
---|
277 | f3 = self.add(make.FileAction(installdir/newid, f2)) |
---|
278 | build.addinputs(f2) |
---|
279 | install.addinputs(f3) |
---|
280 | |
---|
281 | # Build alternate versions of the page |
---|
282 | # Source version of the page |
---|
283 | pagesrcid = id |
---|
284 | f2 = self.add(make.FileAction(builddir/pagesrcid, f)) |
---|
285 | f3 = self.add(make.FileAction(installdir/pagesrcid, f2).chmod(0o644)) |
---|
286 | build.addinputs(f2) |
---|
287 | install.addinputs(f3) |
---|
288 | |
---|
289 | # Plain text version of the page |
---|
290 | collect = f |
---|
291 | if path in docdeps or path in moddeps: |
---|
292 | collect = make.CollectAction(collect) |
---|
293 | if path in docdeps: |
---|
294 | collect.addinputs(docxml) |
---|
295 | if path in moddeps: |
---|
296 | mods = moddeps[path] |
---|
297 | collect.addinputs(*mods) |
---|
298 | |
---|
299 | txtid = id.withext("txt") |
---|
300 | t2 = tree.call( |
---|
301 | collect, |
---|
302 | parse.Expat(ns=True), |
---|
303 | node.call( |
---|
304 | pool=pool.call(chars, abbr, doc, specials, code, html, pynspool), |
---|
305 | base=root/txtid |
---|
306 | ) |
---|
307 | ).callattr("conv", target=html) |
---|
308 | t2 = make.CallAction(html.astext, t2).callattr("encode", "utf-8") |
---|
309 | t2 = make.FileAction(builddir/txtid, t2) |
---|
310 | |
---|
311 | t3 = self.add(make.FileAction(installdir/txtid, t2).chmod(0o644)) |
---|
312 | build.addinputs(t2) |
---|
313 | install.addinputs(t3) |
---|
314 | |
---|
315 | self.writecreatedone() |
---|
316 | |
---|
317 | |
---|
318 | p = Project() |
---|
319 | |
---|
320 | |
---|
321 | if __name__=="__main__": |
---|
322 | args = p.parseargs() |
---|
323 | if args.targets: |
---|
324 | p.create() |
---|
325 | p.build(*args.targets) |
---|
326 | else: |
---|
327 | p.create() |
---|