components/policy/tools/template_writers/writers/doc_writer.py
def _AddPolicySection(self, parent, policy):
    '''Adds a section about the policy in the detailed policy listing.

    Args:
      parent: The DOM node of the <div> of the detailed policy list.
      policy: The data structure of the policy.
    '''
    # Set style according to group nesting level.
    indent = 'margin-left: %dpx' % (self._indent_level * 28)
    if policy['type'] == 'group':
      heading = 'h2'
    else:
      heading = 'h3'
    parent2 = self.AddElement(parent, 'div', {'style': indent})

    h2 = self.AddElement(parent2, heading)
    self.AddElement(h2, 'a', {'name': policy['name']})
    if policy['type'] != 'group':
      # Normal policies get a full description.
      policy_name_text = policy['name']
      if 'deprecated' in policy and policy['deprecated'] == True:
        policy_name_text += " ("
        policy_name_text += self.GetLocalizedMessage('deprecated') + ")"
      self.AddText(h2, policy_name_text)
      self.AddElement(parent2, 'span', {}, policy['caption'])
      self._AddPolicyDetails(parent2, policy)
    else:
      # Groups get a more compact description.
      self.AddText(h2, policy['caption'])
      self._AddStyledElement(parent2, 'div', ['div.group_desc'], {},
                             policy['desc'])
    self.AddElement(parent2, 'a', {'href': '#top'},
                    self.GetLocalizedMessage('back_to_top'))
Adds a section about the policy in the detailed policy listing.

    Args:
      parent: The DOM node of the <div> of the detailed policy list.
      policy: The data structure of the policy.
    
Adds a section about the policy in the detailed policy listing.
Adds a section about the policy in the detailed policy listing .
def _AddPolicySection(self, parent, policy):
    indent = 'margin-left: %dpx' % (self._indent_level * 28)
    if policy['type'] == 'group':
      heading = 'h2'
    else:
      heading = 'h3'
    parent2 = self.AddElement(parent, 'div', {'style': indent})
    h2 = self.AddElement(parent2, heading)
    self.AddElement(h2, 'a', {'name': policy['name']})
    if policy['type'] != 'group':
      policy_name_text = policy['name']
      if 'deprecated' in policy and policy['deprecated'] == True:
        policy_name_text += " ("
        policy_name_text += self.GetLocalizedMessage('deprecated') + ")"
      self.AddText(h2, policy_name_text)
      self.AddElement(parent2, 'span', {}, policy['caption'])
      self._AddPolicyDetails(parent2, policy)
    else:
      self.AddText(h2, policy['caption'])
      self._AddStyledElement(parent2, 'div', ['div.group_desc'], {},
                             policy['desc'])
    self.AddElement(parent2, 'a', {'href': '#top'},
                    self.GetLocalizedMessage('back_to_top'))
def _AddPolicySection ( self , parent , policy ) : indent = 'margin-left: %dpx' % ( self . _indent_level * 28 ) if policy [ 'type' ] == 'group' : heading = 'h2' else : heading = 'h3' parent2 = self . AddElement ( parent , 'div' , { 'style' : indent } ) h2 = self . AddElement ( parent2 , heading ) self . AddElement ( h2 , 'a' , { 'name' : policy [ 'name' ] } ) if policy [ 'type' ] != 'group' : policy_name_text = policy [ 'name' ] if 'deprecated' in policy and policy [ 'deprecated' ] == True : policy_name_text += " (" policy_name_text += self . GetLocalizedMessage ( 'deprecated' ) + ")" self . AddText ( h2 , policy_name_text ) self . AddElement ( parent2 , 'span' , { } , policy [ 'caption' ] ) self . _AddPolicyDetails ( parent2 , policy ) else : self . AddText ( h2 , policy [ 'caption' ] ) self . _AddStyledElement ( parent2 , 'div' , [ 'div.group_desc' ] , { } , policy [ 'desc' ] ) self . AddElement ( parent2 , 'a' , { 'href' : '#top' } , self . GetLocalizedMessage ( 'back_to_top' ) )
Adds a section about the policy in the detailed policy listing.
Adds a section about the policy in the detailed policy listing .
'''Adds a section about the policy in the detailed policy listing.

    Args:
      parent: The DOM node of the <div> of the detailed policy list.
      policy: The data structure of the policy.
    ''' # Set style according to group nesting level. # Normal policies get a full description. # Groups get a more compact description.
self
parent
The DOM node of the  of the detailed policy list.
The DOM node of the of the detailed policy list .
policy
The data structure of the policy.
The data structure of the policy .