Q,Qc@sidZdZddlZddlZddlmZddlmZddlmZej Z ej Z ej ZejZdZeZdZd Zd Zd Zd Zd ZdefdYZdZdefdYZdZdefdYZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dS(sContains helper functions used to create protocol message classes from Descriptor objects at runtime backed by the protocol buffer C++ API. spetar@google.com (Petar Petrov)iN(t_net_proto2___python(tenum_type_wrapper(tmessagecCs tjS(s(Creates a new DescriptorPool C++ object.(RtNewCDescriptorPool(((sH/usr/lib/python2.7/site-packages/google/protobuf/internal/cpp_message.pytGetDescriptorPool2scCs tj|S(s8Searches for a field descriptor given a full field name.(t_pooltFindFieldByName(tfull_field_name((sH/usr/lib/python2.7/site-packages/google/protobuf/internal/cpp_message.pytGetFieldDescriptor:scCstj|dS(sARegisters a new proto file in the underlying C++ descriptor pool.N(Rt BuildFile(tcontent((sH/usr/lib/python2.7/site-packages/google/protobuf/internal/cpp_message.pyR ?scCs tj|S(s:Searches for extension descriptor given a full field name.(RtFindExtensionByName(tfull_extension_name((sH/usr/lib/python2.7/site-packages/google/protobuf/internal/cpp_message.pytGetExtensionDescriptorDscCs tj|S(s/Creates a new C++ protocol message by its name.(Rt NewCMessage(tfull_message_name((sH/usr/lib/python2.7/site-packages/google/protobuf/internal/cpp_message.pyRIscs+fd}fd}t||S(s3Returns a scalar property for the given descriptor.cs|jjS(N(t_cmsgt GetScalar(tself(t cdescriptor(sH/usr/lib/python2.7/site-packages/google/protobuf/internal/cpp_message.pytGetterQscs|jj|dS(N(Rt SetScalar(Rtvalue(R(sH/usr/lib/python2.7/site-packages/google/protobuf/internal/cpp_message.pytSetterTs(tproperty(RRR((RsH/usr/lib/python2.7/site-packages/google/protobuf/internal/cpp_message.pytScalarPropertyNscsfd}t|S(s4Returns a Python property the given composite field.cs_|jjjd}|dkr[|jj}jd|}||jjfd}fd}dj}t||d|S(s:Returns a Python property the given repeated scalar field.csJ|jjjd}|dkrFt|}||jjsRFR3treverse( RRGR8trangeR;RKt enumerateRtSwapRepeatedFieldElementsR'( RRFR3RiRJt index_keytindexestdesttsrc((R3RsH/usr/lib/python2.7/site-packages/google/protobuf/internal/cpp_message.pyRKs   N(RLRMRNROR*RZR/R5R[R8R:R<RBRDRtFalseRK(((sH/usr/lib/python2.7/site-packages/google/protobuf/internal/cpp_message.pyRUs        csAfd}fd}dj}t||d|S(sAReturns a Python property for the given repeated composite field.csP|jjjd}|dkrLt|j}||jj|j|jjtgoogle.protobuf.internalRRRvRtLABEL_REPEATEDRtLABEL_OPTIONALR{tCPPTYPE_MESSAGER}t TYPE_MESSAGERRRRR R RRR$tobjectR%RTRURrRsRRRRRRRRR(((sH/usr/lib/python2.7/site-packages/google/protobuf/internal/cpp_message.pyt!s@             A W Q    F