Classes | Functions | Variables
google.protobuf.text_format Namespace Reference

Classes

class  _Parser
 
class  _Printer
 
class  Error
 
class  ParseError
 
class  TextWriter
 
class  Tokenizer
 

Functions

def _BuildMessageFromTypeName (type_name, descriptor_pool)
 
def _ConsumeInt32 (tokenizer)
 
def _ConsumeInt64 (tokenizer)
 
def _ConsumeInteger (tokenizer, is_signed=False, is_long=False)
 
def _ConsumeUint32 (tokenizer)
 
def _ConsumeUint64 (tokenizer)
 
def _IsMapEntry (field)
 
def _ParseAbstractInteger (text)
 
def _ParseAbstractInteger (text, is_long=False)
 
def _SkipField (tokenizer)
 
def _SkipFieldContents (tokenizer)
 
def _SkipFieldMessage (tokenizer)
 
def _SkipFieldValue (tokenizer)
 
def _TryConsumeInt64 (tokenizer)
 
def _TryConsumeInteger (tokenizer, is_signed=False, is_long=False)
 
def _TryConsumeUint64 (tokenizer)
 
def Merge (text, message, allow_unknown_extension=False, allow_field_number=False, descriptor_pool=None, allow_unknown_field=False)
 
def MergeLines (lines, message, allow_unknown_extension=False, allow_field_number=False, descriptor_pool=None, allow_unknown_field=False)
 
def MessageToBytes (message, **kwargs)
 
def MessageToString (message, as_utf8=False, as_one_line=False, use_short_repeated_primitives=False, pointy_brackets=False, use_index_order=False, float_format=None, double_format=None, use_field_number=False, descriptor_pool=None, indent=0, message_formatter=None, print_unknown_fields=False)
 
def MessageToString (message, as_utf8=False, as_one_line=False, use_short_repeated_primitives=False, pointy_brackets=False, use_index_order=False, float_format=None, double_format=None, use_field_number=False, descriptor_pool=None, indent=0, message_formatter=None, print_unknown_fields=False, force_colon=False)
 
def Parse (text, message, allow_unknown_extension=False, allow_field_number=False, descriptor_pool=None, allow_unknown_field=False)
 
def ParseBool (text)
 
def ParseEnum (field, value)
 
def ParseFloat (text)
 
def ParseInteger (text, is_signed=False, is_long=False)
 
def ParseLines (lines, message, allow_unknown_extension=False, allow_field_number=False, descriptor_pool=None, allow_unknown_field=False)
 
def PrintField (field, value, out, indent=0, as_utf8=False, as_one_line=False, use_short_repeated_primitives=False, pointy_brackets=False, use_index_order=False, float_format=None, double_format=None, message_formatter=None, print_unknown_fields=False)
 
def PrintField (field, value, out, indent=0, as_utf8=False, as_one_line=False, use_short_repeated_primitives=False, pointy_brackets=False, use_index_order=False, float_format=None, double_format=None, message_formatter=None, print_unknown_fields=False, force_colon=False)
 
def PrintFieldValue (field, value, out, indent=0, as_utf8=False, as_one_line=False, use_short_repeated_primitives=False, pointy_brackets=False, use_index_order=False, float_format=None, double_format=None, message_formatter=None, print_unknown_fields=False)
 
def PrintFieldValue (field, value, out, indent=0, as_utf8=False, as_one_line=False, use_short_repeated_primitives=False, pointy_brackets=False, use_index_order=False, float_format=None, double_format=None, message_formatter=None, print_unknown_fields=False, force_colon=False)
 
def PrintMessage (message, out, indent=0, as_utf8=False, as_one_line=False, use_short_repeated_primitives=False, pointy_brackets=False, use_index_order=False, float_format=None, double_format=None, use_field_number=False, descriptor_pool=None, message_formatter=None, print_unknown_fields=False)
 
def PrintMessage (message, out, indent=0, as_utf8=False, as_one_line=False, use_short_repeated_primitives=False, pointy_brackets=False, use_index_order=False, float_format=None, double_format=None, use_field_number=False, descriptor_pool=None, message_formatter=None, print_unknown_fields=False, force_colon=False)
 

Variables

list __all__
 
string __author__ = 'kenton@google.com (Kenton Varda)'
 
string _ANY_FULL_TYPE_NAME = 'google.protobuf.Any'
 
 _FLOAT_INFINITY = re.compile('-?inf(?:inity)?f?$', re.IGNORECASE)
 
 _FLOAT_NAN = re.compile('nanf?$', re.IGNORECASE)
 
tuple _INTEGER_CHECKERS
 
 _QUOTES = frozenset(("'", '"'))
 
 _Tokenizer = Tokenizer
 
 long = int
 
int WIRETYPE_LENGTH_DELIMITED = 2
 
int WIRETYPE_START_GROUP = 3
 

Function Documentation

◆ _BuildMessageFromTypeName()

def google.protobuf.text_format._BuildMessageFromTypeName (   type_name,
  descriptor_pool 
)
private
Returns a protobuf message instance.

Args:
  type_name: Fully-qualified protobuf  message type name string.
  descriptor_pool: DescriptorPool instance.

Returns:
  A Message instance of type matching type_name, or None if the a Descriptor
  wasn't found matching type_name.

Definition at line 280 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ _ConsumeInt32()

def google.protobuf.text_format._ConsumeInt32 (   tokenizer)
private
Consumes a signed 32bit integer number from tokenizer.

Args:
  tokenizer: A tokenizer used to parse the number.

Returns:
  The integer parsed.

Raises:
  ParseError: If a signed 32bit integer couldn't be consumed.

Definition at line 1528 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ _ConsumeInt64()

def google.protobuf.text_format._ConsumeInt64 (   tokenizer)
private
Consumes a signed 32bit integer number from tokenizer.

Args:
  tokenizer: A tokenizer used to parse the number.

Returns:
  The integer parsed.

Raises:
  ParseError: If a signed 32bit integer couldn't be consumed.

Definition at line 1566 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ _ConsumeInteger()

def google.protobuf.text_format._ConsumeInteger (   tokenizer,
  is_signed = False,
  is_long = False 
)
private
Consumes an integer number from tokenizer.

Args:
  tokenizer: A tokenizer used to parse the number.
  is_signed: True if a signed integer must be parsed.
  is_long: True if a long integer must be parsed.

Returns:
  The integer parsed.

Raises:
  ParseError: If an integer with given characteristics couldn't be consumed.

Definition at line 1612 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ _ConsumeUint32()

def google.protobuf.text_format._ConsumeUint32 (   tokenizer)
private
Consumes an unsigned 32bit integer number from tokenizer.

Args:
  tokenizer: A tokenizer used to parse the number.

Returns:
  The integer parsed.

Raises:
  ParseError: If an unsigned 32bit integer couldn't be consumed.

Definition at line 1543 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ _ConsumeUint64()

def google.protobuf.text_format._ConsumeUint64 (   tokenizer)
private
Consumes an unsigned 64bit integer number from tokenizer.

Args:
  tokenizer: A tokenizer used to parse the number.

Returns:
  The integer parsed.

Raises:
  ParseError: If an unsigned 64bit integer couldn't be consumed.

Definition at line 1589 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ _IsMapEntry()

def google.protobuf.text_format._IsMapEntry (   field)
private

◆ _ParseAbstractInteger() [1/2]

def google.protobuf.text_format._ParseAbstractInteger (   text)
private
Parses an integer without checking size/signedness.

Args:
  text: The text to parse.

Returns:
  The integer value.

Raises:
  ValueError: Thrown Iff the text is not a valid integer.

Definition at line 1682 of file protobuf/python/google/protobuf/text_format.py.

◆ _ParseAbstractInteger() [2/2]

def google.protobuf.text_format._ParseAbstractInteger (   text,
  is_long = False 
)
private
Parses an integer without checking size/signedness.

