HEX
Server: LiteSpeed
System: Linux server.nevid-deploma.com 4.18.0-553.111.1.lve.el8.x86_64 #1 SMP Fri Mar 13 13:42:17 UTC 2026 x86_64
User: smilepac (1037)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/cppython/lib/python3.8/site-packages/google/protobuf/__pycache__/proto_builder.cpython-38.pyc
U

ID�gk�@sndZddlmZddlZddlZddlmZddlmZddlmZddlm	Z	dd	�Z
dd
d�Zdd
�ZdS)zDynamic Protobuf class creator.�)�OrderedDictN)�descriptor_pb2)�
descriptor)�descriptor_pool)�message_factorycCs|�|�}t�|�}|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.
  )ZFindMessageTypeByNamerZGetMessageClass)�pool�	full_nameZproto_descriptor�	proto_cls�r
�J/opt/cppython/lib/python3.8/site-packages/google/protobuf/proto_builder.py�_GetMessageFromFactorys

rc
Cs�|p
t��}|dk	r:zt||�}|WStk
r8YnX|��}t|t�sTt|�}t�	�}|D],\}}|�
|�d��|�
t|��d��q`|�
�d}	|dkr�d|�
�}zt||�}|WStk
r�YnX|�t|	||��t||�S)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.
  Nzutf-8z.protoz6net.proto2.python.public.proto_builder.AnonymousProto_)rZDescriptorPoolr�KeyError�items�
isinstancer�sorted�hashlib�sha1�update�encode�str�	hexdigest�Add�_MakeFileDescriptorProto)
�fieldsrrZ
pool_instancer	�field_itemsZfields_hash�f_name�f_type�proto_file_namer
r
r�MakeSimpleProtoClass$s8

�

�rcCs�|�dd�\}}t��}tj�|�dd�|�|_||_|j	�
�}||_t|d�D]V\}\}}	|j�
�}
||
_|t
jjkr�|t
jjt
jjd7}||
_tjj|
_|	|
_qP|S)zAPopulate FileDescriptorProto for MessageFactory's DescriptorPool.�.��/)�rsplitrZFileDescriptorProto�os�path�join�replace�name�packageZmessage_type�add�	enumerate�fieldrZFieldDescriptorZFIRST_RESERVED_FIELD_NUMBERZLAST_RESERVED_FIELD_NUMBER�numberZFieldDescriptorProtoZLABEL_OPTIONAL�label�type)rrrr(r'Z
file_protoZ
desc_protoZf_numberrrZfield_protor
r
rr[s*

���
r)NN)
�__doc__�collectionsrrr#Zgoogle.protobufrrrrrrrr
r
r
r�<module>s
7