ó Du—ac@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. spetar@google.com (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.pytclears   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.pyRKsiÿÿÿÿ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