Args:
  text: The text to parse.
  is_long: True if the value should be returned as a long integer.

Returns:
  The integer value.

Raises:
  ValueError: Thrown Iff the text is not a valid integer.

Definition at line 1657 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ _SkipField()

def google.protobuf.text_format._SkipField (   tokenizer)
private
Skips over a complete field (name and value/message).

Args:
  tokenizer: A tokenizer to parse the field name and values.

Definition at line 1117 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ _SkipFieldContents()

def google.protobuf.text_format._SkipFieldContents (   tokenizer)
private
Skips over contents (value or message) of a field.

Args:
  tokenizer: A tokenizer to parse the field name and values.

Definition at line 1098 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ _SkipFieldMessage()

def google.protobuf.text_format._SkipFieldMessage (   tokenizer)
private
Skips over a field message.

Args:
  tokenizer: A tokenizer to parse the field name and values.

Definition at line 1140 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ _SkipFieldValue()

def google.protobuf.text_format._SkipFieldValue (   tokenizer)
private
Skips over a field value.

Args:
  tokenizer: A tokenizer to parse the field name and values.

Raises:
  ParseError: In case an invalid field value is found.

Definition at line 1159 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ _TryConsumeInt64()

def google.protobuf.text_format._TryConsumeInt64 (   tokenizer)
private

◆ _TryConsumeInteger()

def google.protobuf.text_format._TryConsumeInteger (   tokenizer,
  is_signed = False,
  is_long = False 
)
private

◆ _TryConsumeUint64()

def google.protobuf.text_format._TryConsumeUint64 (   tokenizer)
private

◆ Merge()

def google.protobuf.text_format.Merge (   text,
  message,
  allow_unknown_extension = False,
  allow_field_number = False,
  descriptor_pool = None,
  allow_unknown_field = False 
)
Parses a text representation of a protocol message into a message.

Like Parse(), but allows repeated values for a non-repeated field, and uses
the last one.

Args:
  text: Message text representation.
  message: A protocol buffer message to merge into.
  allow_unknown_extension: if True, skip over missing extensions and keep
    parsing
  allow_field_number: if True, both field number and field name are allowed.
  descriptor_pool: A DescriptorPool used to resolve Any types.
  allow_unknown_field: if True, skip over unknown field and keep
    parsing. Avoid to use this option if possible. It may hide some
    errors (e.g. spelling error on field name)

Returns:
  The same message passed as argument.

Raises:
  ParseError: On text parsing problems.
Parses a text representation of a protocol message into a message.

Like Parse(), but allows repeated values for a non-repeated field, and uses
the last one. This means any non-repeated, top-level fields specified in text
replace those in the message.

Args:
  text (str): Message text representation.
  message (Message): A protocol buffer message to merge into.
  allow_unknown_extension: if True, skip over missing extensions and keep
    parsing
  allow_field_number: if True, both field number and field name are allowed.
  descriptor_pool (DescriptorPool): Descriptor pool used to resolve Any types.
  allow_unknown_field: if True, skip over unknown field and keep
    parsing. Avoid to use this option if possible. It may hide some
    errors (e.g. spelling error on field name)

Returns:
  Message: The same message passed as argument.

Raises:
  ParseError: On text parsing problems.

Definition at line 659 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ MergeLines()

def google.protobuf.text_format.MergeLines (   lines,
  message,
  allow_unknown_extension = False,
  allow_field_number = False,
  descriptor_pool = None,
  allow_unknown_field = False 
)
Parses a text representation of a protocol message into a message.

Like ParseLines(), but allows repeated values for a non-repeated field, and
uses the last one.

Args:
  lines: An iterable of lines of a message's text representation.
  message: A protocol buffer message to merge into.
  allow_unknown_extension: if True, skip over missing extensions and keep
    parsing
  allow_field_number: if True, both field number and field name are allowed.
  descriptor_pool: A DescriptorPool used to resolve Any types.
  allow_unknown_field: if True, skip over unknown field and keep
    parsing. Avoid to use this option if possible. It may hide some
    errors (e.g. spelling error on field name)

