2016-02-13 07:48:48 +00:00
|
|
|
|
|
|
|
from __future__ import absolute_import, division, print_function
|
|
|
|
|
2016-02-13 18:39:26 +00:00
|
|
|
import os
|
|
|
|
|
2016-02-13 07:48:48 +00:00
|
|
|
import tldp.doctypes
|
|
|
|
|
2016-02-13 18:39:26 +00:00
|
|
|
datadir = os.path.join(os.path.dirname(__file__), 'testdata')
|
|
|
|
|
2016-02-13 07:48:48 +00:00
|
|
|
ex_linuxdoc = {
|
|
|
|
'ext': '.sgml',
|
|
|
|
'type': tldp.doctypes.linuxdoc.Linuxdoc,
|
2016-02-13 18:39:26 +00:00
|
|
|
'filename': os.path.join(datadir, 'linuxdoc-simple.sgml'),
|
2016-02-13 07:48:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ex_docbooksgml = {
|
|
|
|
'ext': '.sgml',
|
|
|
|
'type': tldp.doctypes.docbooksgml.DocbookSGML,
|
2016-02-13 18:39:26 +00:00
|
|
|
'filename': os.path.join(datadir, 'docbooksgml-simple.sgml'),
|
2016-02-13 07:48:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ex_docbook4xml = {
|
|
|
|
'ext': '.xml',
|
|
|
|
'type': tldp.doctypes.docbook4xml.Docbook4XML,
|
2016-02-13 18:39:26 +00:00
|
|
|
'filename': os.path.join(datadir, 'docbook4xml-simple.xml'),
|
2016-02-13 07:48:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ex_docbook5xml = {
|
|
|
|
'ext': '.xml',
|
|
|
|
'type': tldp.doctypes.docbook5xml.Docbook5XML,
|
2016-02-13 18:39:26 +00:00
|
|
|
'filename': os.path.join(datadir, 'docbook5xml-simple.xml'),
|
2016-02-13 07:48:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ex_rst = {
|
|
|
|
'ext': '.rst',
|
|
|
|
'type': tldp.doctypes.rst.RestructuredText,
|
2016-02-13 18:39:26 +00:00
|
|
|
'filename': os.path.join(datadir, 'restructuredtext-simple.rst'),
|
2016-02-13 07:48:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ex_text = {
|
|
|
|
'ext': '.txt',
|
|
|
|
'type': tldp.doctypes.text.Text,
|
2016-02-13 18:39:26 +00:00
|
|
|
'filename': os.path.join(datadir, 'text-simple.txt'),
|
2016-02-13 07:48:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ex_markdown = {
|
|
|
|
'ext': '.md',
|
|
|
|
'type': tldp.doctypes.markdown.Markdown,
|
2016-02-13 18:39:26 +00:00
|
|
|
'filename': os.path.join(datadir, 'markdown-simple.md'),
|
2016-02-13 07:48:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-02-13 18:39:26 +00:00
|
|
|
# -- a bit ugly, but grab each dict
|
|
|
|
examples = [y for x, y in locals().items() if x.startswith('ex_')]
|
|
|
|
|
|
|
|
for ex in examples:
|
|
|
|
ex['content'] = open(ex['filename']).read()
|
|
|
|
|
|
|
|
|
2016-02-13 07:48:48 +00:00
|
|
|
# -- end of file
|