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 62c762f1cbd962bbf93a37761c56231fbd9f9521..d8f108d27eaaaf257a1ef61940db7c52d0f627f2 100644 |
--- a/grit/format/policy_templates/writers/doc_writer.py |
+++ b/grit/format/policy_templates/writers/doc_writer.py |
@@ -180,7 +180,10 @@ class DocWriter(xml_formatted_writer.XMLFormattedWriter): |
win = self._AddStyledElement(parent, 'dd', ['.monospace', '.pre']) |
win_text = [] |
cnt = 1 |
- key_name = self.config['win_reg_mandatory_key_name'] |
+ if self.CanBeRecommended(policy) and not self.CanBeMandatory(policy): |
+ key_name = self.config['win_reg_recommended_key_name'] |
+ else: |
+ key_name = self.config['win_reg_mandatory_key_name'] |
for item in example_value: |
win_text.append( |
'%s\\%s\\%d = "%s"' % |
@@ -287,7 +290,10 @@ class DocWriter(xml_formatted_writer.XMLFormattedWriter): |
''' |
self.AddElement(parent, 'dt', {}, 'Windows:') |
win = self._AddStyledElement(parent, 'dd', ['.monospace', '.pre']) |
- key_name = self.config['win_reg_mandatory_key_name'] |
+ if self.CanBeRecommended(policy) and not self.CanBeMandatory(policy): |
+ key_name = self.config['win_reg_recommended_key_name'] |
+ else: |
+ key_name = self.config['win_reg_mandatory_key_name'] |
example = json.dumps(policy['example_value']) |
self.AddText(win, '%s\\%s = %s' % (key_name, policy['name'], example)) |
@@ -459,10 +465,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): |
+ key_name = self.config['win_reg_recommended_key_name'] |
+ else: |
+ key_name = self.config['win_reg_mandatory_key_name'] |
self._AddPolicyAttribute( |
dl, |
'win_reg_loc', |
- self.config['win_reg_mandatory_key_name'] + '\\' + policy['name'], |
+ key_name + '\\' + policy['name'], |
['.monospace']) |
if (self.IsPolicySupportedOnPlatform(policy, 'linux') or |
self.IsPolicySupportedOnPlatform(policy, 'mac')): |