Returns:
  The same message passed as argument.

Raises:
  ParseError: On text parsing problems.
Parses a text representation of a protocol message into a message.

See Merge() for more details.

Args:
  lines: An iterable of lines of a message's text representation.
  message: A protocol buffer message to merge into.
  allow_unknown_extension: if True, skip over missing extensions and keep
    parsing
  allow_field_number: if True, both field number and field name are allowed.
  descriptor_pool: A DescriptorPool used to resolve Any types.
  allow_unknown_field: if True, skip over unknown field and keep
    parsing. Avoid to use this option if possible. It may hide some
    errors (e.g. spelling error on field name)

Returns:
  The same message passed as argument.

Raises:
  ParseError: On text parsing problems.

Definition at line 728 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ MessageToBytes()

def google.protobuf.text_format.MessageToBytes (   message,
**  kwargs 
)
Convert protobuf message to encoded text format.  See MessageToString.

Definition at line 191 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ MessageToString() [1/2]

def google.protobuf.text_format.MessageToString (   message,
  as_utf8 = False,
  as_one_line = False,
  use_short_repeated_primitives = False,
  pointy_brackets = False,
  use_index_order = False,
  float_format = None,
  double_format = None,
  use_field_number = False,
  descriptor_pool = None,
  indent = 0,
  message_formatter = None,
  print_unknown_fields = False 
)
Convert protobuf message to text format.

Double values can be formatted compactly with 15 digits of
precision (which is the most that IEEE 754 "double" can guarantee)
using double_format='.15g'. To ensure that converting to text and back to a
proto will result in an identical value, double_format='.17g' should be used.

Args:
  message: The protocol buffers message.
  as_utf8: Return unescaped Unicode for non-ASCII characters.
      In Python 3 actual Unicode characters may appear as is in strings.
      In Python 2 the return value will be valid UTF-8 rather than only ASCII.
  as_one_line: Don't introduce newlines between fields.
  use_short_repeated_primitives: Use short repeated format for primitives.
  pointy_brackets: If True, use angle brackets instead of curly braces for
    nesting.
  use_index_order: If True, fields of a proto message will be printed using
    the order defined in source code instead of the field number, extensions
    will be printed at the end of the message and their relative order is
    determined by the extension number. By default, use the field number
    order.
  float_format: If set, use this to specify float field formatting
    (per the "Format Specification Mini-Language"); otherwise, 8 valid digits
    is used (default '.8g'). Also affect double field if double_format is
    not set but float_format is set.
  double_format: If set, use this to specify double field formatting
    (per the "Format Specification Mini-Language"); if it is not set but
    float_format is set, use float_format. Otherwise, use str()
  use_field_number: If True, print field numbers instead of names.
  descriptor_pool: A DescriptorPool used to resolve Any types.
  indent: The initial indent level, in terms of spaces, for pretty print.
  message_formatter: A function(message, indent, as_one_line): unicode|None
    to custom format selected sub-messages (usually based on message type).
    Use to pretty print parts of the protobuf for easier diffing.
  print_unknown_fields: If True, unknown fields will be printed.

Returns:
  A string of the text formatted protocol buffer message.

Definition at line 123 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ MessageToString() [2/2]

def google.protobuf.text_format.MessageToString (   message,
  as_utf8 = False,
  as_one_line = False,
  use_short_repeated_primitives = False,
  pointy_brackets = False,
  use_index_order = False,
  float_format = None,
  double_format = None,
  use_field_number = False,
  descriptor_pool = None,
  indent = 0,
  message_formatter = None,
  print_unknown_fields = False,
  force_colon = False 
)
Convert protobuf message to text format.

Double values can be formatted compactly with 15 digits of
precision (which is the most that IEEE 754 "double" can guarantee)
using double_format='.15g'. To ensure that converting to text and back to a
proto will result in an identical value, double_format='.17g' should be used.

