Index: tools/grit/grit/format/policy_templates/writers/admx_writer.py |
diff --git a/tools/grit/grit/format/policy_templates/writers/admx_writer.py b/tools/grit/grit/format/policy_templates/writers/admx_writer.py |
index 164175bdfed40b28570eaef21a9eebc55ea7ed37..1573d78719452b7b42f9f9683793d5402edeceee 100644 |
--- a/tools/grit/grit/format/policy_templates/writers/admx_writer.py |
+++ b/tools/grit/grit/format/policy_templates/writers/admx_writer.py |
@@ -157,11 +157,12 @@ class ADMXWriter(xml_formatted_writer.XMLFormattedWriter): |
'valueName': name, |
} |
self.AddElement(parent, 'text', attributes) |
- |
- def _AddEnumPolicy(self, parent, name, items): |
+ def _AddEnumPolicy(self, parent, policy): |
'''Generates ADMX elements for an Enum-Policy and adds them to the |
passed parent element. |
''' |
+ name = policy['name'] |
+ items = policy['items'] |
attributes = { |
'id': name, |
'valueName': name, |
@@ -172,7 +173,11 @@ class ADMXWriter(xml_formatted_writer.XMLFormattedWriter): |
item_elem = self.AddElement(enum_elem, 'item', attributes) |
value_elem = self.AddElement(item_elem, 'value') |
attributes = {'value': str(item['value'])} |
- self.AddElement(value_elem, 'decimal', attributes) |
+ if policy['type'] == 'int-enum': |
+ element_type = 'decimal' |
+ else: |
+ element_type = 'string' |
+ self.AddElement(value_elem, element_type, attributes) |
def _AddListPolicy(self, parent, name): |
'''Generates ADMX XML elements for a List-Policy and adds them to the |
@@ -249,9 +254,9 @@ class ADMXWriter(xml_formatted_writer.XMLFormattedWriter): |
elif policy_type == 'string': |
parent = self._GetElements(policy_elem) |
self._AddStringPolicy(parent, policy_name) |
- elif policy_type == 'enum': |
+ elif policy_type in ('int-enum', 'string-enum'): |
parent = self._GetElements(policy_elem) |
- self._AddEnumPolicy(parent, policy_name, policy['items']) |
+ self._AddEnumPolicy(parent, policy) |
elif policy_type == 'list': |
parent = self._GetElements(policy_elem) |
self._AddListPolicy(parent, policy_name) |