summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2010-04-07 19:28:57 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2010-05-06 15:41:42 +0100
commitafddfa3c8855cf1724df95c69b56b416c7846e21 (patch)
tree93bef53e8a479f7858e223f405cf077a72e12285
parent581ee23c6787ae63098d1d8eec893f0664d9996e (diff)
Display the errors section's introduction in the HTML
-rw-r--r--doc/templates/errors.html4
-rw-r--r--tools/specparser.py7
2 files changed, 11 insertions, 0 deletions
diff --git a/doc/templates/errors.html b/doc/templates/errors.html
index 0a4d52c9..82c08058 100644
--- a/doc/templates/errors.html
+++ b/doc/templates/errors.html
@@ -33,6 +33,10 @@
</table>
</div>
+ #if $spec.errors_section
+ $spec.errors_section.get_docstring()
+ #end if
+
<div class="outset errors error">
<a name="errors"></a>
<h1>Errors</h1>
diff --git a/tools/specparser.py b/tools/specparser.py
index 7937c131..6d87f14e 100644
--- a/tools/specparser.py
+++ b/tools/specparser.py
@@ -810,6 +810,10 @@ class Section(Base, SectionBase):
def get_root_namespace(self):
return None
+class ErrorsSection(Section):
+ def validate(self):
+ pass
+
class Spec(SectionBase):
def __init__(self, dom, spec_namespace):
# build a dictionary of errors in this spec
@@ -818,8 +822,11 @@ class Spec(SectionBase):
self.errors = build_dict(self, Error,
errorsnode.getAttribute('namespace'),
errorsnode.getElementsByTagNameNS(XMLNS_TP, 'error'))
+ self.errors_section = ErrorsSection(self, None, errorsnode,
+ spec_namespace)
except IndexError:
self.errors = {}
+ self.errors_section = None
self.sorted_errors = sorted(self.errors.values(),
key=lambda e: e.name)