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

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

Issue 6176005: Support int-typed policies in policy template generator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/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 af567a8a82c9a1f17da756d761eae2561675ae94..68c41403b575195708fd032d3f890825441090b6 100644
--- a/tools/grit/grit/format/policy_templates/writers/plist_writer.py
+++ b/tools/grit/grit/format/policy_templates/writers/plist_writer.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2010 The Chromium Authors. All rights reserved.
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -24,6 +24,7 @@ class PListWriter(xml_formatted_writer.XMLFormattedWriter):
STRING_TABLE = 'Localizable.strings'
TYPE_TO_INPUT = {
'string': 'string',
+ 'int': 'integer',
'int-enum': 'integer',
'string-enum': 'string',
'main': 'boolean',
@@ -127,7 +128,7 @@ class PListWriter(xml_formatted_writer.XMLFormattedWriter):
# 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('><')
+ lines = xml[1:len(xml) - 1].split('><')
indent = ''
res = ''
# Determine indent for each line.
@@ -139,7 +140,7 @@ class PListWriter(xml_formatted_writer.XMLFormattedWriter):
indent = indent[2:]
lines[i] = indent + '<' + line + '>'
if (line[0] not in ['/', '?', '!'] and '</' not in line and
- line[len(line)-1] != '/'):
+ 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 += ' '

Powered by Google App Engine
This is Rietveld 408576698