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

Unified Diff: grit/format/policy_templates/writers/doc_writer.py

Issue 544113002: Add optional mandatory policy setting for template generation (Closed) Base URL: https://chromium.googlesource.com/external/grit-i18n.git@master
Patch Set: Adds unit tests, fixes doc and adm writer Created 6 years, 3 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: grit/format/policy_templates/writers/doc_writer.py
diff --git a/grit/format/policy_templates/writers/doc_writer.py b/grit/format/policy_templates/writers/doc_writer.py
index e8543c2128f5233fa4261da96dce7f61276e37a5..fbfdcf0e2afb26927d6d58867bb74004f160e7d7 100644
--- a/grit/format/policy_templates/writers/doc_writer.py
+++ b/grit/format/policy_templates/writers/doc_writer.py
@@ -458,10 +458,14 @@ class DocWriter(xml_formatted_writer.XMLFormattedWriter):
if policy['type'] != 'external':
# All types except 'external' can be set through platform policy.
if self.IsPolicySupportedOnPlatform(policy, 'win'):
+ if self.CanBeRecommended(policy) and not self.CanBeMandatory(policy):
+ win_key = self.config['win_reg_recommended_key_name']
+ else:
+ win_key = self.config['win_reg_mandatory_key_name']
self._AddPolicyAttribute(
dl,
'win_reg_loc',
- self.config['win_reg_mandatory_key_name'] + '\\' + policy['name'],
+ win_key + '\\' + policy['name'],
['.monospace'])
if (self.IsPolicySupportedOnPlatform(policy, 'linux') or
self.IsPolicySupportedOnPlatform(policy, 'mac')):

Powered by Google App Engine
This is Rietveld 408576698