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

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

Issue 7155025: Fix string-enums in ADMX templates (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: " Created 9 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: tools/grit/grit/format/policy_templates/writers/plist_writer.py
diff --git a/tools/grit/grit/format/policy_templates/writers/plist_writer.py b/tools/grit/grit/format/policy_templates/writers/plist_writer.py
index 1dc4da006289b37d00c9f73bf2e2bf8ef70b2d62..46ff0a4182a4a3c9e65be42edfe7d22edd54d0b8 100644
--- a/tools/grit/grit/format/policy_templates/writers/plist_writer.py
+++ b/tools/grit/grit/format/policy_templates/writers/plist_writer.py
@@ -123,29 +123,4 @@ class PListWriter(xml_formatted_writer.XMLFormattedWriter):
self._plist = self._doc.documentElement
def GetTemplateText(self):
- # return self.plist_doc.toprettyxml(indent=' ')
- # The above pretty-printer does not print the doctype and adds spaces
- # around texts, which the OSX Workgroup Manager does not like. So we use
- # the poor man's pretty printer. It assumes that there are no mixed-content
- # nodes.
- # Get all the XML content in a one-line string.
- xml = self._doc.toxml()
- # Determine where the line breaks will be. (They will only be between tags.)
- lines = xml[1:len(xml) - 1].split('><')
- indent = ''
- res = ''
- # Determine indent for each line.
- for i in range(len(lines)):
- line = lines[i]
- if line[0] == '/':
- # If the current line starts with a closing tag, decrease indent before
- # printing.
- indent = indent[2:]
- lines[i] = indent + '<' + line + '>'
- if (line[0] not in ['/', '?', '!'] and '</' not in line and
- line[len(line) - 1] != '/'):
- # If the current line starts with an opening tag and does not conatin a
- # closing tag, increase indent after the line is printed.
- indent += ' '
- # Reconstruct XML text from the lines.
- return '\n'.join(lines)
+ return self.ToPrettyXml(self._doc)

Powered by Google App Engine
This is Rietveld 408576698