Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: grit/format/policy_templates/writers/doc_writer.py

Issue 352163003: Added support for string-enum-list. (Closed) Base URL: https://chromium.googlesource.com/external/grit-i18n.git@master
Patch Set: Review feedback. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: grit/format/policy_templates/writers/doc_writer.py
diff --git a/grit/format/policy_templates/writers/doc_writer.py b/grit/format/policy_templates/writers/doc_writer.py
index 7cca9762a695c49c4db460479e9db12765583847..e8543c2128f5233fa4261da96dce7f61276e37a5 100644
--- a/grit/format/policy_templates/writers/doc_writer.py
+++ b/grit/format/policy_templates/writers/doc_writer.py
@@ -116,7 +116,7 @@ class DocWriter(xml_formatted_writer.XMLFormattedWriter):
# Replace URLs with links in the description.
self._AddTextWithLinks(parent, policy['desc'])
# Add list of enum items.
- if policy['type'] in ('string-enum', 'int-enum'):
+ if policy['type'] in ('string-enum', 'int-enum', 'string-enum-list'):
ul = self.AddElement(parent, 'ul')
for item in policy['items']:
if policy['type'] == 'int-enum':
@@ -379,7 +379,7 @@ class DocWriter(xml_formatted_writer.XMLFormattedWriter):
self.AddText(parent, ', '.join(pieces))
elif policy_type == 'string-enum':
self.AddText(parent, '"%s"' % (example_value))
- elif policy_type == 'list':
+ elif policy_type in ('list', 'string-enum-list'):
self._AddListExample(parent, policy)
elif policy_type == 'dict':
self._AddDictionaryExample(parent, policy)
@@ -640,6 +640,7 @@ class DocWriter(xml_formatted_writer.XMLFormattedWriter):
'int-enum': 'Integer',
'string-enum': 'String',
'list': 'List of strings',
+ 'string-enum-list': 'List of strings',
'dict': 'Dictionary',
'external': 'External data reference',
}

Powered by Google App Engine
This is Rietveld 408576698