diff options
Diffstat (limited to 'tools/grit')
-rw-r--r-- | tools/grit/grit/format/policy_templates/writers/doc_writer.py | 4 | ||||
-rw-r--r-- | tools/grit/grit/format/policy_templates/writers/doc_writer_unittest.py | 35 |
2 files changed, 27 insertions, 12 deletions
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 1f4afe7..320e79d 100644 --- a/tools/grit/grit/format/policy_templates/writers/doc_writer.py +++ b/tools/grit/grit/format/policy_templates/writers/doc_writer.py @@ -171,7 +171,7 @@ class DocWriter(xml_formatted_writer.XMLFormattedWriter): self.AddElement(parent, 'dt', {}, 'Windows:') win = self._AddStyledElement(parent, 'dd', ['.monospace', '.pre']) win_text = [] - cnt = 0 + cnt = 1 for item in example_value: win_text.append( '%s\\%s\\%d = "%s"' % @@ -484,7 +484,7 @@ class DocWriter(xml_formatted_writer.XMLFormattedWriter): } # Human-readable names of supported features. self._FEATURE_MAP = { - 'dynamic_refresh': 'Dynamic Policy Refresh' + 'dynamic_refresh': self._GetLocalizedMessage('feature_dynamic_refresh') } # Human-readable names of types. self._TYPE_MAP = { diff --git a/tools/grit/grit/format/policy_templates/writers/doc_writer_unittest.py b/tools/grit/grit/format/policy_templates/writers/doc_writer_unittest.py index 8f1ec8c..7d9e1fb0 100644 --- a/tools/grit/grit/format/policy_templates/writers/doc_writer_unittest.py +++ b/tools/grit/grit/format/policy_templates/writers/doc_writer_unittest.py @@ -159,9 +159,9 @@ class DocWriterUnittest(writer_unittest_common.WriterUnittestCommon): policy = { 'type': 'enum', 'items': [ - {'value': '0', 'caption': 'Disable foo'}, - {'value': '2', 'caption': 'Solve your problem'}, - {'value': '5', 'caption': 'Enable bar'}, + {'value': 0, 'caption': 'Disable foo'}, + {'value': 2, 'caption': 'Solve your problem'}, + {'value': 5, 'caption': 'Enable bar'}, ], 'desc': '''This policy disables foo, except in case of bar. See http://policy-explanation.example.com for more details. @@ -203,11 +203,26 @@ See <a href="http://policy-explanation.example.com">http://policy-explanation.ex self.writer._AddListExample(self.doc_root, policy) self.assertEquals( self.doc_root.toxml(), - '''<root><dl style="style_dd dl;"><dt>Windows:</dt><dd style="style_.monospace;style_.pre;">MockKey\\PolicyName\\0 = "Foo" -MockKey\\PolicyName\\1 = "Bar"</dd><dt>Linux:</dt><dd style="style_.monospace;">["Foo", "Bar"]</dd><dt>Mac:</dt><dd style="style_.monospace;style_.pre;"><array> - <string>Foo</string> - <string>Bar</string> -</array></dd></dl></root>''') + '<root>' + '<dl style="style_dd dl;">' + '<dt>Windows:</dt>' + '<dd style="style_.monospace;style_.pre;">' + 'MockKey\\PolicyName\\1 = "Foo"\n' + 'MockKey\\PolicyName\\2 = "Bar"' + '</dd>' + '<dt>Linux:</dt>' + '<dd style="style_.monospace;">' + '["Foo", "Bar"]' + '</dd>' + '<dt>Mac:</dt>' + '<dd style="style_.monospace;style_.pre;">' + '<array>\n' + ' <string>Foo</string>\n' + ' <string>Bar</string>\n' + '</array>' + '</dd>' + '</dl>' + '</root>') def testBoolExample(self): # Test representation of boolean example values. @@ -311,7 +326,7 @@ MockKey\\PolicyName\\1 = "Bar"</dd><dt>Linux:</dt><dd style="style_.mo '</ul>' '</dd>' '<dt style="style_dt;">_test_supported_features</dt>' - '<dd>Dynamic Policy Refresh: _test_not_supported</dd>' + '<dd>_test_feature_dynamic_refresh: _test_not_supported</dd>' '<dt style="style_dt;">_test_description</dt><dd>TestPolicyDesc</dd>' '<dt style="style_dt;">_test_example_value</dt>' '<dd>0x00000000 (Windows), false (Linux), <false /> (Mac)</dd>' @@ -405,7 +420,7 @@ MockKey\\PolicyName\\1 = "Bar"</dd><dt>Linux:</dt><dd style="style_.mo '</ul>' '</dd>' '<dt style="style_dt;">_test_supported_features</dt>' - '<dd>Dynamic Policy Refresh: _test_not_supported</dd>' + '<dd>_test_feature_dynamic_refresh: _test_not_supported</dd>' '<dt style="style_dt;">_test_description</dt>' '<dd>PolicyDesc</dd>' '<dt style="style_dt;">_test_example_value</dt>' |