� S�Ljc@sdZdZddlZddlZejddkr�defd��YZdefd ��YZejje�ejje�n ejZd efd ��YZ d e fd ��YZ ej je �de fd��YZ defd��YZ defd��YZdS(s�Contains container classes to represent different protocol buffer types. This file defines container classes which represent categories of protocol buffer field types which need extra maintenance. Currently these categories are: - Repeated scalar fields - These are all repeated fields which aren't composite (e.g. they are of simple types like int32, string, etc). - Repeated composite fields - Repeated fields which are composite. This includes groups and nested messages. s[email protected] (Petar Petrov)i����NiitMappingcBsqeZd Zd d�Zd�Zd�Zd�Zd�Zd�Z d�Z d�Z d Z d�Z d �ZRS( cCs%y ||SWntk r |SXdS(N(tKeyError(tselftkeytdefault((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pytgetGs  cCs)y ||Wntk r tSXtSdS(N(RtFalsetTrue(RR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyt __contains__Ms   cCs t|�S(N(titer(R((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pytiterkeysUsccsx|D]}||VqWdS(N((RR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyt itervaluesXs ccs$x|D]}|||fVqWdS(N((RR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyt iteritems\s cCs t|�S(N(tlist(R((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pytkeys`scCs!g|D]}|||f^qS(N((RR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pytitemscscCsg|D]}||^qS(N((RR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pytvaluesfscCs8t|tj�stSt|j��t|j��kS(N(t isinstancet collectionsRtNotImplementedtdictR(Rtother((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyt__eq__lscCs ||k S(N((RR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyt__ne__qs(N(t__name__t __module__t __slots__tNoneRRR R R RRRt__hash__RR(((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyRDs         tMutableMappingcBsJeZdZe�Zed�Zd�Zd�Zd�Zdd�Z RS(cCsGy||}Wn'tk r7||jkr3�n|SX||=|SdS(N(Rt_MutableMapping__marker(RRRtvalue((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pytpopys cCsKytt|��}Wntk r/t�nX||}||=||fS(N(tnextR t StopIterationR(RRR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pytpopitem�s   cCs3yxtr|j�qWWntk r.nXdS(N(RR#R(R((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pytclear�s   cOs%t|�dkr0tdjt|����n|sEtd��n|d}t|�dkrk|dnd}t|t�r�xw|D]}||||RWR2RX(RR1tmessage_descriptor((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyR2^scKsR|jj|�}|j|j�|jj|�|jjsN|jj�n|S(s{Adds a new element at the end of the list and returns it. Keyword arguments may be used to initialize the element. (RXt_concrete_classt _SetListenerR/R0R@RBRC(RR:t new_element((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pytaddps  cCsm|jj}|j}|j}x>|D]6}|�}|j|�|j|�|j|�q%W|j�dS(s{Extends by appending the given sequence of elements of the same type as this one, copying each individual message. N(RXRZR/R0R[RJR@RC(RRFt message_classtlistenerRtmessageR\((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyRE{s       cCs|j|j�dS(svAppends the contents of another repeated field of the same type to this one, copying each individual message. N(RER0(RR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyRJ�scCs!|jj|�|jj�dS(s8Removes an item from the list. Similar to list.remove().N(R0RKR/RC(RRH((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyRK�si����cCs|j|}|j|�|S(sDRemoves and returns an item at a given index. Similar to list.pop().(R0RL(RRR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyR �s  cCs|j||!S(sARetrieves the subset of items from between the specified indices.(R0(RRQRR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyRT�scCs|j|=|jj�dS(s+Deletes the item at the specified position.N(R0R/RC(RR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyRL�s cCs|j||5|jj�dS(s?Deletes the subset of items from between the specified indices.N(R0R/RC(RRQRR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyRU�s cCsA||krtSt||j�s1td��n|j|jkS(s/Compares the current instance with another one.sSCan only compare repeated composite fields against other repeated composite fields.(RRRVR&R0(RR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyR�s  (RRR;RR2R]RERJRKR RTRLRUR(((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyRWWs         t ScalarMapcBs�eZdZdddddgZd�Zd�Zd�Zdd �Zd �Z d �Z d �Z d �Z d�Z d�Zd�Zd�Zd�ZRS(sGSimple, type-checked, dict-like container for holding repeated scalars.t _key_checkert_value_checkerR0R/t_entry_descriptorcCs1||_||_||_||_i|_dS(s� Args: message_listener: A MessageListener implementation. The ScalarMap will call this object's Modified() method when it is modified. key_checker: A type_checkers.ValueChecker instance to run on keys inserted into this container. value_checker: A type_checkers.ValueChecker instance to run on values inserted into this container. entry_descriptor: The MessageDescriptor of a map entry: key and value. N(R/RbRcRdR0(RR1t key_checkert value_checkertentry_descriptor((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyR2�s    cCsVy|j|SWn@tk rQ|jj|�}|jj�}||j|<|SXdS(N(R0RRbRARct DefaultValue(RRtval((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyR3�s  cCs|jj|�||jkS(N(RbRAR0(Rtitem((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyR�scCs||kr||S|SdS(N((RRR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyR�s cCsB|jj|�}|jj|�}||j|<|jj�dS(N(RbRARcR0R/RC(RRRt checked_keyt checked_value((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyRS�s cCs|j|=|jj�dS(N(R0R/RC(RR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyRL�s cCs t|j�S(N(R%R0(R((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyR4�scCs t|j�S(N(R R0(R((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyt__iter__�scCs t|j�S(N(R5R0(R((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyR6�scCs$|jj|j�|jj�dS(N(R0R+R/RC(RR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyRJ�scCs&|j}|j�|_d|d(s  0< -n[Z