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

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

Issue 227073006: Added a policy writer for iOS Plists. (Closed) Base URL: https://chromium.googlesource.com/external/grit-i18n.git@master
Patch Set: rebase Created 6 years, 8 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 | « grit/format/policy_templates/writers/reg_writer_unittest.py ('k') | grit/test_suite_all.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/format/policy_templates/writers/xml_formatted_writer.py
===================================================================
--- grit/format/policy_templates/writers/xml_formatted_writer.py (revision 158)
+++ grit/format/policy_templates/writers/xml_formatted_writer.py (working copy)
@@ -53,7 +53,11 @@
attribute.value = value
parent.setAttributeNode(attribute)
- def ToPrettyXml(self, doc):
+ def AddComment(self, parent, comment):
+ '''Adds a comment node.'''
+ parent.appendChild(parent.ownerDocument.createComment(comment))
+
+ def ToPrettyXml(self, doc, **kwargs):
# return doc.toprettyxml(indent=' ')
# The above pretty-printer does not print the doctype and adds spaces
# around texts, e.g.:
@@ -66,7 +70,7 @@
# So we use the poor man's pretty printer here. It assumes that there are
# no mixed-content nodes.
# Get all the XML content in a one-line string.
- xml = doc.toxml()
+ xml = doc.toxml(**kwargs)
# Determine where the line breaks will be. (They will only be between tags.)
lines = xml[1:len(xml) - 1].split('><')
indent = ''
« no previous file with comments | « grit/format/policy_templates/writers/reg_writer_unittest.py ('k') | grit/test_suite_all.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698