Ë
    ímxik  ã                   óh   — d Z ddlmZ ddlZddlZddlmZ ddlmZ ddlmZ ddlm	Z	 d„ Z
dd	„Zd
„ Zy)zDynamic Protobuf class creator.é    )ÚOrderedDictN)Údescriptor_pb2)Ú
descriptor)Údescriptor_pool)Úmessage_factoryc                 óR   — | j                  |«      }t        j                  |«      }|S )a-  Get a proto class from the MessageFactory by name.

  Args:
    pool: a descriptor pool.
    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.
  )ÚFindMessageTypeByNamer   ÚGetMessageClass)ÚpoolÚ	full_nameÚproto_descriptorÚ	proto_clss       úT/home/htdocs/ttos/venv/lib/python3.12/site-packages/google/protobuf/proto_builder.pyÚ_GetMessageFromFactoryr      s,   € ð ×/Ñ/°	Ó:ÐÜ×-Ñ-Ð.>Ó?€)Ø	Ðó    c                 ór  — |xs t        j                  «       }|�	 t        ||«      }|S | j	                  «       }t        | t        «      st        |«      }t        j                  «       }|D ]N  \  }}|j                  |j                  d«      «       |j                  t        |«      j                  d«      «       ŒP |j                  «       dz   }	|€"d|j                  «       z   }	 t        ||«      }|S |j                  t        |	||«      «       t        ||«      S # t        $ r Y Œüw xY w# t        $ r Y ŒBw xY w)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.
  zutf-8z.protoz6net.proto2.python.public.proto_builder.AnonymousProto_)r   ÚDescriptorPoolr   ÚKeyErrorÚitemsÚ
isinstancer   ÚsortedÚhashlibÚsha1ÚupdateÚencodeÚstrÚ	hexdigestÚAddÚ_MakeFileDescriptorProto)
Úfieldsr   r   Úpool_instancer   Úfield_itemsÚfields_hashÚf_nameÚf_typeÚproto_file_names
             r   ÚMakeSimpleProtoClassr'   $   sE  € ð Ò:œ/×8Ñ8Ó:€-ØÐðÜ(¨¸	ÓB€iØÐð —‘“€+Ü	�FœKÔ	(Ü˜Ó%€Kô —‘“€+Ø#ò 4�n€fˆfØ×Ñ�v—}‘} WÓ-Ô.Ø×Ñ”s˜6“{×)Ñ)¨'Ó2Õ3ð4ð  ×)Ñ)Ó+¨hÑ6€/ð ÐØIØ×&Ñ&Ó(ñ)€IðÜ(¨¸	ÓB€iØÐð ×ÑÜ˜°	¸;ÓGôIä	 ¨yÓ	9Ð9øôC ò á
ðûô4 ò á
ðús#   œD Ã%D* Ä	D'Ä&D'Ä*	D6Ä5D6c                 óŒ  — |j                  dd«      \  }}t        j                  «       }t        j                  j                  |j                  dd«      | «      |_        ||_        |j                  j                  «       }||_        t        |d«      D ]®  \  }\  }}	|j                  j                  «       }
||
_        |t        j                  j                  k\  r;|t        j                  j                   t        j                  j                  z
  dz   z  }||
_        t        j$                  j&                  |
_        |	|
_        Œ° |S )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"   r3   r2   Ú
file_protoÚ
desc_protoÚf_numberr$   r%   Úfield_protos              r   r   r   [   s"  € à×"Ñ" 3¨Ó*�-€'ˆ4Ü×1Ñ1Ó3€*Ü—G‘G—L‘L §¡°°cÓ!:¸OÓL€*„/Ø€*ÔØ×&Ñ&×*Ñ*Ó,€*Ø€*„/Ü$-¨k¸1Ó$=ò Ñ €hÑ �˜Ø×"Ñ"×&Ñ&Ó(€KØ€KÔð ”:×-Ñ-×IÑIÒIØÜ
×
$Ñ
$×
?Ñ
?Ü
×
$Ñ
$×
@Ñ
@ñAØCDñEñF€hð "€KÔÜ&×;Ñ;×JÑJ€KÔØ€KÕðð 
Ðr   )NN)Ú__doc__Úcollectionsr   r   r.   Úgoogle.protobufr   r   r   r   r   r'   r   © r   r   ú<module>rH      s/   ðñ &å #Û Û 	å *Ý &Ý +Ý +òó 4:ónr   