Duac@sdZdZddlZddlmZeZejdkr}ddlZddl Z ddl m Z e e deZnde fd YZd efd YZerd efd YZneZdejefdYZdefdYZdefdYZdefdYZdefdYZdefdYZdefdYZdefdYZdefdYZd efd!YZd"Zd#Zd$Zd%Z d&e!dd'Z#dS((sDescriptors 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)iN(tapi_implementationtcpp(t_messaget_USE_C_DESCRIPTORStErrorcBseZdZRS(sBase error for this module.(t__name__t __module__t__doc__(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR2stTypeTransformationErrorcBseZdZRS(sHError transforming between python proto type and corresponding C++ type.(RRR(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR6stDescriptorMetaclasscBseZdZRS(cCs6tt|j|rtSt||jr2tStS(N(tsuperR t__instancecheck__tTruet isinstancet_C_DESCRIPTOR_CLASStFalse(tclstobj((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR @s (RRR (((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR ?stDescriptorBasecBs8eZdZerdZndZdZdZRS(sDescriptors 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. cCs%||_||_|dk |_dS(sInitialize 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_nametNonet has_options(tselftoptionstoptions_class_name((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyt__init___s  cCs%||_||_|dk |_dS(sSets the descriptor's options This function is used in generated proto2 files to update descriptor options. It must not be used outside proto2. N(RRRR(RRR((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyt _SetOptionsjs  cCsp|jr|jSddlm}yt||j}Wn$tk r\td|jnX||_|jS(sRetrieves descriptor options. This method returns the options set or creates the default options for the descriptor. i(tdescriptor_pb2sUnknown options class name %s!(Rtgoogle.protobufRtgetattrRtAttributeErrort RuntimeError(RRt options_class((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyt GetOptionsvs   ((RRRRRRRR"(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRKs    t_NestedDescriptorBasecBs&eZdZdddZdZRS(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( R R#Rtnamet full_nametfiletcontaining_typet_serialized_startt_serialized_end( RRRR$R%R&R'tserialized_starttserialized_end((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRs      cCs`|jdk rP|jdk rP|jdk rP|j|jj|j|j!n tddS(sCopies 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(R&RR(R)tParseFromStringt serialized_pbR(Rtproto((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyt CopyToProtos N(RRRRRR/(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR#s !t Descriptorc BseZdZer?ejZdedddddddZ ndedddddddZ e dZ dZ dZRS(si Descriptor 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. fields_by_camelcase_name: (dict str -> FieldDescriptor) Same FieldDescriptor objects as in |fields|, but indexed by "camelcase_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? oneofs: (list of OneofDescriptor) The list of descriptors for oneof fields in this message. oneofs_by_name: (dict str -> OneofDescriptor) Same objects as in |oneofs|, but indexed by "name" attribute. file: (FileDescriptor) Reference to file descriptor. cCstjjtjj|S(N(RtMessaget_CheckCalledFromGeneratedFilet default_pooltFindMessageTypeByName(RR$R%tfilenameR'tfieldst nested_typest enum_typest extensionsRt is_extendabletextension_rangestoneofsR&R*R+tsyntax((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyt__new__s c Cstt|j| d||| |d|d|||_x|jD]}||_qDWtd|D|_td|D|_d |_ ||_ x|D]}||_qWtd|D|_ ||_ x|j D]}||_qWtd|D|_ td|D|_||_x|jD]}||_q9Wtd |D|_| |_| |_| d k r| ng|_td |jD|_x|jD]}||_qW|pd |_d S( sArguments 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 scss|]}|j|fVqdS(N(R$(RARB((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pys scss|]}|j|fVqdS(N(R$(RAtt((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pys %scss|]}|j|fVqdS(N(R$(RARC((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pys *scss.|]$}|jD]}|j|fVqqdS(N(tvaluesR$(RARCtv((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pys ,scss|]}|j|fVqdS(N(R$(RARB((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pys 1scss|]}|j|fVqdS(N(R$(RAto((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pys 5stproto2N(R R0RR6R'tdicttfields_by_numbertfields_by_nameRt_fields_by_camelcase_nameR7tnested_types_by_nameR8tenum_types_by_nametenum_values_by_nameR9textension_scopetextensions_by_nameR:R;R<toneofs_by_nameR=(RR$R%R5R'R6R7R8R9RR:R;R<R&R*R+R=tfieldt nested_typet enum_typet extensiontoneof((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRs>               cCs5|jdkr.td|jD|_n|jS(Ncss|]}|j|fVqdS(N(tcamelcase_name(RARB((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pys >s(RKRRHR6(R((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pytfields_by_camelcase_name:scCs|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. (RMtvalues_by_numberR$(Rtenumtvalue((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyt EnumValueNameAscCstt|j|dS(svCopies this to a descriptor_pb2.DescriptorProto. Args: proto: An empty descriptor_pb2.DescriptorProto. N(R R0R/(RR.((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR/SsN(RRRRRR0RRR R>RtpropertyRXR\R/(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR0s6      0 tFieldDescriptorcBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Zd Zd Z iee6ee6ee6ee6ee6ee6ee6ee6ee6ee6ee6ee6ee 6ee6ee 6ee 6ee 6ee 6Z!dZ"dZ#dZ$dZ%dZ&dZ'dZ(e)re*j+Z,de.ddddZ/nde.ddddZ0e1dZ2e3dZ4RS(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. camelcase_name: (str) Camelcase name of this field. 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. containing_oneof: (OneofDescriptor) If the field is a member of a oneof union, contains its descriptor. Otherwise, None. file: (FileDescriptor) Reference to file descriptor. iiiiiiiii i i i i iiiiiii8JiNcCs7tjj| r#tjj|Stjj|SdS(N(RR1R2R3tFindExtensionByNametFindFieldByName(RR$R%tindexR@ttypetcpp_typetlabelt default_valuet message_typeRTR't is_extensionRORthas_default_valuetcontaining_oneoft json_nameR&((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR>s cCs.tt|j|d||_||_||_d|_|dkr[t||_ n ||_ ||_ ||_ ||_ ||_ ||_||_||_| |_| |_| |_| |_| |_||_tjdkr!| r tjj||_q*tjj||_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. t FieldOptionsRN(R R^RR$R%R&Rt_camelcase_namet _ToJsonNameRjRaR@RbRcRdRhReR'RfRTRgRORiRtTypeRR3R_t _cdescriptorR`(RR$R%RaR@RbRcRdReRfRTR'RgRORRhRiRjR&((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRs4                    cCs+|jdkr$t|j|_n|jS(N(RlRt _ToCamelCaseR$(R((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRW!scCs7ytj|SWn!tk r2td|nXdS(sConverts 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(R^t_PYTHON_TO_CPP_PROTO_TYPE_MAPtKeyErrorR(t proto_type((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pytProtoTypeToCppProtoType's i iN(5RRRt TYPE_DOUBLEt TYPE_FLOATt TYPE_INT64t TYPE_UINT64t TYPE_INT32t TYPE_FIXED64t TYPE_FIXED32t TYPE_BOOLt TYPE_STRINGt TYPE_GROUPt TYPE_MESSAGEt TYPE_BYTESt TYPE_UINT32t TYPE_ENUMt TYPE_SFIXED32t TYPE_SFIXED64t TYPE_SINT32t TYPE_SINT64tMAX_TYPEt CPPTYPE_INT32t CPPTYPE_INT64tCPPTYPE_UINT32tCPPTYPE_UINT64tCPPTYPE_DOUBLEt CPPTYPE_FLOATt CPPTYPE_BOOLt CPPTYPE_ENUMtCPPTYPE_STRINGtCPPTYPE_MESSAGEt MAX_CPPTYPERqtLABEL_OPTIONALtLABEL_REQUIREDtLABEL_REPEATEDt MAX_LABELtMAX_FIELD_NUMBERtFIRST_RESERVED_FIELD_NUMBERtLAST_RESERVED_FIELD_NUMBERRRR^RRR R>RR]RWt staticmethodRt(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR^hs3      &tEnumDescriptorcBsYeZdZer6ejZddddddZnddddddZ dZ RS(sDescriptor 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 Cstjjtjj|S(N(RR1R2R3tFindEnumTypeByName( RR$R%R5RDR'RR&R*R+((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR>Xs c Cstt|j|d||||d|d| ||_x|jD]} || _qDWtd|D|_td|D|_dS(sArguments 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. t EnumOptionsR*R+css|]}|j|fVqdS(N(R$(RARE((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pys nscss|]}|j|fVqdS(N(R@(RARE((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pys osN(R RRRDRbRHtvalues_by_nameRY( RR$R%R5RDR'RR&R*R+R[((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR^s   cCstt|j|dS(s~Copies this to a descriptor_pb2.EnumDescriptorProto. Args: proto: An empty descriptor_pb2.EnumDescriptorProto. N(R RR/(RR.((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR/qsN( RRRRRRRRR>RR/(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR<s   tEnumValueDescriptorcBs>eZdZer-ejZdddZndddZ RS(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. cCstjjdS(N(RR1R2R(RR$RaR@RbR((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR>s cCsAtt|j|d||_||_||_||_dS(s>Arguments are as described in the attribute description above.tEnumValueOptionsN(R RRR$RaR@Rb(RR$RaR@RbR((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRs    N( RRRRRRRRR>R(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR{s   tOneofDescriptorcBs8eZdZer*ejZddZnddZ RS(s Descriptor for a oneof field. name: (str) Name of the oneof field. full_name: (str) Full name of the oneof field, including package name. index: (int) 0-based index giving the order of the oneof field inside its containing type. containing_type: (Descriptor) Descriptor of the protocol message type that contains this field. Set by the Descriptor constructor if we're passed into one. fields: (list of FieldDescriptor) The list of field descriptors this oneof can contain. cCstjjtjj|S(N(RR1R2R3tFindOneofByName(RR$R%RaR'R6R((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR>s cCsJtt|j|d||_||_||_||_||_dS(s>Arguments are as described in the attribute description above.t OneofOptionsN(R RRR$R%RaR'R6(RR$R%RaR'R6R((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRs     N( RRRRRRRRR>R(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRs   tServiceDescriptorcBs\eZdZer3ejZdddddZndddddZ dZ dZ RS(sDescriptor 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. methods_by_name: (dict str -> MethodDescriptor) Same MethodDescriptor objects as in |methods_by_name|, but indexed by "name" attribute in each MethodDescriptor. options: (descriptor_pb2.ServiceOptions) Service options message or None to use default service options. file: (FileDescriptor) Reference to file info. c Cstjjtjj|S(N(RR1R2R3tFindServiceByName( RR$R%RatmethodsRR&R*R+((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR>s c Cs}tt|j|d|||dd|d|||_||_td|D|_x|jD]} || _qfWdS(NtServiceOptionsR*R+css|]}|j|fVqdS(N(R$(RAtm((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pys s( R RRRRaRRHtmethods_by_nametcontaining_service( RR$R%RaRRR&R*R+tmethod((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRs   cCs|jj|dS(s>Searches for the specified method, and returns its descriptor.N(RtgetR(RR$((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pytFindMethodByNamescCstt|j|dS(sCopies this to a descriptor_pb2.ServiceDescriptorProto. Args: proto: An empty descriptor_pb2.ServiceDescriptorProto. N(R RR/(RR.((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR/sN( RRRRRRRRR>RRR/(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRs  tMethodDescriptorcBs8eZdZer*ejZddZnddZ RS(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. cCstjjtjj|S(N(RR1R2R3R(RR$R%RaRt input_typet output_typeR((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR>s cCsStt|j|d||_||_||_||_||_||_dS(sThe 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( R RRR$R%RaRRR(RR$R%RaRRRR((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR s     N( RRRRRRRRR>R(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRs   tFileDescriptorcBs_eZdZer9ejZdddddddZndddddddZ dZ RS(s;Descriptor for a file. Mimics the descriptor_pb2.FileDescriptorProto. Note that enum_types_by_name, extensions_by_name, and dependencies fields are only set by the message_factory module, and not by the generated proto code. name: name of file, relative to root of source tree. package: name of the package syntax: string indicating syntax of the file (can be "proto2" or "proto3") serialized_pb: (str) Byte string of serialized descriptor_pb2.FileDescriptorProto. dependencies: List of other FileDescriptors this FileDescriptor depends on. public_dependencies: A list of FileDescriptors, subset of the dependencies above, which were declared as "public". message_types_by_name: Dict of message names of their descriptors. enum_types_by_name: Dict of enum names and their descriptors. extensions_by_name: Dict of extension names and their descriptors. services_by_name: Dict of services names and their descriptors. pool: the DescriptorPool this descriptor belongs to. When not passed to the constructor, the global default pool is used. c Cs0|rtjj|Stt|j|SdS(N(RR3tAddSerializedFileR RR>( RR$tpackageRR-t dependenciestpublic_dependenciesR=tpool((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyR>5sc Cstt|j|d|dkrDddlm} | j}n||_i|_||_ ||_ |pqd|_ ||_ i|_ i|_i|_|pg|_|pg|_tjdkr|j dk rtjj|j ndS(s Constructor.t FileOptionsi(tdescriptor_poolRGRN(R RRRRRtDefaultRtmessage_types_by_nameR$RR=R-RMRPtservices_by_nameRRRRnRR3R( RR$RRR-RRR=RR((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRAs$         cCs|j|jdS(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( RRRRRRRRR>RR/(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRs  cCs|j||S(sParses 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 _ParseOptionsds cCst}g}xX|D]P}|dkr7|rct}qcq|rY|j|jt}q||7}qW|r|djr|dj|d/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRpns    cCs|jdr|jSdSdS(sCReturns the value of the field `options`, or None if it is not set.RN(tHasFieldRR(tdescriptor_proto((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyt_OptionsOrNonescCskt}g}xO|D]G}|dkr.t}q|rP|j|jt}q||7}qWdj|S(s*Converts name to Json name and returns it.RR(RR RRR(R$RRR((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRms    RcCstjdkr|rddlm}|j}|jjj|tt j }|rt j j |jdd|d|_||_n |d|_tjj|tjj|j}tr|j|jSn|jg}|r|jd|ni} x|jD]u} dj || jg} t| j| dgt| jD]$\} } t| j| | j^qR}|| | /usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyRsz     :           $($Rt __author__tsixtgoogle.protobuf.internalRRRRnRRtgoogle.protobuf.pyextRRt ExceptionRRRbR twith_metaclassRR#R0R^RRRRRRRRpRRmR RR(((s>/usr/lib/python2.7/site-packages/google/protobuf/descriptor.pyt!s<    =8?#!5'I