mirror of https://github.com/tLDP/python-tldp
add a broken example docbook4xml file
This commit is contained in:
parent
30594d5e4e
commit
6d2040c671
|
@ -14,6 +14,13 @@ opd = os.path.dirname
|
||||||
opa = os.path.abspath
|
opa = os.path.abspath
|
||||||
sampledocs = opa(opj(opd(__file__), 'sample-documents'))
|
sampledocs = opa(opj(opd(__file__), 'sample-documents'))
|
||||||
|
|
||||||
|
|
||||||
|
def load_content(ex):
|
||||||
|
with codecs.open(ex.filename, encoding='utf-8') as f:
|
||||||
|
ex.content = f.read()
|
||||||
|
ex.stem, ex.ext = stem_and_ext(ex.filename)
|
||||||
|
|
||||||
|
|
||||||
ex_linuxdoc = Namespace(
|
ex_linuxdoc = Namespace(
|
||||||
doctype=tldp.doctypes.linuxdoc.Linuxdoc,
|
doctype=tldp.doctypes.linuxdoc.Linuxdoc,
|
||||||
filename=opj(sampledocs, 'linuxdoc-simple.sgml'),
|
filename=opj(sampledocs, 'linuxdoc-simple.sgml'),
|
||||||
|
@ -67,18 +74,24 @@ ex_docbooksgml_dir = Namespace(
|
||||||
'DocBookSGML-Larger.sgml'),
|
'DocBookSGML-Larger.sgml'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# -- a bit ugly, but grab each dict
|
||||||
|
sources = [y for x, y in locals().items() if x.startswith('ex_')]
|
||||||
|
|
||||||
|
for ex in sources:
|
||||||
|
load_content(ex)
|
||||||
|
|
||||||
|
|
||||||
unknown_doctype = Namespace(
|
unknown_doctype = Namespace(
|
||||||
doctype=None,
|
doctype=None,
|
||||||
filename=opj(sampledocs, 'Unknown-Doctype.xqf'),
|
filename=opj(sampledocs, 'Unknown-Doctype.xqf'),
|
||||||
)
|
)
|
||||||
|
|
||||||
# -- a bit ugly, but grab each dict
|
broken_docbook4xml = Namespace(
|
||||||
sources = [y for x, y in locals().items() if x.startswith('ex_')]
|
doctype=tldp.doctypes.docbook4xml.Docbook4XML,
|
||||||
|
filename=opj(sampledocs, 'docbook4xml-broken.xml'),
|
||||||
|
)
|
||||||
|
load_content(broken_docbook4xml)
|
||||||
|
|
||||||
for ex in sources:
|
|
||||||
with codecs.open(ex.filename, encoding='utf-8') as f:
|
|
||||||
ex.content = f.read()
|
|
||||||
ex.stem, ex.ext = stem_and_ext(ex.filename)
|
|
||||||
|
|
||||||
|
|
||||||
# -- end of file
|
# -- end of file
|
||||||
|
|
Loading…
Reference in New Issue