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

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

Issue 5958014: Policy: Add ProxyMode and deprecate ProxyServerMode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: small tweaks Created 10 years 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 87e9db95735dd4ca789f631428ee316a13c71b8d..63da4cfa4611f60b433dc5651515984fe45aff06 100644
--- a/tools/grit/grit/format/policy_templates/writers/plist_writer.py
+++ b/tools/grit/grit/format/policy_templates/writers/plist_writer.py
@@ -24,7 +24,8 @@ class PListWriter(xml_formatted_writer.XMLFormattedWriter):
STRING_TABLE = 'Localizable.strings'
TYPE_TO_INPUT = {
'string': 'string',
- 'enum': 'integer',
+ 'int-enum': 'integer',
+ 'string-enum': 'string',
'main': 'boolean',
'list': 'array',
}
@@ -85,10 +86,14 @@ class PListWriter(xml_formatted_writer.XMLFormattedWriter):
self._AddTargets(dict)
self._AddStringKeyValuePair(dict, 'pfm_type',
self.TYPE_TO_INPUT[policy_type])
- if (policy_type == 'enum'):
+ if (policy_type == 'int-enum'):
gfeher 2011/01/03 10:30:10 Please merge handling of 'int-enum' and 'string-en
danno 2011/01/07 12:24:25 Done.
range_list = self._AddKeyValuePair(dict, 'pfm_range_list', 'array')
for item in policy['items']:
- self.AddElement(range_list, 'integer', {}, item['value'])
+ self.AddElement(range_list, 'integer', {}, str(item['value']))
+ if (policy_type == 'string-enum'):
+ range_list = self._AddKeyValuePair(dict, 'pfm_range_list', 'array')
+ for item in policy['items']:
+ self.AddElement(range_list, 'string', {}, item['value'])
def BeginTemplate(self):
self._plist.attributes['version'] = '1'

Powered by Google App Engine
This is Rietveld 408576698