summaryrefslogtreecommitdiffstats
path: root/doc/exts
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-01-03 13:40:24 -0600
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-01-03 13:40:24 -0600
commit14406cc14a4d832fe83df5da27937051e41dd093 (patch)
tree1fb429513bc5483251412af8251aa24517bcbb68 /doc/exts
parent10326a34dd813b88c6c8816115e91977a93a1f10 (diff)
downloadbcfg2-14406cc14a4d832fe83df5da27937051e41dd093.tar.gz
bcfg2-14406cc14a4d832fe83df5da27937051e41dd093.tar.bz2
bcfg2-14406cc14a4d832fe83df5da27937051e41dd093.zip
Cfg: Added feature to provide generation of SSH keys, authorized_keys file
Diffstat (limited to 'doc/exts')
-rw-r--r--doc/exts/xmlschema.py37
1 files changed, 27 insertions, 10 deletions
diff --git a/doc/exts/xmlschema.py b/doc/exts/xmlschema.py
index fc5788107..81affc610 100644
--- a/doc/exts/xmlschema.py
+++ b/doc/exts/xmlschema.py
@@ -299,15 +299,24 @@ class XMLDocumentor(object):
def document_complexType(self):
rv = nodes.definition_list()
+ content = self.entity.find("xs:simpleContent", namespaces=NSMAP)
+ if content is not None:
+ base = content.xpath("xs:extension|xs:restriction",
+ namespaces=NSMAP)[0]
+ attr_container = base
+ else:
+ base = None
+ attr_container = self.entity
+
##### ATTRIBUTES #####
table, tbody = self.get_attr_table()
- attrs = self.get_attrs(self.entity)
+ attrs = self.get_attrs(attr_container)
if attrs:
tbody.extend(attrs)
foreign_attr_groups = nodes.bullet_list()
- for agroup in self.entity.xpath("xs:attributeGroup",
- namespaces=NSMAP):
+ for agroup in attr_container.xpath("xs:attributeGroup",
+ namespaces=NSMAP):
# if the attribute group is in another namespace, just
# link to it
ns, name = self.split_ns(agroup.get('ref'))
@@ -349,11 +358,17 @@ class XMLDocumentor(object):
append_node(rv, nodes.definition, *groups)
##### TEXT CONTENT #####
- if (self.include['text'] and
- self.entity.get("mixed", "false").lower() == "true"):
- append_node(rv, nodes.term, text("Text content:"))
- append_node(rv, nodes.definition,
- build_paragraph(self.get_values_from_simpletype()))
+ if self.include['text']:
+ if self.entity.get("mixed", "false").lower() == "true":
+ append_node(rv, nodes.term, text("Text content:"))
+ append_node(rv, nodes.definition,
+ build_paragraph(self.get_values_from_simpletype()))
+ elif base is not None:
+ append_node(rv, nodes.term, text("Text content:"))
+ append_node(
+ rv, nodes.definition,
+ build_paragraph(self.get_values_from_simpletype(content)))
+
return [rv]
def document_attributeGroup(self):
@@ -544,8 +559,10 @@ class XMLDocumentor(object):
if entity is None:
entity = self.entity
# todo: xs:union, xs:list
- restriction = entity.find("xs:restriction", namespaces=NSMAP)
- if restriction is None:
+ try:
+ restriction = entity.xpath("xs:restriction|xs:extension",
+ namespaces=NSMAP)[0]
+ except IndexError:
return "Any"
doc = self.get_doc(restriction)
if len(doc) == 1 and len(doc[0]) == 0: