parameters: (self, msg)
docstring: Apply substitutions to a tclib.Message object.
  
      Text of the form [message_name] will be replaced by a new placeholder,
      whose presentation will take the form the message_name_{UsageCount}, and
      whose example will be the message's value. Existing placeholders are
      not affected.
  
      Args:
        msg: A tclib.Message object.
  
      Returns:
        A tclib.Message object, with substitutions done.
docstring_summary: Apply substitutions to a tclib.Message object.
docstring_tokens: Apply substitutions to a tclib . Message object .
function: def SubstituteMessage(self, msg):
      '''Apply substitutions to a tclib.Message object.
  
      Text of the form [message_name] will be replaced by a new placeholder,
      whose presentation will take the form the message_name_{UsageCount}, and
      whose example will be the message's value. Existing placeholders are
      not affected.
  
      Args:
        msg: A tclib.Message object.
  
      Returns:
        A tclib.Message object, with substitutions done.
      '''
      from grit import tclib  # avoid circular import
      counts = {}
      text = msg.GetPresentableContent()
      placeholders = []
      newtext = ''
      for f in self.GetExp().split(text):
        sub = self._SubFragment(f)
        if f != sub:
          f = str(f)
          count = counts.get(f, 0) + 1
          counts[f] = count
          name = "%s_%d" % (f[1:-1], count)
          placeholders.append(tclib.Placeholder(name, f, sub))
          newtext += name
        else:
          newtext += f
      if placeholders:
        return tclib.Message(newtext, msg.GetPlaceholders() + placeholders,
                             msg.GetDescription(), msg.GetMeaning())
      else:
        return msg
function_tokens: def SubstituteMessage ( self , msg ) : from grit import tclib # avoid circular import counts = { } text = msg . GetPresentableContent ( ) placeholders = [ ] newtext = '' for f in self . GetExp ( ) . split ( text ) : sub = self . _SubFragment ( f ) if f != sub : f = str ( f ) count = counts . get ( f , 0 ) + 1 counts [ f ] = count name = "%s_%d" % ( f [ 1 : - 1 ] , count ) placeholders . append ( tclib . Placeholder ( name , f , sub ) ) newtext += name else : newtext += f if placeholders : return tclib . Message ( newtext , msg . GetPlaceholders ( ) + placeholders , msg . GetDescription ( ) , msg . GetMeaning ( ) ) else : return msg