HEX
Server: LiteSpeed
System: Linux ws4.angoweb.net 5.14.0-611.13.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 11 04:57:59 EST 2025 x86_64
User: tswangoe (2287)
PHP: 8.1.33
Disabled: show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open
Upload Files
File: //usr/lib/python3.9/site-packages/google/protobuf/__pycache__/proto_builder.cpython-39.opt-1.pyc
a

x��gR�@szdZzddlmZWney2ddlmZYn0ddlZddlZddlmZddlm	Z	dd�Z
ddd	�Zd
d�ZdS)
zDynamic Protobuf class creator.�)�OrderedDictN)�descriptor_pb2)�message_factorycCs|j�|�}|�|�}|S)a8Get 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.
  )�poolZFindMessageTypeByNameZGetPrototype)�factory�	full_nameZproto_descriptor�	proto_cls�r	�A/usr/lib/python3.9/site-packages/google/protobuf/proto_builder.py�_GetMessageFromFactory,s
rc
Cs�tj|d�}|dur8zt||�}|WSty6Yn0|��}t|t�sRt|�}t�	�}|D],\}}|�
|�d��|�
t|��d��q^|�
�d}	|dur�d|�
�}zt||�}|WSty�Yn0|j�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.
  )rNzutf-8z.protoz6net.proto2.python.public.proto_builder.AnonymousProto_)rZMessageFactoryr�KeyError�items�
isinstancer�sorted�hashlibZsha1�update�encode�strZ	hexdigestrZAdd�_MakeFileDescriptorProto)
�fieldsrrrr�field_itemsZfields_hash�f_name�f_type�proto_file_namer	r	r
�MakeSimpleProtoClass<s8

�

�rcCs�|�dd�\}}t��}tj�|�dd�|�|_||_|j	�
�}||_t|d�D]2\}\}}	|j�
�}
||
_||
_
tjj|
_|	|
_qP|S)zAPopulate FileDescriptorProto for MessageFactory's DescriptorPool.�.��/)�rsplitrZFileDescriptorProto�os�path�join�replace�name�packageZmessage_type�add�	enumerateZfield�numberZFieldDescriptorProtoZLABEL_OPTIONALZlabel�type)rrrr$r#Z
file_protoZ
desc_protoZf_numberrrZfield_protor	r	r
rts


r)NN)
�__doc__�collectionsr�ImportErrorZordereddictrrZgoogle.protobufrrrrrr	r	r	r
�<module>s
8