Module Expr Str Assign NameStore Str ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign AttributeStore NameLoad attr BoolOpOr NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Dict decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareNotIn AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad TupleLoad AttributeLoad NameLoad attr Dict Str Str NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr NameLoad For NameStore AttributeLoad NameLoad attr body If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr For NameStore AttributeLoad AttributeLoad NameLoad attr attr body If CompareNotIn AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad Return SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Dict For NameStore NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad For TupleStore NameStore NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr body If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad Str attr ListLoad AttributeLoad NameLoad attr NameLoad orelse Assign NameStore AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad For TupleStore NameStore NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr body If CompareNotIn AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list decorator_list Assign NameStore Call NameLoad FunctionDef arguments args NameParam defaults body Expr Str For NameStore NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Call AttributeLoad NameLoad attr ListComp AttributeLoad NameLoad attr comprehension NameStore NameLoad decorator_list
N/A N/A Provides a factory class for generating dynamic messages.

The easiest way to use this class is if you have access to the FileDescriptor
protos containing the messages you want to create you can just do the following:

message_classes = message_factory.GetMessages(iterable_of_file_descriptors)
my_proto_instance = message_classes['some.proto.package.MessageName']()
 N/A __author__ matthewtoia@google.com (Matt Toia) google.protobuf descriptor_database google.protobuf descriptor_pool google.protobuf message google.protobuf reflection MessageFactory N/A object N/A N/A Factory for creating Proto2 messages from descriptors in a pool. __init__ N/A N/A self pool N/A None N/A N/A Initializes a new factory. N/A N/A self pool N/A pool N/A N/A descriptor_pool DescriptorPool N/A N/A descriptor_database DescriptorDatabase N/A N/A self _classes N/A N/A GetPrototype N/A N/A self descriptor N/A N/A N/A Builds a proto2 message class based on the passed in descriptor.

    Passing a descriptor with a fully qualified name matching a previous
    invocation will cause the same class to be returned.

    Args:
      descriptor: The descriptor to build from.

    Returns:
      A class describing the passed in descriptor.
     N/A N/A N/A descriptor full_name N/A self _classes N/A N/A descriptor_name N/A descriptor name N/A N/A str bytes N/A N/A descriptor_name N/A N/A N/A descriptor name encode ascii ignore N/A result_class N/A N/A reflection GeneratedProtocolMessageType descriptor_name N/A N/A message Message N/A DESCRIPTOR __module__ descriptor None N/A N/A N/A self _classes N/A N/A descriptor full_name result_class N/A field N/A descriptor fields N/A N/A N/A field message_type N/A N/A N/A N/A self GetPrototype N/A field message_type N/A extension N/A N/A result_class DESCRIPTOR extensions N/A N/A N/A N/A N/A extension containing_type full_name N/A self _classes N/A N/A N/A N/A self GetPrototype N/A extension containing_type N/A extended_class N/A N/A self _classes N/A N/A N/A extension containing_type full_name N/A N/A N/A extended_class RegisterExtension extension N/A N/A N/A self _classes N/A N/A descriptor full_name N/A GetMessages N/A N/A self files N/A N/A N/A Gets all the messages from a specified file.

    This will find and resolve dependencies, failing if the descriptor
    pool cannot satisfy them.

    Args:
      files: The file names to extract messages from.

    Returns:
      A dictionary mapping proto names to the message classes. This will include
      any dependent messages as well as any messages defined in the same file as
      a specified message.
     N/A result N/A N/A file_name files N/A N/A file_desc N/A N/A N/A self pool FindFileByName file_name N/A N/A name msg N/A list N/A N/A N/A file_desc message_types_by_name items N/A N/A N/A file_desc package N/A N/A full_name N/A N/A . join N/A N/A file_desc package name N/A N/A full_name N/A msg name N/A N/A result N/A full_name N/A N/A self GetPrototype N/A N/A N/A self pool FindMessageTypeByName full_name N/A N/A name extension N/A list N/A N/A N/A file_desc extensions_by_name items N/A N/A N/A N/A N/A extension containing_type full_name N/A self _classes N/A N/A N/A N/A self GetPrototype N/A extension containing_type N/A extended_class N/A N/A self _classes N/A N/A N/A extension containing_type full_name N/A N/A N/A extended_class RegisterExtension extension N/A result N/A N/A N/A _FACTORY N/A MessageFactory GetMessages N/A N/A file_protos N/A N/A N/A Builds a dictionary of all the messages available in a set of files.

  Args:
    file_protos: A sequence of file protos to build messages out of.

  Returns:
    A dictionary mapping proto names to the message classes. This will include
    any dependent messages as well as any messages defined in the same file as
    a specified message.
   N/A file_proto file_protos N/A N/A N/A N/A N/A _FACTORY pool Add file_proto N/A N/A N/A _FACTORY GetMessages N/A N/A file_proto name N/A file_proto file_protos N/A