File manager - Edit - /usr/local/CyberPanel/lib/python3.10/site-packages/proto/__pycache__/fields.cpython-310.pyc
Back
o �h� � @ 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 @ sx e Zd ZdZdZdddddd�dedededefd d �Ze dd� �Z e d efdd��Ze d efdd��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�st|ttf�r|}tj}n|}tj}|| _ || _ || _|| _|| _ || _|| _d | _d S )N)� mcls_data�parent� isinstance�intr r r �ENUM�MESSAGEr � proto_typer r r r r �_descriptor)�selfr r r r r r r � r �B/usr/local/CyberPanel/lib/python3.10/site-packages/proto/fields.py�__init__ s zField.__init__c C s� | j syd}t| jt�r | j�| j�sdj| j| jd�| _| j}nB| jr4t| jd�r.| jjj n| jj j }n.t| jt�rO| j�| j�sKdj| j| jd�| _| j}n| jrbt| jd�r]| jjj n| jj j }tj | j| j| jrmdnd| j|| j| jd�| _ | j S )z$Return the descriptor for the field.Nz{package}.{name})�package�name� DESCRIPTOR� � )r r �label�type� type_namer �proto3_optional)r r r �str� startswithr �format�hasattrr � full_name�_metar r �FieldDescriptorProtor r �repeatedr r r )r r r r r � descriptorH sH � ��� ���zField.descriptor�returnc C � | j d S )zReturn the name of the field.r �r �r r r r r w � z Field.namec C r, )z Return the package of the field.r r- r. r r r r | r/ z Field.packagec C s4 | j r| j S | js| jS t| jd�r| j�� S | jS )zMReturn the composite type of the field, or the primitive type if a primitive.r'