|
Server : LiteSpeed System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : nandedex ( 1060) PHP Version : 8.1.33 Disable Function : NONE Directory : /opt/cppython/lib/python3.8/site-packages/proto/__pycache__/ |
U
O��g� � @ sf d dl mZ d dlmZ d dlmZ d dlmZ G dd� d�ZG dd� de�Z G d d
� d
e�Z
dZdS )
� )�EnumMeta)�descriptor_pb2)�EnumTypeWrapper)� ProtoTypec @ sr e Zd ZdZdZdddddd�eeeed�dd�Ze dd � �Z
e ed
�dd��Ze ed
�d
d��Ze dd� �Z
dS )�Fieldz8A representation of a type of field in protocol buffers.FN)�message�enum�oneof� json_name�optional)�numberr r
r c C sn d | _ d | _t|t�s:t|ttf�r0|}tj}n
|}tj}|| _ || _
|| _|| _|| _
|| _|| _d | _d S )N)� mcls_data�parent�
isinstance�intr r r ZENUMZMESSAGEr �
proto_typer r r
r r �_descriptor)�selfr r r r r r
r � r �9/opt/cppython/lib/python3.8/site-packages/proto/fields.py�__init__ s
zField.__init__c C s� | j s�d}t| jt�r@| j�| j�s8dj| j| jd�| _| j}n�| jrht| jd�r\| jjj n| jj
j }n\t| jt�r�| j�| j�s�dj| j| jd�| _| j}n&| jr�t| jd�r�| jjj n| jj
j }tj
| j| j| jr�dnd| j|| j| jd�| _ | j S )z$Return the descriptor for the field.Nz{package}.{name})�package�name�
DESCRIPTOR� � )r r �label�type� type_namer
Zproto3_optional)r r r �str�
startswithr �format�hasattrr Z full_name�_metar r ZFieldDescriptorProtor r �repeatedr r
r )r r r r r �
descriptorH sH �
���
���zField.descriptor)�returnc C s
| j d S )zReturn the name of the field.r �r
�r r r r r w s z
Field.namec C s
| j d S )z Return the package of the field.r r'