summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-05-22 14:46:16 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-05-22 14:46:16 -0400
commit91fa382e6bd1b404d7f782ce20255dc2273daa13 (patch)
treeee18d535ee0abd5fdf3f5b011d9f35683b282d56
parent05dc19fd0cf88760218e98284ec5105982210610 (diff)
downloadbcfg2-91fa382e6bd1b404d7f782ce20255dc2273daa13.tar.gz
bcfg2-91fa382e6bd1b404d7f782ce20255dc2273daa13.tar.bz2
bcfg2-91fa382e6bd1b404d7f782ce20255dc2273daa13.zip
doc: fixed xmlschema extension error handling
-rw-r--r--doc/exts/xmlschema.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/doc/exts/xmlschema.py b/doc/exts/xmlschema.py
index 24cbf2e2d..e38436e7c 100644
--- a/doc/exts/xmlschema.py
+++ b/doc/exts/xmlschema.py
@@ -115,6 +115,7 @@ class _XMLDirective(Directive):
def run(self):
name = self.arguments[0]
env = self.state.document.settings.env
+ reporter = self.state.memo.reporter
ns_name = self.options.get('namespace')
try:
ns_uri = env.xmlschema_namespaces[ns_name]
@@ -129,8 +130,8 @@ class _XMLDirective(Directive):
except KeyError:
pass
else:
- env.app.error("No XML %s %s found" %
- (" or ".join(self.types), name))
+ reporter.error("No XML %s %s found" %
+ (" or ".join(self.types), name))
documentor = XMLDocumentor(entity, env, self.state, name=name,
ns_uri=ns_uri,
include=self.process_include(),
@@ -172,6 +173,7 @@ class XMLDocumentor(object):
self.include = include
self.options = options
self.app = self.env.app
+ self.reporter = self.state.memo.reporter
if name is None:
self.ns_uri = ns_uri
@@ -312,7 +314,7 @@ class XMLDocumentor(object):
rv.extend(doc.document_complexType())
return rv
else:
- self.app.error("Unknown element type %s" % fqtype)
+ self.reporter.error("Unknown element type %s" % fqtype)
else:
rv = []
typespec = self.entity.xpath("xs:complexType", namespaces=NSMAP)[0]