eaiovnaovbqoebvqoeavibavo  Duac@sdZdZddlZddlZejddkrdefdYZdefd YZejjeejjen ejZd efd YZ d e fd YZ ej je de fdYZ defdYZ defdYZdS(sContains 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. spetar@google.com (Petar Petrov)iNiitMappingcBsqeZd Zd dZdZdZdZdZdZ dZ dZ d Z dZ 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|tjstSt|jt|jkS(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         tMutableMappingcBsJeZdZeZedZdZdZdZddZ RS(cCsGy||}Wn'tk r7||jkr3n|SX||=|SdS(N(Rt_MutableMapping__marker(RRRtvalue((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pytpopys cCsKytt|}Wntk r/tnX||}||=||fS(N(tnextR t StopIterationR(RRR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pytpopitems   cCs3yxtr|jqWWntk r.nXdS(N(RR#R(R((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pytclears   cOs%t|dkr0tdjt|n|sEtdn|d}t|dkrk|dnd}t|trxw|D]}||||RWR2RX(RR1tmessage_descriptor((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyR2^scKsR|jj|}|j|j|jj||jjsN|jjn|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|jdS(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|jdS(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.pyRJscCs!|jj||jjdS(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.pyRKsicCs|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.pyRTscCs|j|=|jjdS(s+Deletes the item at the specified position.N(R0R/RC(RR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyRLs cCs|j||5|jjdS(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.pyRUs cCsA||krtSt||js1tdn|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.pyRs  (RRR;RR2R]RERJRKR RTRLRUR(((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyRWWs         t ScalarMapcBseZdZdddddgZdZdZdZdd Zd Z d Z d Z d Z dZ dZdZdZdZRS(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.pyR2s    cCsVy|j|SWn@tk rQ|jj|}|jj}||j|<|SXdS(N(R0RRbRARct DefaultValue(RRtval((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyR3s  cCs|jj|||jkS(N(RbRAR0(Rtitem((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyRscCs||kr||S|SdS(N((RRR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyRs cCsB|jj|}|jj|}||j|<|jjdS(N(RbRARcR0R/RC(RRRt checked_keyt checked_value((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyRSs cCs|j|=|jjdS(N(R0R/RC(RR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyRLs cCs t|jS(N(R%R0(R((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyR4scCs t|jS(N(R R0(R((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyt__iter__scCs t|jS(N(R5R0(R((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyR6scCs$|jj|j|jjdS(N(R0R+R/RC(RR((sG/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.pyRJscCs&|j}|j|_d|d(s  0< -n[Z