
    5?h                     ^    S r SSKJr  SSKrSSKrSSKJr  SSKJr  SSKJr  S r	S
S jr
S	 rg)zDynamic Protobuf class creator.    )OrderedDictN)descriptor_pb2)
descriptor)message_factoryc                 ^    U R                   R                  U5      nU R                  U5      nU$ )a(  Get a proto class from the MessageFactory by name.

Args:
  factory: a MessageFactory instance.
  full_name: str, the fully qualified name of the proto type.
Returns:
  A class, for the type identified by full_name.
Raises:
  KeyError, if the proto is not found in the factory's descriptor pool.
)poolFindMessageTypeByNameGetPrototype)factory	full_nameproto_descriptor	proto_clss       e/var/www/ev-aguas/ev-aguas-proceso/venv/lib/python3.13/site-packages/google/protobuf/proto_builder.py_GetMessageFromFactoryr   *   s0     \\77	B""#34)	    c                    [         R                  " US9nUb   [        X15      nU$ U R	                  5       n[        U [        5      (       d  [        U5      n[        R                  " 5       nU HN  u  pxUR                  UR                  S5      5        UR                  [        U5      R                  S5      5        MP     UR                  5       S-   n	Uc!  SUR                  5       -   n [        X15      nU$ UR                  R                  [!        XU5      5        [        X15      $ ! [         a     GNf = f! [         a     NMf = f)a  Create a Protobuf class whose fields are basic types.

Note: this doesn't validate field names!

Args:
  fields: dict of {name: field_type} mappings for each field in the proto. If
      this is an OrderedDict the order will be maintained, otherwise the
      fields will be sorted by name.
  full_name: optional str, the fully-qualified name of the proto type.
  pool: optional DescriptorPool instance.
Returns:
  a class, the new protobuf class with a FileDescriptor.
)r   zutf-8z.protoz6net.proto2.python.public.proto_builder.AnonymousProto_)r   MessageFactoryr   KeyErroritems
isinstancer   sortedhashlibsha1updateencodestr	hexdigestr   Add_MakeFileDescriptorProto)
fieldsr   r   r   r   field_itemsfields_hashf_namef_typeproto_file_names
             r   MakeSimpleProtoClassr&   :   s:    **5'(<i +	FK	(	(%K +#nfv}}W-.s6{))'23 $  ))+h6/ I&&()I(<i 
,,;GI		33C  
4  
s#   D& )D7 &
D43D47
EEc                    UR                  SS5      u  p4[        R                  " 5       n[        R                  R                  UR                  SS5      U 5      Ul        X5l        UR                  R                  5       nXFl        [        US5       H  u  nu  pUR                  R                  5       n
Xl        U[        R                  R                  :  a;  U[        R                  R                   [        R                  R                  -
  S-   -  nXzl        [        R$                  R&                  U
l        Xl        M     U$ )zAPopulate FileDescriptorProto for MessageFactory's DescriptorPool..   /)rsplitr   FileDescriptorProtoospathjoinreplacenamepackagemessage_typeadd	enumeratefieldr   FieldDescriptorFIRST_RESERVED_FIELD_NUMBERLAST_RESERVED_FIELD_NUMBERnumberFieldDescriptorProtoLABEL_OPTIONALlabeltype)r%   r   r!   r2   r1   
file_proto
desc_protof_numberr#   r$   field_protos              r   r   r   r   s   ""3*-'113*GGLLc!:OL*/&&**,*/$-k1$= h ""&&(K :--III

$
$
?
?

$
$
@
@ACDEFh "&;;JJK %> 
r   )NN)__doc__collectionsr   r   r-   google.protobufr   r   r   r   r&   r    r   r   <module>rG      s,   > & #  	 * & + 54pr   