Spade
Mini Shell
| Directory:~$ /proc/self/root/usr/lib/python2.7/site-packages/google/protobuf/ |
| [Home] [System Details] [Kill Me] |
�
Q�,Qc@sqdZdZddlmZej�dkrfej�dkrSddlmZqfddlmZnde fd ��YZ
d
e
fd��YZdefd
��YZ
de
fd��YZdefd��YZde
fd��YZdefd��YZde
fd��YZdefd��YZde
fd��YZde
fd��YZd�Zdd
�Zd!S("s�Descriptors essentially contain exactly the information
found in a .proto
file, in types that make this information accessible in Python.
s#robinson@google.com (Will
Robinson)i����(tapi_implementationtcppi(t_message(tcpp_messagetErrorcBseZdZRS(sBase
error for this module.(t__name__t
__module__t__doc__(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR0stTypeTransformationErrorcBseZdZRS(sHError
transforming between python proto type and corresponding C++
type.(RRR(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR4stDescriptorBasecBs)eZdZd�Zd�Zd�ZRS(s�Descriptors
base class.
This class is the base of all descriptor classes. It provides common
options
related functionaility.
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.
cCs%||_||_|dk |_dS(s�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(t_optionst_options_class_nametNonethas_options(tselftoptionstoptions_class_name((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyt__init__Gs cCs%||_||_|dk |_dS(s�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
RRR
(RRR((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyt_SetOptionsRs cCsp|jr|jSddlm}yt||j�}Wn$tk
r\td|j��nX|�|_|jS(s�Retrieves descriptor options.
This method returns the options set or creates the default options for
the
descriptor.
i����(tdescriptor_pb2sUnknown options class name %s!(R
tgoogle.protobufRtgetattrRtAttributeErrortRuntimeError(RRt
options_class((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyt
GetOptions^s
(RRRRRR(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR 8s
t_NestedDescriptorBasecBs/eZdZddd�Zd�Zd�ZRS(s0Common
class for descriptors that can be
nested.c CsStt|�j||�||_||_||_||_||_||_dS(sCConstructor.
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( tsuperRRtnamet full_nametfiletcontaining_typet_serialized_startt_serialized_end( RRRRRRRtserialized_starttserialized_end((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRss
cCs)|}x|jdk r$|j}q W|S(sEReturns the root if this is
a nested type, or itself if its the
root.N(RR(Rtdesc((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pytGetTopLevelContainingType�s
cCs`|jdk rP|jdk rP|jdk rP|j|jj|j|j!�ntd��dS(s�Copies
this to the matching proto in descriptor_pb2.
Args:
proto: An empty proto instance from descriptor_pb2.
Raises:
Error: If self couldnt be serialized, due to to few constructor
arguments.
s*Descriptor does not contain serialization.N(RRR
R!tParseFromStringt
serialized_pbR(Rtproto((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pytCopyToProto�s N(RRRRRR%R)(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRps
! t
DescriptorcBs;eZdZdeddddd�Zd�Zd�ZRS(sIDescriptor
for a protocol message type.
A Descriptor instance has the following attributes:
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.
containing_type: (Descriptor) Reference to the descriptor of the
type containing us, or None if this is top-level.
fields: (list of FieldDescriptors) Field descriptors for all
fields in this type.
fields_by_number: (dict int -> FieldDescriptor) Same FieldDescriptor
objects as in |fields|, but indexed by "number" attribute
in each
FieldDescriptor.
fields_by_name: (dict str -> FieldDescriptor) Same FieldDescriptor
objects as in |fields|, but indexed by "name" attribute in
each
FieldDescriptor.
nested_types: (list of Descriptors) Descriptor references
for all protocol message types nested within this one.
nested_types_by_name: (dict str -> Descriptor) Same Descriptor
objects as in |nested_types|, but indexed by "name"
attribute
in each Descriptor.
enum_types: (list of EnumDescriptors) EnumDescriptor references
for all enums contained within this type.
enum_types_by_name: (dict str ->EnumDescriptor) Same EnumDescriptor
objects as in |enum_types|, but indexed by "name" attribute
in each EnumDescriptor.
enum_values_by_name: (dict str -> EnumValueDescriptor) Dict mapping
from enum value name to EnumValueDescriptor for that value.
extensions: (list of FieldDescriptor) All extensions defined directly
within this message type (NOT within a nested type).
extensions_by_name: (dict, string -> FieldDescriptor) Same
FieldDescriptor
objects as |extensions|, but indexed by "name" attribute of
each
FieldDescriptor.
is_extendable: Does this type define any extension ranges?
options: (descriptor_pb2.MessageOptions) Protocol message options or
None
to use default message options.
file: (FileDescriptor) Reference to file descriptor.
cCsjtt|�j| d||||d|
d|
�||_x|jD]}||_qDWtd�|D��|_td�|D��|_||_td�|D��|_ ||_
x|j
D]}||_q�Wtd�|D��|_td�|D��|_||_
x|j
D]}||_qWtd �|D��|_|
|_||_|
|_||_d
S(s�Arguments to __init__() are as described in the description
of Descriptor fields above.
Note that filename is an obsolete argument, that is not used anymore.
Please use file.name to access this as an attribute.
tMessageOptionsR"R#css|]}|j|fVqdS(N(tnumber(t.0tf((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pys <genexpr>�scss|]}|j|fVqdS(N(R(R-R.((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pys <genexpr>�scss|]}|j|fVqdS(N(R(R-tt((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pys <genexpr>�scss|]}|j|fVqdS(N(R(R-R/((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pys <genexpr>scss.|]$}|jD]}|j|fVqqdS(N(tvaluesR(R-R/tv((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pys <genexpr>scss|]}|j|fVqdS(N(R(R-R.((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pys <genexpr> sN(RR*RtfieldsRtdicttfields_by_numbertfields_by_nametnested_typestnested_types_by_namet
enum_typestenum_types_by_nametenum_values_by_namet
extensionstextension_scopetextensions_by_namet
is_extendabletextension_rangesR
R!(RRRtfilenameRR2R6R8R;RR>R?RR"R#tfieldt enum_typet extension((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR�s2
cCs|j|j|jS(ssReturns
the string name of an enum value.
This is just a small helper method to simplify a common operation.
Args:
enum: string name of the Enum.
value: int, value of the enum.
Returns:
string name of the enum value.
Raises:
KeyError if either the Enum doesn't exist or the value is not a
valid
value for the enum.
(R9tvalues_by_numberR(Rtenumtvalue((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyt
EnumValueNamescCstt|�j|�dS(svCopies
this to a descriptor_pb2.DescriptorProto.
Args:
proto: An empty descriptor_pb2.DescriptorProto.
N(RR*R)(RR(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR)"sN(RRRRtTrueRRGR)(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR*�s1 + tFieldDescriptorcBs|eZdZdZdZdZdZdZdZdZ dZ
d Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Zd
Zd
Z
iee6ee6ee6ee6ee6ee6ee6ee6ee6ee6ee6ee6ee 6ee6ee6ee
6ee
6ee6Z!dZ"dZ#dZ$dZ%de'd�Z(e)d��Z*RS(s�Descriptor
for a single field in a .proto file.
A FieldDescriptor instance has the following attributes:
name: (str) Name of this field, exactly as it appears in .proto.
full_name: (str) Name of this field, including containing scope. This
is
particularly relevant for extensions.
index: (int) Dense, 0-indexed index giving the order that this
field textually appears within its message in the .proto file.
number: (int) Tag number declared for this field in the .proto file.
type: (One of the TYPE_* constants below) Declared type.
cpp_type: (One of the CPPTYPE_* constants below) C++ type used to
represent this field.
label: (One of the LABEL_* constants below) Tells whether this
field is optional, required, or repeated.
has_default_value: (bool) True if this field has a default value
defined,
otherwise false.
default_value: (Varies) Default value of this field. Only
meaningful for non-repeated scalar fields. Repeated fields
should always set this to [], and non-repeated composite
fields should always set this to None.
containing_type: (Descriptor) Descriptor of the protocol message
type that contains this field. Set by the Descriptor constructor
if we're passed into one.
Somewhat confusingly, for extension fields, this is the
descriptor of the EXTENDED message, not the descriptor
of the message containing this field. (See is_extension and
extension_scope below).
message_type: (Descriptor) If a composite field, a descriptor
of the message type contained in this field. Otherwise, this is
None.
enum_type: (EnumDescriptor) If this field contains an enum, a
descriptor of that enum. Otherwise, this is None.
is_extension: True iff this describes an extension field.
extension_scope: (Descriptor) Only meaningful if is_extension is True.
Gives the message that immediately contains this extension field.
Will be None iff we're a top-level (file-level) extension field.
options: (descriptor_pb2.FieldOptions) Protocol message field options
or
None to use default field options.
iiiiiiiii i
iii
iiiiicCs4tt|�j|d�||_||_||_||_||_||_||_ ||_
||_||_| |_
|
|_||_|
|_tj�dkr'|r�tj�dkr�tj|�|_q$tj|�|_q0tj�dkrtj|�|_q0tj|�|_n d|_dS(sThe
arguments are as described in the description of FieldDescriptor
attributes above.
Note that containing_type may be None, and may be set later if
necessary
(to deal with circular references between message types, for example).
Likewise for extension_scope.
tFieldOptionsRiN(RRIRRRtindexR,ttypetcpp_typetlabelthas_default_valuet
default_valueRtmessage_typeRBtis_extensionR<RtTypetVersionRtGetExtensionDescriptort_cdescriptorRtGetFieldDescriptorR(RRRRKR,RLRMRNRPRQRBRRRR<RRO((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR�s0 cCs7ytj|SWn!tk
r2td|��nXdS(s�Converts from a Python proto type to a C++
Proto Type.
The Python ProtocolBuffer classes specify both the 'Python'
datatype and the
'C++' datatype - and they're not the same. This helper
method should
translate from one to another.
Args:
proto_type: the Python proto type (descriptor.FieldDescriptor.TYPE_*)
Returns:
descriptor.FieldDescriptor.CPPTYPE_*, the C++ type.
Raises:
TypeTransformationError: when the Python proto type isn't known.
sUnknown proto_type:
%sN(RIt_PYTHON_TO_CPP_PROTO_TYPE_MAPtKeyErrorR(t
proto_type((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pytProtoTypeToCppProtoType�s
N(+RRRtTYPE_DOUBLEt
TYPE_FLOATt
TYPE_INT64tTYPE_UINT64t
TYPE_INT32tTYPE_FIXED64tTYPE_FIXED32t TYPE_BOOLtTYPE_STRINGt
TYPE_GROUPtTYPE_MESSAGEt
TYPE_BYTEStTYPE_UINT32t TYPE_ENUMt
TYPE_SFIXED32t
TYPE_SFIXED64tTYPE_SINT32tTYPE_SINT64tMAX_TYPEt
CPPTYPE_INT32t
CPPTYPE_INT64tCPPTYPE_UINT32tCPPTYPE_UINT64tCPPTYPE_DOUBLEt
CPPTYPE_FLOATtCPPTYPE_BOOLtCPPTYPE_ENUMtCPPTYPE_STRINGtCPPTYPE_MESSAGEtMAX_CPPTYPERXtLABEL_OPTIONALtLABEL_REQUIREDtLABEL_REPEATEDt MAX_LABELRRHRtstaticmethodR[(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRI7sr-
%tEnumDescriptorcBs/eZdZdddddd�Zd�ZRS(s�Descriptor
for an enum defined in a .proto file.
An EnumDescriptor instance has the following attributes:
name: (str) Name of the enum type.
full_name: (str) Full name of the type, including package name
and any enclosing type(s).
values: (list of EnumValueDescriptors) List of the values
in this enum.
values_by_name: (dict str -> EnumValueDescriptor) Same as |values|,
but indexed by the "name" field of each
EnumValueDescriptor.
values_by_number: (dict int -> EnumValueDescriptor) Same as
|values|,
but indexed by the "number" field of each
EnumValueDescriptor.
containing_type: (Descriptor) Descriptor of the immediate containing
type of this enum, or None if this is an enum defined at the
top level in a .proto file. Set by Descriptor's constructor
if we're passed into one.
file: (FileDescriptor) Reference to file descriptor.
options: (descriptor_pb2.EnumOptions) Enum options message or
None to use default enum options.
c
Cs�tt|�j|d||||d|d|�||_x|jD]}
||
_qDWtd�|D��|_td�|D��|_||_| |_ dS(s�Arguments
are as described in the attribute description above.
Note that filename is an obsolete argument, that is not used anymore.
Please use file.name to access this as an attribute.
tEnumOptionsR"R#css|]}|j|fVqdS(N(R(R-R1((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pys <genexpr>scss|]}|j|fVqdS(N(R,(R-R1((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pys <genexpr>sN(
RRRR0RLR3tvalues_by_nameRDR
R!(RRRR@R0RRRR"R#RF((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRs
cCstt|�j|�dS(s~Copies
this to a descriptor_pb2.EnumDescriptorProto.
Args:
proto: An empty descriptor_pb2.EnumDescriptorProto.
N(RRR)(RR(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR)sN(RRRRRR)(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR�s tEnumValueDescriptorcBseZdZddd�ZRS(s,Descriptor
for a single value within an enum.
name: (str) Name of this value.
index: (int) Dense, 0-indexed index giving the order that this
value appears textually within its enum in the .proto file.
number: (int) Actual number assigned to this enum value.
type: (EnumDescriptor) EnumDescriptor to which this value
belongs. Set by EnumDescriptor's constructor if we're
passed into one.
options: (descriptor_pb2.EnumValueOptions) Enum value options message
or
None to use default enum value options options.
cCsAtt|�j|d�||_||_||_||_dS(s>Arguments are as
described in the attribute description
above.tEnumValueOptionsN(RR�RRRKR,RL(RRRKR,RLR((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR1s
N(RRRRR(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR�"s
tServiceDescriptorcBs5eZdZddddd�Zd�Zd�ZRS(s�Descriptor
for a service.
name: (str) Name of the service.
full_name: (str) Full name of the service, including package name.
index: (int) 0-indexed index giving the order that this services
definition appears withing the .proto file.
methods: (list of MethodDescriptor) List of methods provided by this
service.
options: (descriptor_pb2.ServiceOptions) Service options message or
None to use default service options.
file: (FileDescriptor) Reference to file info.
c
Csdtt|�j|d|||dd|d|�||_||_x|jD]} || _qMWdS(NtServiceOptionsR"R#(RR�RRRKtmethodstcontaining_service(
RRRRKR�RRR"R#tmethod((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRIs cCs+x$|jD]}||jkr
|Sq
WdS(s>Searches for the specified method, and returns its
descriptor.N(R�RR(RRR�((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pytFindMethodByNameUscCstt|�j|�dS(s�Copies
this to a descriptor_pb2.ServiceDescriptorProto.
Args:
proto: An empty descriptor_pb2.ServiceDescriptorProto.
N(RR�R)(RR(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR)\sN(RRRRRR�R)(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR�:s
tMethodDescriptorcBseZdZdd�ZRS(sDescriptor for a
method in a service.
name: (str) Name of the method within the service.
full_name: (str) Full name of method.
index: (int) 0-indexed index of the method inside the service.
containing_service: (ServiceDescriptor) The service that contains this
method.
input_type: The descriptor of the message that this method accepts.
output_type: The descriptor of the message that this method returns.
options: (descriptor_pb2.MethodOptions) Method options message or
None to use default method options.
cCsStt|�j|d�||_||_||_||_||_||_dS(s�The
arguments are as described in the description of MethodDescriptor
attributes above.
Note that containing_service may be None, and may be set later if
necessary.
t
MethodOptionsN( RR�RRRRKR�t
input_typetoutput_type(RRRRKR�R�R�R((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRus N(RRRRR(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR�fs
tFileDescriptorcBs&eZdZddd�Zd�ZRS(s�Descriptor
for a file. Mimics the descriptor_pb2.FileDescriptorProto.
name: name of file, relative to root of source tree.
package: name of the package
serialized_pb: (str) Byte string of serialized
descriptor_pb2.FileDescriptorProto.
cCs�tt|�j|d�i|_||_||_||_tj�dkr�|jdk r�tj
�dkr�tj|j�q�t
j|j�ndS(sConstructor.tFileOptionsRiN(RR�Rtmessage_types_by_nameRtpackageR'RRSRRTRt BuildFileR(RRR�RR'((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR�s cCs|j|j�dS(s~Copies
this to a descriptor_pb2.FileDescriptorProto.
Args:
proto: An empty descriptor_pb2.FileDescriptorProto.
N(R&R'(RR(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR)�sN(RRRRRR)(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR��scCs|j|�|S(s�Parses
serialized options.
This helper function is used to parse serialized options in generated
proto2 files. It must not be used outside proto2.
(R&(tmessagetstring((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyt
_ParseOptions�s
tcCs�|jg}|r%|jd|�ng}x�|jD]�}dj||jg�}t|j||jd|j|jtj|j�|jddddt
ddt
�
}|j|�q5Wdj|�}t|j|dd|ggg�S(s
Make a protobuf
Descriptor given a DescriptorProto protobuf.
Args:
desc_proto: The descriptor_pb2.DescriptorProto protobuf message.
package: Optional package name for the new message Descriptor (string).
Returns:
A Descriptor for protobuf messages.
it.iRON(
RtinsertRAtjoinRIR,RLR[RNRtFalsetappendR*(t
desc_protoR�tfull_message_nameR2tfield_protoRRAt desc_name((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pytMakeDescriptor�s
N(Rt
__author__tgoogle.protobuf.internalRRSRTtgoogle.protobuf.internal.cppRRt ExceptionRRtobjectR RR*RIRR�R�R�R�R�R�(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyt<module>!s&8?��9,!