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 14 matching lines...) Expand all Loading... |
25 | 25 |
26 # The ADMX "policies" element that contains the ADMX "policy" elements that | 26 # The ADMX "policies" element that contains the ADMX "policy" elements that |
27 # are generated. | 27 # are generated. |
28 _active_policies_elem = None | 28 _active_policies_elem = None |
29 | 29 |
30 def _AdmlString(self, name): | 30 def _AdmlString(self, name): |
31 '''Creates a reference to the named string in an ADML file. | 31 '''Creates a reference to the named string in an ADML file. |
32 Args: | 32 Args: |
33 name: Name of the referenced ADML string. | 33 name: Name of the referenced ADML string. |
34 ''' | 34 ''' |
| 35 name = name.replace('.', '_') |
35 return '$(string.' + name + ')' | 36 return '$(string.' + name + ')' |
36 | 37 |
37 def _AdmlStringExplain(self, name): | 38 def _AdmlStringExplain(self, name): |
38 '''Creates a reference to the named explanation string in an ADML file. | 39 '''Creates a reference to the named explanation string in an ADML file. |
39 Args: | 40 Args: |
40 name: Name of the referenced ADML explanation. | 41 name: Name of the referenced ADML explanation. |
41 ''' | 42 ''' |
| 43 name = name.replace('.', '_') |
42 return '$(string.' + name + '_Explain)' | 44 return '$(string.' + name + '_Explain)' |
43 | 45 |
44 def _AdmlPresentation(self, name): | 46 def _AdmlPresentation(self, name): |
45 '''Creates a reference to the named presentation element in an ADML file. | 47 '''Creates a reference to the named presentation element in an ADML file. |
46 Args: | 48 Args: |
47 name: Name of the referenced ADML presentation element. | 49 name: Name of the referenced ADML presentation element. |
48 ''' | 50 ''' |
49 return '$(presentation.' + name + ')' | 51 return '$(presentation.' + name + ')' |
50 | 52 |
51 def _AddPolicyNamespaces(self, parent, prefix, namespace): | 53 def _AddPolicyNamespaces(self, parent, prefix, namespace): |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 self._AddCategories(self.config['win_recommended_category_path']) | 372 self._AddCategories(self.config['win_recommended_category_path']) |
371 self._active_policies_elem = self.AddElement(policy_definitions_elem, | 373 self._active_policies_elem = self.AddElement(policy_definitions_elem, |
372 'policies') | 374 'policies') |
373 self._active_mandatory_policy_group_name = \ | 375 self._active_mandatory_policy_group_name = \ |
374 self.config['win_mandatory_category_path'][-1] | 376 self.config['win_mandatory_category_path'][-1] |
375 self._active_recommended_policy_group_name = \ | 377 self._active_recommended_policy_group_name = \ |
376 self.config['win_recommended_category_path'][-1] | 378 self.config['win_recommended_category_path'][-1] |
377 | 379 |
378 def GetTemplateText(self): | 380 def GetTemplateText(self): |
379 return self.ToPrettyXml(self._doc) | 381 return self.ToPrettyXml(self._doc) |
OLD | NEW |