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

Side by Side Diff: grit/format/policy_templates/writers/admx_writer.py

Issue 687073003: Set the MAXLEN/maxLength attribute for strings in ADM[X] templates. (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } 161 }
162 self.AddElement(definitions_elem, 'definition', attributes) 162 self.AddElement(definitions_elem, 'definition', attributes)
163 163
164 def _AddStringPolicy(self, parent, name): 164 def _AddStringPolicy(self, parent, name):
165 '''Generates ADMX elements for a String-Policy and adds them to the 165 '''Generates ADMX elements for a String-Policy and adds them to the
166 passed parent node. 166 passed parent node.
167 ''' 167 '''
168 attributes = { 168 attributes = {
169 'id': name, 169 'id': name,
170 'valueName': name, 170 'valueName': name,
171 'maxLength': '1000000',
171 } 172 }
172 self.AddElement(parent, 'text', attributes) 173 self.AddElement(parent, 'text', attributes)
173 174
174 def _AddIntPolicy(self, parent, name): 175 def _AddIntPolicy(self, parent, name):
175 '''Generates ADMX elements for an Int-Policy and adds them to the passed 176 '''Generates ADMX elements for an Int-Policy and adds them to the passed
176 parent node. 177 parent node.
177 ''' 178 '''
178 attributes = { 179 attributes = {
179 'id': name, 180 'id': name,
180 'valueName': name, 181 'valueName': name,
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 self._AddCategories(self.config['win_recommended_category_path']) 373 self._AddCategories(self.config['win_recommended_category_path'])
373 self._active_policies_elem = self.AddElement(policy_definitions_elem, 374 self._active_policies_elem = self.AddElement(policy_definitions_elem,
374 'policies') 375 'policies')
375 self._active_mandatory_policy_group_name = \ 376 self._active_mandatory_policy_group_name = \
376 self.config['win_mandatory_category_path'][-1] 377 self.config['win_mandatory_category_path'][-1]
377 self._active_recommended_policy_group_name = \ 378 self._active_recommended_policy_group_name = \
378 self.config['win_recommended_category_path'][-1] 379 self.config['win_recommended_category_path'][-1]
379 380
380 def GetTemplateText(self): 381 def GetTemplateText(self):
381 return self.ToPrettyXml(self._doc) 382 return self.ToPrettyXml(self._doc)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698