(self, data_value)
return u'"%s"' % value
Convert provided string to language specific literal.

    Subclasses should override as appropriate.

    Args:
      data_value: The DataValue object representing the value to be converted
        to a string literal.

    Returns:
      (str) Value written out as a string wrapped in double quotes.
Convert provided string to language specific literal.
Convert provided string to language specific literal .
def _String(self, data_value):
    """Convert provided string to language specific literal.

    Subclasses should override as appropriate.

    Args:
      data_value: The DataValue object representing the value to be converted
        to a string literal.

    Returns:
      (str) Value written out as a string wrapped in double quotes.
    """
    # TODO(user): Figure out a generalized solution to literal-related
    # information... replicating template_helpers.py escape information here
    # is bad practice.
    literal_escape = [
        ('\\', '\\\\'),
        ('"', '\\"'),
        ('\n', '\\n'),
        ('\t', '\\t'),
        ('\r', '\\r'),
        ('\f', '\\f'),
        ]
    value = unicode(data_value.value)
    for special, replacement in literal_escape:
      value = value.replace(special, replacement)
    return u'"%s"' % value
def _String ( self , data_value ) : # TODO(user): Figure out a generalized solution to literal-related # information... replicating template_helpers.py escape information here # is bad practice. literal_escape = [ ( '\\' , '\\\\' ) , ( '"' , '\\"' ) , ( '\n' , '\\n' ) , ( '\t' , '\\t' ) , ( '\r' , '\\r' ) , ( '\f' , '\\f' ) , ] value = unicode ( data_value . value ) for special , replacement in literal_escape : value = value . replace ( special , replacement ) return u'"%s"' % value