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

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

Issue 692033002: Set the MAXLEN/maxLength attribute for strings in ADM[X] templates. (Closed) Base URL: https://chromium.googlesource.com/external/grit-i18n.git@master
Patch Set: fixed upload 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
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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698