Args:
  message: The protocol buffers message.
  as_utf8: Return unescaped Unicode for non-ASCII characters.
      In Python 3 actual Unicode characters may appear as is in strings.
      In Python 2 the return value will be valid UTF-8 rather than only ASCII.
  as_one_line: Don't introduce newlines between fields.
  use_short_repeated_primitives: Use short repeated format for primitives.
  pointy_brackets: If True, use angle brackets instead of curly braces for
    nesting.
  use_index_order: If True, fields of a proto message will be printed using
    the order defined in source code instead of the field number, extensions
    will be printed at the end of the message and their relative order is
    determined by the extension number. By default, use the field number
    order.
  float_format (str): If set, use this to specify float field formatting
    (per the "Format Specification Mini-Language"); otherwise, shortest float
    that has same value in wire will be printed. Also affect double field
    if double_format is not set but float_format is set.
  double_format (str): If set, use this to specify double field formatting
    (per the "Format Specification Mini-Language"); if it is not set but
    float_format is set, use float_format. Otherwise, use ``str()``
  use_field_number: If True, print field numbers instead of names.
  descriptor_pool (DescriptorPool): Descriptor pool used to resolve Any types.
  indent (int): The initial indent level, in terms of spaces, for pretty
    print.
  message_formatter (function(message, indent, as_one_line) -> unicode|None):
    Custom formatter for selected sub-messages (usually based on message
    type). Use to pretty print parts of the protobuf for easier diffing.
  print_unknown_fields: If True, unknown fields will be printed.
  force_colon: If set, a colon will be added after the field name even if the
    field is a proto message.

Returns:
  str: A string of the text formatted protocol buffer message.

Definition at line 113 of file protobuf/python/google/protobuf/text_format.py.

◆ Parse()

def google.protobuf.text_format.Parse (   text,
  message,
  allow_unknown_extension = False,
  allow_field_number = False,
  descriptor_pool = None,
  allow_unknown_field = False 
)
Parses a text representation of a protocol message into a message.

NOTE: for historical reasons this function does not clear the input
message. This is different from what the binary msg.ParseFrom(...) does.

Example
  a = MyProto()
  a.repeated_field.append('test')
  b = MyProto()

  text_format.Parse(repr(a), b)
  text_format.Parse(repr(a), b) # repeated_field contains ["test", "test"]

  # Binary version:
  b.ParseFromString(a.SerializeToString()) # repeated_field is now "test"

Caller is responsible for clearing the message as needed.

Args:
  text: Message text representation.
  message: A protocol buffer message to merge into.
  allow_unknown_extension: if True, skip over missing extensions and keep
    parsing
  allow_field_number: if True, both field number and field name are allowed.
  descriptor_pool: A DescriptorPool used to resolve Any types.
  allow_unknown_field: if True, skip over unknown field and keep
    parsing. Avoid to use this option if possible. It may hide some
    errors (e.g. spelling error on field name)

Returns:
  The same message passed as argument.

Raises:
  ParseError: On text parsing problems.
Parses a text representation of a protocol message into a message.

NOTE: for historical reasons this function does not clear the input
message. This is different from what the binary msg.ParseFrom(...) does.
If text contains a field already set in message, the value is appended if the
field is repeated. Otherwise, an error is raised.

Example::

  a = MyProto()
  a.repeated_field.append('test')
  b = MyProto()

  # Repeated fields are combined
  text_format.Parse(repr(a), b)
  text_format.Parse(repr(a), b) # repeated_field contains ["test", "test"]

  # Non-repeated fields cannot be overwritten
  a.singular_field = 1
  b.singular_field = 2
  text_format.Parse(repr(a), b) # ParseError

  # Binary version:
  b.ParseFromString(a.SerializeToString()) # repeated_field is now "test"

Caller is responsible for clearing the message as needed.

