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

Unified Diff: grit/format/policy_templates/policy_template_generator.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 | « no previous file | grit/format/policy_templates/writers/adml_writer_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/format/policy_templates/policy_template_generator.py
===================================================================
--- grit/format/policy_templates/policy_template_generator.py (revision 158)
+++ grit/format/policy_templates/policy_template_generator.py (working copy)
@@ -5,7 +5,6 @@
import copy
-import types
class PolicyTemplateGenerator:
@@ -104,20 +103,6 @@
})
return result
- def _PrintPolicyValue(self, item):
- '''Produces a string representation for a policy value. Taking care to print
- dictionaries in a sorted order.'''
- if type(item) == types.StringType:
- str_val = "'%s'" % item
- elif isinstance(item, dict):
- str_val = "{";
- for it in sorted(item.iterkeys()):
- str_val += "\'%s\': %s, " % (it, self._PrintPolicyValue(item[it]))
- str_val = str_val.rstrip(", ") + "}";
- else:
- str_val = str(item)
- return str_val;
-
def _ProcessPolicy(self, policy):
'''Processes localized message strings in a policy or a group.
Also breaks up the content of 'supported_on' attribute into a list.
@@ -137,8 +122,6 @@
# Iterate through all the items of an enum-type policy, and add captions.
for item in policy['items']:
item['caption'] = self._ImportMessage(item['caption'])
- elif policy['type'] == 'dict' and 'example_value' in policy:
- policy['example_value'] = self._PrintPolicyValue(policy['example_value'])
if policy['type'] != 'group':
if not 'label' in policy:
# If 'label' is not specified, then it defaults to 'caption':
« no previous file with comments | « no previous file | grit/format/policy_templates/writers/adml_writer_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698