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

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

Issue 7155025: Fix string-enums in ADMX templates (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: " Created 9 years, 6 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/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 06863d8289a9c4b3ef3cc04167e4c4f28e8c97f1..da4aa6482d66718d1b05b7c5eec7713dad07a52c 100644
--- a/tools/grit/grit/format/policy_templates/writers/admx_writer.py
+++ b/tools/grit/grit/format/policy_templates/writers/admx_writer.py
@@ -183,12 +183,11 @@ class ADMXWriter(xml_formatted_writer.XMLFormattedWriter):
attributes = {'displayName': self._AdmlString(item['name'])}
item_elem = self.AddElement(enum_elem, 'item', attributes)
value_elem = self.AddElement(item_elem, 'value')
- attributes = {'value': str(item['value'])}
+ value_string = str(item['value'])
if policy['type'] == 'int-enum':
- element_type = 'decimal'
+ self.AddElement(value_elem, 'decimal', {'value': value_string})
else:
- element_type = 'string'
- self.AddElement(value_elem, element_type, attributes)
+ self.AddElement(value_elem, 'string', {}, value_string)
def _AddListPolicy(self, parent, name):
'''Generates ADMX XML elements for a List-Policy and adds them to the
@@ -325,4 +324,4 @@ class ADMXWriter(xml_formatted_writer.XMLFormattedWriter):
self._active_policy_group_name = self.config['win_category_path'][-1]
def GetTemplateText(self):
- return self._doc.toprettyxml(indent=' ')
+ return self.ToPrettyXml(self._doc)

Powered by Google App Engine
This is Rietveld 408576698