summaryrefslogtreecommitdiffstats
path: root/chromium/tools/grit/grit/format/policy_templates/policy_template_generator.py
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/tools/grit/grit/format/policy_templates/policy_template_generator.py')
-rw-r--r--chromium/tools/grit/grit/format/policy_templates/policy_template_generator.py34
1 files changed, 6 insertions, 28 deletions
diff --git a/chromium/tools/grit/grit/format/policy_templates/policy_template_generator.py b/chromium/tools/grit/grit/format/policy_templates/policy_template_generator.py
index e742b384b7b..11d097ebd66 100644
--- a/chromium/tools/grit/grit/format/policy_templates/policy_template_generator.py
+++ b/chromium/tools/grit/grit/format/policy_templates/policy_template_generator.py
@@ -5,7 +5,6 @@
import copy
-import types
class PolicyTemplateGenerator:
@@ -78,12 +77,6 @@ class PolicyTemplateGenerator:
for supported_on_item in supported_on:
product_platform_part, version_part = supported_on_item.split(':')
- # TODO(joaodasilva): enable parsing 'android' as a platform and including
- # that platform in the generated documentation. Just skip it for now to
- # prevent build failures.
- if product_platform_part == 'android':
- continue
-
if '.' in product_platform_part:
product, platform = product_platform_part.split('.')
if platform == '*':
@@ -94,11 +87,12 @@ class PolicyTemplateGenerator:
platforms = [platform]
else:
# e.g.: 'chrome_frame:7-'
- product = product_platform_part
- platform = {
- 'chrome_os': 'chrome_os',
- 'chrome_frame': 'win'
- }[product]
+ product, platform = {
+ 'android': ('chrome', 'android'),
+ 'chrome_os': ('chrome_os', 'chrome_os'),
+ 'chrome_frame': ('chrome_frame', 'win'),
+ 'ios': ('chrome', 'ios'),
+ }[product_platform_part]
platforms = [platform]
since_version, until_version = version_part.split('-')
result.append({
@@ -109,20 +103,6 @@ class PolicyTemplateGenerator:
})
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.
@@ -142,8 +122,6 @@ class PolicyTemplateGenerator:
# 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':