Merge "Updated the template guide."

This commit is contained in:
Zuul 2018-01-30 07:03:13 +00:00 committed by Gerrit Code Review
commit 54dd15cfd8
1 changed files with 12 additions and 2 deletions

View File

@ -203,7 +203,7 @@ resources:
return (x_status > y_status) - (x_status < y_status)
def contribute_property(self, parent, prop_key, prop, upd_para=None,
id_pattern_prefix=None):
id_pattern_prefix=None, sub_prop=False):
if not id_pattern_prefix:
id_pattern_prefix = '%s-prop'
id_pattern = id_pattern_prefix + '-' + prop_key
@ -218,6 +218,15 @@ resources:
definition.append(note)
return
if sub_prop and prop.type != properties.Schema.LIST and prop.type\
!= properties.Schema.MAP:
if prop.required:
para = nodes.paragraph('', _('Required.'))
definition.append(para)
else:
para = nodes.paragraph('', _('Optional.'))
definition.append(para)
if prop.description:
para = nodes.paragraph('', prop.description)
definition.append(para)
@ -272,7 +281,8 @@ resources:
indent = nodes.block_quote()
definition.append(indent)
self.contribute_property(
indent, _key, _prop, upd_para, id_pattern)
indent, _key, _prop, upd_para, id_pattern,
sub_prop=True)
def contribute_properties(self, parent):
if not self.props_schemata: