
    q	h@                         S r SrSSKrSSKJr  SSKJr  SSKJr  \R                  " 5       S:X  a  SSKJ	r
  OSS	KJr
  \
R                  rS
 rS rS r " S S\5      rSS jrg)ao  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']()
z"matthewtoia@google.com (Matt Toia)    N)descriptor_pool)message)api_implementationpython)python_message)cpp_messagec                 D    [        U SS5      nU(       a  U$ [        U 5      $ )a)  Obtains 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.
_concrete_classN)getattr_InternalCreateMessageClass)
descriptorconcrete_classs     Q/var/www/html/env/lib/python3.13/site-packages/google/protobuf/message_factory.pyGetMessageClassr   #   s'     :'8$?.	$Z	00    c                    0 nU  H  nUR                  U5      nUR                  R                  5        H  n[        U5      X%R                  '   M     UR
                  R                  5        H  n[        UR                  5      n[        R                  " 5       S:w  a3  XaR                  UR                  UR                  5      La  [        S5      eUR                  (       d  Mw  [        UR                  5        M     M     U$ )aU  Gets all the messages from specified files.

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

Args:
  files: The file names to extract messages from.
  pool: The descriptor pool to find the files including the dependent files.

Returns:
  A dictionary mapping proto names to the message classes.
r   !Double registration of Extensions)FindFileByNamemessage_types_by_namevaluesr   	full_nameextensions_by_namecontaining_typer   TypeFindExtensionByNumbernumber
ValueErrormessage_type)filespoolresult	file_name	file_descdesc	extension_s           r   GetMessageClassesForFilesr'   5   s     &i##I.I//668.t4f^^ 9 1188:	
)33
4a		 	 	"h	. 66%%y'7'7
 
 >?
? 
				../ ; 8 
-r   c                 ^   U R                   n[        U[        R                  4U SS.5      nU R                   H+  nUR
                  (       d  M  [        UR
                  5        M-     UR                  R                   H  n[        UR                  5      n[        R                  " 5       S:w  aS  UR                  R                  R                  nXFR                  UR                  UR                  5      La  [!        S5      eUR
                  (       d  M  [        UR
                  5        M     U$ )zBuilds a proto2 message class based on the passed in descriptor.

Args:
  descriptor: The descriptor to build from.

Returns:
  A class describing the passed in descriptor.
N)
DESCRIPTOR
__module__r   r   )name _GENERATED_PROTOCOL_MESSAGE_TYPEr   Messagefieldsr   r   r)   
extensionsr   r   r   filer    r   r   r   )r   descriptor_nameresult_classfieldr%   extended_classr    s          r   r   r   b   s    OO/1",   ee(() !  **55i$Y%>%>?N H, &&++00d	44

#
#Y%5%5 
 <==i,,- 6 
r   c                   "    \ rS rSrSrSS jrSrg)MessageFactory   z@Factory for creating Proto2 messages from descriptors in a pool.Nc                 J    U=(       d    [         R                  " 5       U l        g)zInitializes a new factory.N)r   DescriptorPoolr    )selfr    s     r   __init__MessageFactory.__init__   s    8668DIr   )r    N)__name__r*   __qualname____firstlineno____doc__r;   __static_attributes__ r   r   r6   r6      s
    H9r   r6   c                 @  ^^^ U=(       d    [         R                  " 5       mU  Vs0 s H  o"R                  U_M     snmUUU4S jmT(       a"  T" TR                  5       S   5        T(       a  M"  [	        U  Vs/ s H  o"R                  PM     snT5      $ s  snf s  snf )a  Builds a dictionary of all the messages available in a set of files.

Args:
  file_protos: Iterable of FileDescriptorProto to build messages out of.
  pool: The descriptor pool to add the file protos.

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.
c                    > U R                    H"  nUT;   d  M  T" TR                  U5      5        M$     TR                  U 5        g r=   )
dependencypopAdd)
file_protorF   _AddFiledes_poolfile_by_names     r   rJ   GetMessages.<locals>._AddFile   s<     ++
	|	#!!*-. , LLr      )r   r9   r+   popitemr'   )file_protosr    rI   rJ   rK   rL   s      @@@r   GetMessagesrQ      s     5_335(@KL*//:-L, 	\!!#A&' 		")45:5x
  M 6s   B9Br=   )rA   
__author__warningsgoogle.protobufr   r   google.protobuf.internalr   r   r   message_implgoogle.protobuf.pyextr   GeneratedProtocolMessageTyper,   r   r'   r   objectr6   rQ   rC   r   r   <module>rZ      sd    2
  + # 7(E? $0#L#L  1$*Z#P9V 9r   