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

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

Issue 6360002: Remove 'annotations' dictionary in policy_definitions.json. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: better comments Created 9 years, 11 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: tools/grit/grit/format/policy_templates/writers/doc_writer.py
diff --git a/tools/grit/grit/format/policy_templates/writers/doc_writer.py b/tools/grit/grit/format/policy_templates/writers/doc_writer.py
index 1d3b7ef1f94ee388a57e3540d12c5c605aac0cb3..34f111e9faf641be06ce9bf592dcd01bc2df9fcb 100644
--- a/tools/grit/grit/format/policy_templates/writers/doc_writer.py
+++ b/tools/grit/grit/format/policy_templates/writers/doc_writer.py
@@ -136,7 +136,7 @@ class DocWriter(xml_formatted_writer.XMLFormattedWriter):
policy: The data structure of a policy.
'''
features = []
- for key, value in policy['annotations']['features'].iteritems():
+ for key, value in policy['features'].iteritems():
key_name = self._FEATURE_MAP[key]
if value == 0:
value_name = self._GetLocalizedMessage('not_supported')
@@ -153,7 +153,7 @@ class DocWriter(xml_formatted_writer.XMLFormattedWriter):
policy: A policy of type 'list', for which the Mac example value
is generated.
'''
- example_value = policy['annotations']['example_value']
+ example_value = policy['example_value']
self.AddElement(parent, 'dt', {}, 'Mac:')
mac = self._AddStyledElement(parent, 'dd', ['.monospace', '.pre'])
@@ -171,7 +171,7 @@ class DocWriter(xml_formatted_writer.XMLFormattedWriter):
policy: A policy of type 'list', for which the Windows example value
is generated.
'''
- example_value = policy['annotations']['example_value']
+ example_value = policy['example_value']
self.AddElement(parent, 'dt', {}, 'Windows:')
win = self._AddStyledElement(parent, 'dd', ['.monospace', '.pre'])
win_text = []
@@ -191,7 +191,7 @@ class DocWriter(xml_formatted_writer.XMLFormattedWriter):
policy: A policy of type 'list', for which the Linux example value
is generated.
'''
- example_value = policy['annotations']['example_value']
+ example_value = policy['example_value']
self.AddElement(parent, 'dt', {}, 'Linux:')
linux = self._AddStyledElement(parent, 'dd', ['.monospace'])
linux_text = []
@@ -223,7 +223,7 @@ class DocWriter(xml_formatted_writer.XMLFormattedWriter):
parent: The DOM node for which the example will be added.
policy: The data structure of a policy.
'''
- example_value = policy['annotations']['example_value']
+ example_value = policy['example_value']
examples = self._AddStyledElement(parent, 'dl', ['dd dl'])
self._AddListExampleWindows(examples, policy)
self._AddListExampleLinux(examples, policy)
@@ -244,7 +244,7 @@ class DocWriter(xml_formatted_writer.XMLFormattedWriter):
Exception: If the type of the policy is unknown or the example value
of the policy is out of its expected range.
'''
- example_value = policy['annotations']['example_value']
+ example_value = policy['example_value']
policy_type = policy['type']
if policy_type == 'main':
if example_value == True:
@@ -330,7 +330,6 @@ class DocWriter(xml_formatted_writer.XMLFormattedWriter):
parent: A DOM element for which the list will be added.
policy: The data structure of the policy.
'''
- annotations = policy['annotations']
dl = self.AddElement(parent, 'dl')
self._AddPolicyAttribute(
@@ -363,9 +362,9 @@ class DocWriter(xml_formatted_writer.XMLFormattedWriter):
Args:
policy: The data structure of the policy.
'''
- if 'problem_href' not in policy['annotations']:
+ if 'problem_href' not in policy:
return
- problem_href = policy['annotations']['problem_href']
+ problem_href = policy['problem_href']
div = self._AddStyledElement(parent, 'div', ['div.note'])
note = self._GetLocalizedMessage('note').replace('$6', problem_href)
self._AddTextWithLinks(div, note)
« no previous file with comments | « chrome/app/policy/policy_templates.json ('k') | tools/grit/grit/format/policy_templates/writers/doc_writer_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698