Args:
  text (str): Message text representation.
  message (Message): A protocol buffer message to merge into.
  allow_unknown_extension: if True, skip over missing extensions and keep
    parsing
  allow_field_number: if True, both field number and field name are allowed.
  descriptor_pool (DescriptorPool): Descriptor pool used to resolve Any types.
  allow_unknown_field: if True, skip over unknown field and keep
    parsing. Avoid to use this option if possible. It may hide some
    errors (e.g. spelling error on field name)

Returns:
  Message: The same message passed as argument.

Raises:
  ParseError: On text parsing problems.

Definition at line 610 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ ParseBool()

def google.protobuf.text_format.ParseBool (   text)
Parse a boolean value.

Args:
  text: Text to parse.

Returns:
  Boolean values parsed

Raises:
  ValueError: If text is not a valid boolean.

Definition at line 1721 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ ParseEnum()

def google.protobuf.text_format.ParseEnum (   field,
  value 
)
Parse an enum value.

The value can be specified by a number (the enum value), or by
a string literal (the enum name).

Args:
  field: Enum field descriptor.
  value: String value.

Returns:
  Enum value number.

Raises:
  ValueError: If the enum value could not be parsed.

Definition at line 1741 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ ParseFloat()

def google.protobuf.text_format.ParseFloat (   text)
Parse a floating point number.

Args:
  text: Text to parse.

Returns:
  The number parsed.

Raises:
  ValueError: If a floating point number couldn't be parsed.

Definition at line 1689 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ ParseInteger()

def google.protobuf.text_format.ParseInteger (   text,
  is_signed = False,
  is_long = False 
)
Parses an integer.

Args:
  text: The text to parse.
  is_signed: True if a signed integer must be parsed.
  is_long: True if a long integer must be parsed.

Returns:
  The integer value.

Raises:
  ValueError: Thrown Iff the text is not a valid integer.

Definition at line 1634 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ ParseLines()

def google.protobuf.text_format.ParseLines (   lines,
  message,
  allow_unknown_extension = False,
  allow_field_number = False,
  descriptor_pool = None,
  allow_unknown_field = False 
)
Parses a text representation of a protocol message into a message.

Args:
  lines: An iterable of lines of a message's text representation.
  message: A protocol buffer message to merge into.
  allow_unknown_extension: if True, skip over missing extensions and keep
    parsing
  allow_field_number: if True, both field number and field name are allowed.
  descriptor_pool: A DescriptorPool used to resolve Any types.
  allow_unknown_field: if True, skip over unknown field and keep
    parsing. Avoid to use this option if possible. It may hide some
    errors (e.g. spelling error on field name)

Returns:
  The same message passed as argument.

Raises:
  ParseError: On text parsing problems.
Parses a text representation of a protocol message into a message.

See Parse() for caveats.

Args:
  lines: An iterable of lines of a message's text representation.
  message: A protocol buffer message to merge into.
  allow_unknown_extension: if True, skip over missing extensions and keep
    parsing
  allow_field_number: if True, both field number and field name are allowed.
  descriptor_pool: A DescriptorPool used to resolve Any types.
  allow_unknown_field: if True, skip over unknown field and keep
    parsing. Avoid to use this option if possible. It may hide some
    errors (e.g. spelling error on field name)

Returns:
  The same message passed as argument.

Raises:
  ParseError: On text parsing problems.

Definition at line 696 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ PrintField() [1/2]

def google.protobuf.text_format.PrintField (   field,
  value,
  out,
  indent = 0,
  as_utf8 = False,
  as_one_line = False,
  use_short_repeated_primitives = False,
  pointy_brackets = False,
  use_index_order = False,
  float_format = None,
  double_format = None,
  message_formatter = None,
  print_unknown_fields = False 
)
Print a single field name/value pair.

Definition at line 236 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ PrintField() [2/2]

