✏️ 正在编辑: descriptor.cpython-36.opt-1.pyc
路径:
/lib/python3.6/site-packages/google/protobuf/__pycache__/descriptor.cpython-36.opt-1.pyc
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
3 ���h�� � @ sb d Z dZddlZddlmZ dZej� dkrTddlZddlZddl m Z ee dd�ZG d d � d e�Z G dd� de �Zer�G d d� de�ZneZG dd� deje��ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd � d e�ZG d!d"� d"e�Zd#d$� Zd%d&� Zd'd(� Zd)d*� Zd/d-d.�Z dS )0z�Descriptors essentially contain exactly the information found in a .proto file, in types that make this information accessible in Python. z#robinson@google.com (Will Robinson)� N)�api_implementationF�cpp)�_message�_USE_C_DESCRIPTORSc @ s e Zd ZdZdS )�ErrorzBase error for this module.N)�__name__� __module__�__qualname__�__doc__� r r � /usr/lib/python3.6/descriptor.pyr 2 s r c @ s e Zd ZdZdS )�TypeTransformationErrorzHError transforming between python proto type and corresponding C++ type.N)r r r r r r r r r 6 s r c s e Zd Z� fdd�Z� ZS )�DescriptorMetaclassc s( t t| �j|�rdS t|| j�r$dS dS )NTF)�superr �__instancecheck__� isinstance�_C_DESCRIPTOR_CLASS)�cls�obj)� __class__r r r @ s z%DescriptorMetaclass.__instancecheck__)r r r r � __classcell__r r )r r r ? s r c @ s0 e Zd ZdZerf Zdd� Zdd� Zdd� ZdS ) �DescriptorBasea� Descriptors base class. This class is the base of all descriptor classes. It provides common options related functionality. Attributes: has_options: True if the descriptor has non-default options. Usually it is not necessary to read this -- just call GetOptions() which will happily return the default instance. However, it's sometimes useful for efficiency, and also useful inside the protobuf implementation to avoid some bootstrapping issues. c C s || _ || _|dk | _dS )z�Initialize the descriptor given its options message and the name of the class of the options message. The name of the class is required in case the options message is None and has to be created. N)�_options�_options_class_name�has_options)�self�options�options_class_namer r r �__init___ s zDescriptorBase.__init__c C s || _ || _|dk | _dS )z�Sets the descriptor's options This function is used in generated proto2 files to update descriptor options. It must not be used outside proto2. N)r r r )r r r r r r �_SetOptionsj s zDescriptorBase._SetOptionsc C sZ | j r| j S ddlm} yt|| j�}W n" tk rJ td| j ��Y nX |� | _ | j S )z�Retrieves descriptor options. This method returns the options set or creates the default options for the descriptor. r )�descriptor_pb2zUnknown options class name %s!)r �google.protobufr �getattrr �AttributeError�RuntimeError)r r Z options_classr r r � GetOptionsv s zDescriptorBase.GetOptionsN) r r r r r r r r r% r r r r r K s r c s* e Zd ZdZd� fdd� Zdd� Z� ZS )�_NestedDescriptorBasez0Common class for descriptors that can be nested.Nc s: t t| �j||� || _|| _|| _|| _|| _|| _dS )aC Constructor. Args: options: Protocol message options or None to use default message options. options_class_name: (str) The class name of the above options. name: (str) Name of this protocol message type. full_name: (str) Fully-qualified name of this protocol message type, which will include protocol "package" name and the name of any enclosing types. file: (FileDescriptor) Reference to file info. containing_type: if provided, this is a nested descriptor, with this descriptor as parent, otherwise None. serialized_start: The start index (inclusive) in block in the file.serialized_pb that describes this descriptor. serialized_end: The end index (exclusive) in block in the file.serialized_pb that describes this descriptor. N) r r&