diff options
author | Dirk Baechle <dl9obn@darc.de> | 2013-05-03 23:15:51 (GMT) |
---|---|---|
committer | Dirk Baechle <dl9obn@darc.de> | 2013-05-03 23:15:51 (GMT) |
commit | 0947775a51fa7bdb446b40c08f417fe6ce1ebbdc (patch) | |
tree | f783e3547d18fdfb589c81aceb3d4251ecd20e2b /src | |
parent | 6885c3fd4f501aff9d5cde7b0bb3aedaf5b63e10 (diff) | |
download | SCons-0947775a51fa7bdb446b40c08f417fe6ce1ebbdc.zip SCons-0947775a51fa7bdb446b40c08f417fe6ce1ebbdc.tar.gz SCons-0947775a51fa7bdb446b40c08f417fe6ce1ebbdc.tar.bz2 |
- relinked the build of all documentation outputs to the bootstrap process
- corrected the doc folder SConscripts and added XSL and titlepage files where required
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/Tool/docbook/__init__.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/engine/SCons/Tool/docbook/__init__.py b/src/engine/SCons/Tool/docbook/__init__.py index b1c643d..d6713c6 100644 --- a/src/engine/SCons/Tool/docbook/__init__.py +++ b/src/engine/SCons/Tool/docbook/__init__.py @@ -163,7 +163,7 @@ xsltproc_com = {'xsltproc' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGE 'xalan' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -q -out $TARGET -xsl $DOCBOOK_XSL -in $SOURCE'} xmllint_com = {'xmllint' : '$DOCBOOK_XMLLINT $DOCBOOK_XMLLINTFLAGS --xinclude $SOURCE > $TARGET'} fop_com = {'fop' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -fo $SOURCE -pdf $TARGET', - 'xep' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -o $TARGET $SOURCE', + 'xep' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -valid -fo $SOURCE -pdf $TARGET', 'jw' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -f docbook -b pdf $SOURCE -o $TARGET'} def __detect_cl_tool(env, chainkey, cdict): @@ -292,15 +292,21 @@ def __build_lxml(target, source, env): xsl_style = env.subst('$DOCBOOK_XSL') xsl_tree = etree.parse(xsl_style) + transform = etree.XSLT(xsl_tree) doc = etree.parse(str(source[0])) # Support for additional parameters parampass = {} if parampass: - result = doc.xslt(xsl_tree, *parampass) + result = transform(doc, **parampass) else: - result = doc.xslt(xsl_tree) + result = transform(doc) - result.write(str(target[0]), pretty_print=True) + try: + of = open(str(target[0]), "w") + of.write(of.write(etree.tostring(result, pretty_print=True))) + of.close() + except: + pass return None @@ -324,9 +330,8 @@ def __xinclude_lxml(target, source, env): doc = etree.parse(str(source[0])) doc.xinclude() try: - of = open(str(target[0]), 'w') - of.write(str(doc)) - of.close() + doc.write(str(target[0]), xml_declaration=True, + encoding="UTF-8", pretty_print=True) except: pass |