def google.protobuf.text_format.PrintField (   field,
  value,
  out,
  indent = 0,
  as_utf8 = False,
  as_one_line = False,
  use_short_repeated_primitives = False,
  pointy_brackets = False,
  use_index_order = False,
  float_format = None,
  double_format = None,
  message_formatter = None,
  print_unknown_fields = False,
  force_colon = False 
)
Print a single field name/value pair.

Definition at line 242 of file protobuf/python/google/protobuf/text_format.py.

◆ PrintFieldValue() [1/2]

def google.protobuf.text_format.PrintFieldValue (   field,
  value,
  out,
  indent = 0,
  as_utf8 = False,
  as_one_line = False,
  use_short_repeated_primitives = False,
  pointy_brackets = False,
  use_index_order = False,
  float_format = None,
  double_format = None,
  message_formatter = None,
  print_unknown_fields = False 
)
Print a single field value (not including name).

Definition at line 258 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ PrintFieldValue() [2/2]

def google.protobuf.text_format.PrintFieldValue (   field,
  value,
  out,
  indent = 0,
  as_utf8 = False,
  as_one_line = False,
  use_short_repeated_primitives = False,
  pointy_brackets = False,
  use_index_order = False,
  float_format = None,
  double_format = None,
  message_formatter = None,
  print_unknown_fields = False,
  force_colon = False 
)
Print a single field value (not including name).

Definition at line 266 of file protobuf/python/google/protobuf/text_format.py.

◆ PrintMessage() [1/2]

def google.protobuf.text_format.PrintMessage (   message,
  out,
  indent = 0,
  as_utf8 = False,
  as_one_line = False,
  use_short_repeated_primitives = False,
  pointy_brackets = False,
  use_index_order = False,
  float_format = None,
  double_format = None,
  use_field_number = False,
  descriptor_pool = None,
  message_formatter = None,
  print_unknown_fields = False 
)

◆ PrintMessage() [2/2]

def google.protobuf.text_format.PrintMessage (   message,
  out,
  indent = 0,
  as_utf8 = False,
  as_one_line = False,
  use_short_repeated_primitives = False,
  pointy_brackets = False,
  use_index_order = False,
  float_format = None,
  double_format = None,
  use_field_number = False,
  descriptor_pool = None,
  message_formatter = None,
  print_unknown_fields = False,
  force_colon = False 
)

Variable Documentation

◆ __all__

list google.protobuf.text_format.__all__
private
Initial value:
1 = ['MessageToString', 'Parse', 'PrintMessage', 'PrintField',
2  'PrintFieldValue', 'Merge', 'MessageToBytes']

Definition at line 62 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ __author__

string google.protobuf.text_format.__author__ = 'kenton@google.com (Kenton Varda)'
private

◆ _ANY_FULL_TYPE_NAME

string google.protobuf.text_format._ANY_FULL_TYPE_NAME = 'google.protobuf.Any'
private

◆ _FLOAT_INFINITY

google.protobuf.text_format._FLOAT_INFINITY = re.compile('-?inf(?:inity)?f?$', re.IGNORECASE)
private

◆ _FLOAT_NAN

google.protobuf.text_format._FLOAT_NAN = re.compile('nanf?$', re.IGNORECASE)
private

◆ _INTEGER_CHECKERS

tuple google.protobuf.text_format._INTEGER_CHECKERS
private
Initial value:
1 = (type_checkers.Uint32ValueChecker(),
2  type_checkers.Int32ValueChecker(),
3  type_checkers.Uint64ValueChecker(),
4  type_checkers.Int64ValueChecker())

Definition at line 65 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.

◆ _QUOTES

google.protobuf.text_format._QUOTES = frozenset(("'", '"'))
private

◆ _Tokenizer

google.protobuf.text_format._Tokenizer = Tokenizer
private

◆ long

google.protobuf.text_format.long = int

◆ WIRETYPE_LENGTH_DELIMITED

int google.protobuf.text_format.WIRETYPE_LENGTH_DELIMITED = 2

◆ WIRETYPE_START_GROUP

int google.protobuf.text_format.WIRETYPE_START_GROUP = 3


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:29