components/policy/tools/template_writers/writers/template_writer.py
def WritePolicies(self, policy_list):
    '''Appends the template text corresponding to all the policies into the
    internal buffer.

    Args:
      policy_list: A list containing the policies to write.
    '''
    for policy in policy_list:
      if policy['type'] == 'group':
        child_policies = list(self._GetPoliciesForWriter(policy))
        child_recommended_policies = list(
            filter(self.CanBeRecommended, child_policies))
        if child_policies:
          # Only write nonempty groups.
          self.BeginPolicyGroup(policy)
          for child_policy in child_policies:
            # Nesting of groups is currently not supported.
            self.WritePolicy(child_policy)
          self.EndPolicyGroup()
        if child_recommended_policies:
          self.BeginRecommendedPolicyGroup(policy)
          for child_policy in child_recommended_policies:
            self.WriteRecommendedPolicy(child_policy)
          self.EndRecommendedPolicyGroup()
      elif self.IsPolicySupported(policy):
        self.WritePolicy(policy)
        if self.CanBeRecommended(policy):
          self.WriteRecommendedPolicy(policy)
Appends the template text corresponding to all the policies into the
    internal buffer.

    Args:
      policy_list: A list containing the policies to write.
    
Appends the template text corresponding to all the policies into the
internal buffer.
Appends the template text corresponding to all the policies into the internal buffer .
def WritePolicies(self, policy_list):
    for policy in policy_list:
      if policy['type'] == 'group':
        child_policies = list(self._GetPoliciesForWriter(policy))
        child_recommended_policies = list(
            filter(self.CanBeRecommended, child_policies))
        if child_policies:
          self.BeginPolicyGroup(policy)
          for child_policy in child_policies:
            self.WritePolicy(child_policy)
          self.EndPolicyGroup()
        if child_recommended_policies:
          self.BeginRecommendedPolicyGroup(policy)
          for child_policy in child_recommended_policies:
            self.WriteRecommendedPolicy(child_policy)
          self.EndRecommendedPolicyGroup()
      elif self.IsPolicySupported(policy):
        self.WritePolicy(policy)
        if self.CanBeRecommended(policy):
          self.WriteRecommendedPolicy(policy)
def WritePolicies ( self , policy_list ) : for policy in policy_list : if policy [ 'type' ] == 'group' : child_policies = list ( self . _GetPoliciesForWriter ( policy ) ) child_recommended_policies = list ( filter ( self . CanBeRecommended , child_policies ) ) if child_policies : self . BeginPolicyGroup ( policy ) for child_policy in child_policies : self . WritePolicy ( child_policy ) self . EndPolicyGroup ( ) if child_recommended_policies : self . BeginRecommendedPolicyGroup ( policy ) for child_policy in child_recommended_policies : self . WriteRecommendedPolicy ( child_policy ) self . EndRecommendedPolicyGroup ( ) elif self . IsPolicySupported ( policy ) : self . WritePolicy ( policy ) if self . CanBeRecommended ( policy ) : self . WriteRecommendedPolicy ( policy )
Appends the template text corresponding to all the policies into the
internal buffer.
Appends the template text corresponding to all the policies into the internal buffer .
'''Appends the template text corresponding to all the policies into the
    internal buffer.

    Args:
      policy_list: A list containing the policies to write.
    ''' # Only write nonempty groups. # Nesting of groups is currently not supported.
self
policy_list
A list containing the policies to write.
A list containing the policies to write .