HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //lib/python2.7/site-packages/google/protobuf/internal/python_message.pyo
�
Q�,Qc@s�dZdZyddlmZWn!ek
rCddlmZnXddlZddlZddlZddlm	Z	ddlm
Z
ddlmZddlmZdd	lm
Zdd
lmZddlmZddlmZdd
lmZddlmZejZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)d �Z*d!�Z+d"�Z,d#�Z-d$�Z.d%�Z/d&�Z0d'�Z1d(�Z2d)�Z3d*�Z4d+�Z5d,�Z6d-�Z7d.�Z8d/�Z9d0�Z:d1�Z;d2�Z<d3�Z=d4�Z>d5�Z?d6e@fd7��YZAd8e@fd9��YZBdS(:s
Contains a metaclass and helper functions used to create
protocol message classes from Descriptor objects at runtime.

Recall that a metaclass is the "type" of a class.
(A class is to a metaclass what an instance is to a class.)

In this case, we use the GeneratedProtocolMessageType metaclass
to inject all the useful functionality into the classes
output by the protocol compiler at compile-time.

The upshot of all this is that the real implementation
details for ALL pure-Python protocol buffers are *here in
this file*.
s#robinson@google.com (Will Robinson)i����(tStringION(t
containers(tdecoder(tencoder(tenum_type_wrapper(tmessage_listener(t
type_checkers(twire_format(t
descriptor(tmessage(ttext_formatcCst||�t||�|S(N(t&_AddClassAttributesForNestedExtensionst	_AddSlots(tbasesRt
dictionary((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt
NewMessageLs

cs�i�_i�_i�_|jrR|j�jrRtj�j��jtj<nx|j	D]}t
�|�q\Wt|��t|��t
|��t|��t��t|��t��tj��fd��dS(Ncs�d|j�fS(N((t__getstate__(tobj(tcls(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt<lambda>fs(t_decoders_by_tagt_extensions_by_namet_extensions_by_numberthas_optionst
GetOptionstmessage_set_wire_formatRtMessageSetItemDecodertMESSAGE_SET_ITEM_TAGtfieldst_AttachFieldHelperst_AddEnumValuest_AddInitMethodt_AddPropertiesForFieldst_AddPropertiesForExtensionst_AddStaticMethodst_AddMessageMethodst_AddPrivateHelperMethodstcopy_regtpickle(RRtfield((RsK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pytInitMessageRs 				






cCs|S(sReturns the name of the public property attribute which
  clients can use to get and (in some cases) set the value
  of a protocol message field.

  Args:
    proto_field_name: The protocol message field name, exactly
      as it appears (or would appear) in a .proto file.
  ((tproto_field_name((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt
_PropertyNameqscCs�t|t�s"td|��n|jsAtd|j��n|js`td|j��n|j|jk	r�td|j|jj|jjf��ndS(s0Verify that the given extension handle is valid.s3HasExtension() expects an extension handle, got: %ss"%s" is not an extension.s""%s" is missing a containing_type.sKExtension "%s" extends message type "%s", but this message is of type "%s".N(t
isinstancet_FieldDescriptortKeyErrortis_extensiont	full_nametcontaining_typet
DESCRIPTOR(R	textension_handle((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt_VerifyExtensionHandle�s
			cCs&ddddddddg|d	<d
S(sAdds a __slots__ entry to dictionary, containing the names of all valid
  attributes for this message type.

  Args:
    message_descriptor: A Descriptor instance describing this message type.
    dictionary: Class dictionary to which we'll add a '__slots__' entry.
  t_cached_byte_sizet_cached_byte_size_dirtyt_fieldst_unknown_fieldst_is_present_in_parentt	_listenert_listener_for_childrent__weakref__t	__slots__N((tmessage_descriptorR((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR�scCs[|joZ|jjoZ|jj�joZ|jtjkoZ|j|j	koZ|j
tjkS(N(R.R0RRRttypeR,tTYPE_MESSAGEtmessage_typetextension_scopetlabeltLABEL_OPTIONAL(R'((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt_IsMessageSetExtension�s	cs�jtjk��jo'�j�j}t��r]tj�j	�}tj
�j	�}n>tj�j
�j	�|�}tj�j
�j	�|�}|�_|�_t���_���fd�}|tj�j
t��rtj�j
�r|tjt�ndS(NcsHtj�j|�}tj�j�j�|��j��j|<dS(N(RtTagBytestnumberRtTYPE_TO_DECODERR>t_default_constructorR(twiretypet	is_packedt	tag_bytes(Rtfield_descriptortis_repeated(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt
AddDecoder�s
(RBR,tLABEL_REPEATEDRRtpackedRDRtMessageSetItemEncoderRFtMessageSetItemSizerRtTYPE_TO_ENCODERR>t
TYPE_TO_SIZERt_encodert_sizert _DefaultValueConstructorForFieldRHtFIELD_TYPE_TO_WIRE_TYPEtFalseRtIsTypePackabletWIRETYPE_LENGTH_DELIMITEDtTrue(RRLRJt
field_encodertsizerRN((RRLRMsK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR�s&	

		cCs4|j}x$|j�D]\}}|||<qWdS(N(textensions_by_namet	iteritems(RRtextension_dicttextension_nametextension_field((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR�s	cCs^xW|jD]L}t||jtj|��x'|jD]}t||j|j�q6Wq
WdS(sSets class-level attributes for all enum fields defined in this message.

  Also exporting a class-level object that can name enum values.

  Args:
    descriptor: Descriptor object for this message type.
    cls: Class we're constructing for this message type.
  N(t
enum_typestsetattrtnameRtEnumTypeWrappertvaluesRF(RRt	enum_typet
enum_value((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR�s	cs��jtjkr��jr@�jgkr@td�j��n�jtjkrn�j��fd�}|St	j
�j�j���fd�}|Sn�jtjkr��j��fd�}|S�fd�}|S(s�Returns a function which returns a default value for a field.

  Args:
    field: FieldDescriptor object for this field.

  The returned function has one argument:
    message: Message instance containing this field, or a weakref proxy
      of same.

  That function in turn returns a default value for this field.  The default
    value may refer back to |message| via a weak reference.
  s/Repeated field default value not empty list: %scstj|j�j�S(N(RtRepeatedCompositeFieldContainerR:R@(R	(R'(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pytMakeRepeatedMessageDefaultscstj|j��S(N(RtRepeatedScalarFieldContainerR:(R	(ttype_checker(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pytMakeRepeatedScalarDefaultscs �j�}|j|j�|S(N(t_concrete_classt_SetListenerR:(R	tresult(R@(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pytMakeSubMessageDefaultscs�jS(N(t
default_value(R	(R'(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pytMakeScalarDefault"s(RBR,ROthas_default_valueRtt
ValueErrortcpp_typetCPPTYPE_MESSAGER@RtGetTypeCheckerR>(R'RlRoRsRu((R'R@RnsK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyRW�s"		cs7�j}�fd�}d|_d|_||_dS(sAdds an __init__ method to cls.cstd|_t|�dk|_i|_d|_t|_tj�|_	t
|�|_x|j�D]\}}t
�|�}|dkr�td�j|f��n|jtjkr|j|�}|jtjkrx1|D]}|j�j|�q�Wn
|j|�||j|<qd|jtjkr\|j|�}|j|�||j|<qdt|||�qdWdS(Nis,%s() got an unexpected keyword argument '%s'((R4tlenR5R6R7RYR8tmessage_listener_modtNullMessageListenerR9t	_ListenerR:R`t_GetFieldByNametNonet	TypeErrorRfRBR,RORHRxRytaddt	MergeFromtextendRe(tselftkwargst
field_nametfield_valueR'tcopytval(R=(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pytinit,s0				


N(RR�t
__module__t__doc__t__init__(R=RRR�((R=sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR)s
			cCs7y|j|SWn!tk
r2td|��nXdS(s�Returns a field descriptor by field name.

  Args:
    message_descriptor: A Descriptor describing all fields in message.
    field_name: The name of the field to retrieve.
  Returns:
    The field descriptor associated with the field name.
  s#Protocol message has no "%s" field.N(tfields_by_nameR-Rw(R=R�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyROs	
cCsCx|jD]}t||�q
W|jr?td��|_ndS(s=Adds properties for all fields in this protocol message type.cSs
t|�S(N(t_ExtensionDict(R�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyRfsN(Rt_AddPropertiesForFieldt
is_extendabletpropertyt
Extensions(RRR'((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR ^s	cCs{|jj�d}t|||j�|jtjkrHt||�n/|jtj	krjt
||�n
t||�dS(s#Adds a public property for a protocol message field.
  Clients can use this property to get and (in the case
  of non-repeated scalar fields) directly set the value
  of a protocol message field.

  Args:
    field: A FieldDescriptor for this field.
    cls: The class we're constructing.
  t
_FIELD_NUMBERN(RftupperReRFRBR,ROt_AddPropertiesForRepeatedFieldRxRyt*_AddPropertiesForNonRepeatedCompositeFieldt'_AddPropertiesForNonRepeatedScalarField(R'Rt
constant_name((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR�iscsv�j�t��}�fd�}d|_d�|_�fd�}d�}t||t||d|��dS(sAdds a public property for a "repeated" protocol message field.  Clients
  can use this property to get the value of the field, which will be either a
  _RepeatedScalarFieldContainer or _RepeatedCompositeFieldContainer (see
  below).

  Note that when clients add values to these containers, we perform
  type-checking in the case of repeated scalar fields, and we also set any
  necessary "has" bits as a side-effect.

  Args:
    field: A FieldDescriptor for this field.
    cls: The class we're constructing.
  csI|jj��}|dkrE�j|�}|jj�|�}n|S(N(R6tgetR�RHt
setdefault(R�R�(R'(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pytgetter�s
sGetter for %s.cstd���dS(NsIAssignment not allowed to repeated field "%s" in protocol message object.(tAttributeError(R�t	new_value(R)(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pytsetter�ss/Magic attribute generated for "%s" proto field.tdocN(RfR*R�R�R�ReR�(R'Rt
property_nameR�R�R�((R'R)sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR��s		

cs��j}t|�}tj�j�j���j�t�}��fd�}d|_	d||_
��fd�}d|_	d||_
d|}t||t||d|��dS(s�Adds a public property for a nonrepeated, scalar protocol message field.
  Clients can use this property to get and directly set the value of the field.
  Note that when the client sets the value of a field by using this property,
  all necessary "has" bits are set as a side-effect, and we also perform
  type-checking.

  Args:
    field: A FieldDescriptor for this field.
    cls: The class we're constructing.
  cs|jj���S(N(R6R�(R�(RtR'(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR��ssGetter for %s.cs4�j|�||j�<|js0|j�ndS(N(t
CheckValueR6R5t	_Modified(R�R�(R'Rn(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR��s

	sSetter for %s.s/Magic attribute generated for "%s" proto field.R�N(
RfR*RRzRxR>RttsetR�R�R�ReR�(R'RR)R�tvalid_valuesR�R�R�((RtR'RnsK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR��s				
	

cs��j�t��}�j���fd�}d|_d�|_�fd�}d�}t||t||d|��dS(sNAdds a public property for a nonrepeated, composite protocol message field.
  A composite field is a "group" or "message" field.

  Clients can use this property to get the value of the field, but cannot
  assign to the property directly.

  Args:
    field: A FieldDescriptor for this field.
    cls: The class we're constructing.
  csV|jj��}|dkrR�j�}|j|j�|jj�|�}n|S(N(R6R�R�RpRqR:R�(R�R�(R'R@(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR��ssGetter for %s.cstd���dS(NsJAssignment not allowed to composite field "%s" in protocol message object.(R�(R�R�(R)(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR��ss/Magic attribute generated for "%s" proto field.R�N(RfR*R@R�R�R�ReR�(R'RR�R�R�R�((R'R@R)sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR��s
			

cCsM|j}x=|j�D]/\}}|j�d}t|||j�qWdS(s=Adds properties for all fields in this protocol message type.R�N(R_R`R�ReRF(RRRaRbRcR�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR!s	cs@�fd�}t|��_�fd�}t|��_dS(Ncs��j|_t�|��jj|j|�}||k	rktd|j|j�jj|jf��n|�j|j<|}t	|�r�|�j|j
j<ndS(NsSExtensions "%s" and "%s" both try to extend message type "%s" with field number %d.(R1R0RRR�RFtAssertionErrorR/RRDR@(R2t
actual_handlethandle(R(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pytRegisterExtensions
	cs��}|j|�|S(N(tMergeFromString(tsR	(R(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt
FromString+s	
(tstaticmethodR�R�(RR�R�((RsK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR"scCsM|djtjkr$t|d�S|djtjkrE|djStSdS(s�Given a (FieldDescriptor, value) tuple from _fields, return true if the
  value should be included in the list returned by ListFields().iiN(RBR,ROtboolRxRyR8R\(titem((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt
_IsPresent2s
cCsd�}||_dS(s Helper for _AddMessageMethods().cSsEg|jj�D]}t|�r|^q}|jdd��|S(NtkeycSs|djS(Ni(RF(R�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyRCs(R6R`R�tsort(R�R�t
all_fields((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt
ListFieldsAs.N(R�(R=RR�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt_AddListFieldsMethod>s	csXi�x3|jD](}|jtjkr|�|j<qqW�fd�}||_dS(s Helper for _AddMessageMethods().cszy�|}Wn!tk
r1td|��nX|jtjkri|jj|�}|dk	oh|jS||jkSdS(Ns,Protocol message has no singular "%s" field.(	R-RwRxR,RyR6R�R�R8(R�R�R'tvalue(tsingular_fields(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pytHasFieldQs
N(RRBR,RORfR�(R=RR'R�((R�sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt_AddHasFieldMethodIscs�fd�}||_dS(s Helper for _AddMessageMethods().cs_y�j|}Wn!tk
r4td|��nX||jkrQ|j|=n|j�dS(Ns#Protocol message has no "%s" field.(R�R-RwR6R�(R�R�R'(R=(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt
ClearFieldbs

N(R�(R=RR�((R=sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt_AddClearFieldMethod`scCsd�}||_dS(s Helper for _AddMessageMethods().cSs7t||�||jkr)|j|=n|j�dS(N(R3R6R�(R�R2((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pytClearExtensionxs

N(R�(RR�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt_AddClearExtensionMethodvs	cCsd�}||_dS(s Helper for _AddMessageMethods().cSs i|_d|_|j�dS(N((R6R7R�(R�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pytClear�s		N(R�(R=RR�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt_AddClearMethod�s	cCsd�}||_dS(s Helper for _AddMessageMethods().cSs}t||�|jtjkr5td|j��n|jtjkrl|jj	|�}|dk	ok|jS||jkSdS(Ns"%s" is repeated.(R3RBR,ROR-R/RxRyR6R�R�R8(R�R2R�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pytHasExtension�s
N(R�(RR�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt_AddHasExtensionMethod�s	
cCsd�}||_dS(s Helper for _AddMessageMethods().cSs�t|tj�s%|j|jkr)tS||kr9tS|j�|j�ksUtSt|j�}|j	�t|j�}|j	�||kS(N(
R+tmessage_modtMessageR1RYR\R�tlistR7R�(R�tothertunknown_fieldstother_unknown_fields((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt__eq__�s

N(R�(R=RR�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt_AddEqualsMethod�s	cCsd�}||_dS(s Helper for _AddMessageMethods().cSs
tj|�S(N(R
tMessageToString(R�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt__str__�sN(R�(R=RR�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt
_AddStrMethod�s	cCsd�}||_dS(s Helper for _AddMessageMethods().cSstj|dt�jd�S(Ntas_utf8sutf-8(R
R�R\tdecode(R�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt__unicode__�sN(R�(tunused_message_descriptorRR�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt_AddUnicodeMethod�s	cCsd�}||_dS(s Helper for _AddMessageMethods().cSs+|dkrtj�|_n	||_dS(N(R�R|R}R9(R�tlistener((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pytSetListener�sN(Rq(RR�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt_AddSetListenerMethod�s	cCsIytj|}|||�SWn$tk
rDtjd|��nXdS(s Returns the number of bytes needed to serialize a non-repeated element.
  The returned byte count includes space for tag information and any
  other additional space associated with serializing value.

  Args:
    value: Value we're serializing.
    field_number: Field number of this value.  (Since the field number
      is stored as part of a varint-encoded tag, this has an impact
      on the total bytes required to serialize the value).
    field_type: The type of the field.  One of the TYPE_* constants
      within FieldDescriptor.
  sUnrecognized field type: %dN(RtTYPE_TO_BYTE_SIZE_FNR-R�tEncodeError(R�tfield_numbert
field_typetfn((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt_BytesForNonRepeatedElement�s



cCsd�}||_dS(s Helper for _AddMessageMethods().cSs�|js|jSd}x-|j�D]\}}||j|�7}q#Wx1|jD]&\}}|t|�t|�7}qPW||_t|_t|j_|S(Ni(	R5R4R�RVR7R{RYR:tdirty(R�tsizeRLR�RKtvalue_bytes((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pytByteSize�s			N(R�(R=RR�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt_AddByteSizeMethod�s	cCsd�}||_dS(s Helper for _AddMessageMethods().cSsMg}|j�sCtjd|jjdj|j��f��n|j�S(Ns)Message %s is missing required fields: %st,(t
IsInitializedR�R�R1R/tjointFindInitializationErrorstSerializePartialToString(R�terrors((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pytSerializeToString�s(N(R�(R=RR�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt_AddSerializeToStringMethod�s	cCs(d�}||_d�}||_dS(s Helper for _AddMessageMethods().cSs#t�}|j|j�|j�S(N(Rt_InternalSerializetwritetgetvalue(R�tout((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR�s	cSs_x*|j�D]\}}|j||�q
Wx+|jD] \}}||�||�q7WdS(N(R�RUR7(R�twrite_bytesRLR�RKR�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pytInternalSerialize
s

N(R�R�(R=RR�R�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt"_AddSerializePartialToStringMethods			csOd�}||_tj�tj�|j����fd�}||_dS(s Helper for _AddMessageMethods().cSs�t|�}y1|j|d|�|kr<tjd��nWnDtk
r_tjd��n%tjk
r�}tj|��nX|S(NisUnexpected end-group tag.sTruncated message.(R{t_InternalParseR�tDecodeErrort
IndexErrortstructterror(R�t
serializedtlengthte((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR�s
c
s�|j�|j}|j}x�||kr��||�\}}�j|�}|dkr�|}	�||||�}|dkr�|S|s�g}|_n|j|||	|!f�|}q||||||�}qW|S(Ni����(R�R6R7R�R�tappend(
R�tbuffertpostendt
field_dicttunknown_field_listRKtnew_post
field_decodertvalue_start_pos(tdecoders_by_tagt
local_ReadTagtlocal_SkipField(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt
InternalParse*s"
			N(R�RtReadTagt	SkipFieldRR�(R=RR�R((RRRsK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt_AddMergeFromStringMethods					cseg|jD]}|jtjkr
|^q
�d�fd�}||_�fd�}||_dS(s[Adds the IsInitialized and FindInitializationError methods to the
  protocol message class.cs6xf�D]^}||jks?|jtjkr|j|jr|dk	ra|j|j��ntSqWx�|jj	�D]�\}}|jtjkry|j
tjkr�x|D]8}|j�s�|dk	r�|j|j��ntSq�Wq.|jr.|j�r.|dk	r'|j|j��ntSqyqyWt
S(sChecks if all required fields of a message are set.

    Args:
      errors:  A list which, if provided, will be populated with the field
               paths of all missing required fields.

    Returns:
      True iff the specified message has all required fields set.
    N(R6RxR,RyR8R�R�R�RYR`RBROR�R\(R�R�R'R�telement(trequired_fields(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR�Gs(


c
sDg}x3�D]+}|j|j�s
|j|j�q
q
Wx|j�D]�\}}|jtjkrI|jr�d|j}n	|j}|j	tj
krx�tt|��D]M}||}d||f}|j
�}|g|D]}	||	^q�7}q�Wq<|d}|j
�}|g|D]}	||	^q"7}qIqIW|S(s�Finds required fields which are not initialized.

    Returns:
      A list of strings.  Each string is a path to an uninitialized field from
      the top-level message, e.g. "foo.bar[5].baz".
    s(%s)s%s[%d].t.(R�RfR�R�RxR,RyR.R/RBROtxrangeR{R�(
R�R�R'R�RftiRtprefixt
sub_errorsR�(R	(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR�ms&
		
(
(N(RRBR,tLABEL_REQUIREDR�R�R�(R=RR'R�R�((R	sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt_AddIsInitializedMethod@s$	"cs4tj�tj����fd�}|�_dS(Ncsdt|��s4td�jt|�jf��n|j�|j}x�|jj�D]�\}}|j�kr�|j|�}|dkr�|j
|�}|||<n|j|�qW|j�kr|j
r(|j|�}|dkr|j
|�}|||<n|j|�q(qW||j|<qWW|jr`|jsJg|_n|jj|j�ndS(NsLParameter to MergeFrom() must be instance of same class: expected %s got %s.(R+R�t__name__R>R�R6R`RBR�R�RHR�RxR8R7R�(R�tmsgRR'R�R�(RyROR(sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR��s2
	
	
		(R,RORyR�(RR�((RyRORsK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt_AddMergeFromMethod�s		#cCs�t||�t||�t||�|jrGt|�t|�nt||�t||�t||�t	||�t
|�t||�t||�t
||�t||�t||�t|�dS(s3Adds implementations of all Message methods to cls.N(R�R�R�R�R�R�R�R�R�R�R�R�R�R�RRR(R=R((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR#�s"


	











cCsd�}||_||_dS(s5Adds implementation of private helper methods to cls.cSs;|js7t|_t|j_t|_|jj�ndS(swSets the _cached_byte_size_dirty bit to true,
    and propagates this to our listener iff this was a state change.
    N(R5R\R:R�R8R9tModified(R�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR�s
				N(R�tSetInParent(RR((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR$�s		R~cBs eZdZd�Zd�ZRS(s0MessageListener implementation that a parent message registers with its
  child message.

  In order to support semantics like:

    foo.bar.baz.qux = 23
    assert foo.HasField('bar')

  ...child objects must have back references to their parents.
  This helper class is at the heart of this support.
  cCs=t|tj�r||_ntj|�|_t|_dS(s�Args:
      parent_message: The message whose _Modified() method we should call when
        we receive Modified() messages.
    N(R+tweakreft	ProxyTypet_parent_message_weakreftproxyRYR�(R�tparent_message((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR��s	cCs6|jr
dSy|jj�Wntk
r1nXdS(N(R�RR�tReferenceError(R�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyRs	
(RR�R�R�R(((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR~�s	R�cBsMeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(s�Dict-like container for supporting an indexable "Extensions"
  field on proto instances.

  Note that in all cases we expect extension handles to be
  FieldDescriptors.
  cCs
||_dS(sMextended_message: Message instance for which we are the Extensions dict.
    N(t_extended_message(R�textended_message((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR�"scCs�t|j|�|jjj|�}|dk	r5|S|jtjkr\|j|j�}nV|j	tj
kr�|jj�}y|j
|jj�Wq�tk
r�q�Xn|jS|jjj||�}|S(s8Returns the current value of the given extension handle.N(R3RR6R�R�RBR,RORHRxRyR@RpRqR:RRtR�(R�R2Rr((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt__getitem__(s 
cCs�t||j�stS|jj�}|jj�}g|D]}|jr;|^q;}g|D]}|jr]|^q]}||kS(N(R+t	__class__RYRR�R.(R�R�t	my_fieldstother_fieldsR'((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR�Is""cCs||kS(N((R�R�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt__ne__VscCstd��dS(Nsunhashable object(R�(R�((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt__hash__YscCs�t|j|�|jtjks4|jtjkrJtd|j��nt	j
|j|j�}|j|�||jj
|<|jj�dS(slIf extension_handle specifies a non-repeated, scalar extension
    field, sets the value of that field.
    sKCannot assign to extension "%s" because it is a repeated or composite type.N(R3RRBR,RORxRyR�R/RRzR>R�R6R�(R�R2R�Rn((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt__setitem__`s
cCs|jjj|d�S(s�Tries to find a known extension with the specified name.

    Args:
      name: Extension full name.

    Returns:
      Extension field descriptor.
    N(RRR�R�(R�Rf((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt_FindExtensionByNameus	(
RR�R�R�RR�R"R#R$R%(((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyR�s		!	
			(CR�t
__author__t	cStringIORtImportErrorR%R�Rtgoogle.protobuf.internalRRRRRR|RRtgoogle.protobufRtdescriptor_modR	R�R
tFieldDescriptorR,RR(R*R3RRDRRRRWRRR R�R�R�R�R!R"R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RRRR#R$tobjectR~R�(((sK/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.pyt<module>1sx
									#			1	&				,	'	3		"						
					
					*	R	*		2