OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 from xml.dom import minidom | 6 from xml.dom import minidom |
7 from grit.format.policy_templates.writers import xml_formatted_writer | 7 from grit.format.policy_templates.writers import xml_formatted_writer |
8 | 8 |
9 | 9 |
10 def GetWriter(config): | 10 def GetWriter(config): |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 } | 160 } |
161 self.AddElement(definitions_elem, 'definition', attributes) | 161 self.AddElement(definitions_elem, 'definition', attributes) |
162 | 162 |
163 def _AddStringPolicy(self, parent, name): | 163 def _AddStringPolicy(self, parent, name): |
164 '''Generates ADMX elements for a String-Policy and adds them to the | 164 '''Generates ADMX elements for a String-Policy and adds them to the |
165 passed parent node. | 165 passed parent node. |
166 ''' | 166 ''' |
167 attributes = { | 167 attributes = { |
168 'id': name, | 168 'id': name, |
169 'valueName': name, | 169 'valueName': name, |
| 170 'maxLength': '1000000', |
170 } | 171 } |
171 self.AddElement(parent, 'text', attributes) | 172 self.AddElement(parent, 'text', attributes) |
172 | 173 |
173 def _AddIntPolicy(self, parent, name): | 174 def _AddIntPolicy(self, parent, name): |
174 '''Generates ADMX elements for an Int-Policy and adds them to the passed | 175 '''Generates ADMX elements for an Int-Policy and adds them to the passed |
175 parent node. | 176 parent node. |
176 ''' | 177 ''' |
177 attributes = { | 178 attributes = { |
178 'id': name, | 179 'id': name, |
179 'valueName': name, | 180 'valueName': name, |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 self._AddCategories(self.config['win_recommended_category_path']) | 369 self._AddCategories(self.config['win_recommended_category_path']) |
369 self._active_policies_elem = self.AddElement(policy_definitions_elem, | 370 self._active_policies_elem = self.AddElement(policy_definitions_elem, |
370 'policies') | 371 'policies') |
371 self._active_mandatory_policy_group_name = \ | 372 self._active_mandatory_policy_group_name = \ |
372 self.config['win_mandatory_category_path'][-1] | 373 self.config['win_mandatory_category_path'][-1] |
373 self._active_recommended_policy_group_name = \ | 374 self._active_recommended_policy_group_name = \ |
374 self.config['win_recommended_category_path'][-1] | 375 self.config['win_recommended_category_path'][-1] |
375 | 376 |
376 def GetTemplateText(self): | 377 def GetTemplateText(self): |
377 return self.ToPrettyXml(self._doc) | 378 return self.ToPrettyXml(self._doc) |
OLD | NEW |