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

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

Issue 512733004: Fixed the example JSON strings for Windows and Linux. (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | grit/format/policy_templates/writers/doc_writer_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/format/policy_templates/writers/doc_writer.py
===================================================================
--- grit/format/policy_templates/writers/doc_writer.py (revision 173)
+++ grit/format/policy_templates/writers/doc_writer.py (working copy)
@@ -4,6 +4,7 @@
# found in the LICENSE file.
+import json
from xml.dom import minidom
from grit import lazy_re
from grit.format.policy_templates.writers import xml_formatted_writer
@@ -287,8 +288,8 @@
self.AddElement(parent, 'dt', {}, 'Windows:')
win = self._AddStyledElement(parent, 'dd', ['.monospace', '.pre'])
key_name = self.config['win_reg_mandatory_key_name']
- example = str(policy['example_value'])
- self.AddText(win, '%s\\%s = "%s"' % (key_name, policy['name'], example))
+ example = json.dumps(policy['example_value'])
+ self.AddText(win, '%s\\%s = %s' % (key_name, policy['name'], example))
def _AddDictionaryExampleLinux(self, parent, policy):
'''Adds an example value for Linux of a 'dict' policy to a DOM node.
@@ -300,7 +301,7 @@
'''
self.AddElement(parent, 'dt', {}, 'Linux:')
linux = self._AddStyledElement(parent, 'dd', ['.monospace'])
- example = str(policy['example_value'])
+ example = json.dumps(policy['example_value'])
self.AddText(linux, '%s: %s' % (policy['name'], example))
def _AddDictionaryExample(self, parent, policy):
« no previous file with comments | « no previous file | grit/format/policy_templates/writers/doc_writer_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698