Viewing File: /usr/lib/python2.7/site-packages/urllib3/_collections.pyc
ó
_XîTc @ s, d d l m Z m Z y d d l m Z Wn$ e k
rP d d d „ ƒ YZ n Xy d d l m Z Wn! e k
rˆ d d l m Z n Xd d l m Z m
Z
m Z d d g Z e
d
d d g ƒ Z e ƒ Z d e f d
„ ƒ YZ e j Z e j Z e j Z e j Z e j Z d e f d „ ƒ YZ d S( iÿÿÿÿ( t Mappingt MutableMapping( t RLockR c B s e Z d „ Z d „ Z RS( c C s d S( N( ( t self( ( s8 /usr/lib/python2.7/site-packages/urllib3/_collections.pyt __enter__ s c C s d S( N( ( R t exc_typet exc_valuet traceback( ( s8 /usr/lib/python2.7/site-packages/urllib3/_collections.pyt __exit__ s ( t __name__t
__module__R R ( ( ( s8 /usr/lib/python2.7/site-packages/urllib3/_collections.pyR s ( t OrderedDicti ( t iterkeyst
itervaluest PY3t RecentlyUsedContainert HTTPHeaderDictt cookies
set-cookies set-cookie2c B sb e Z d Z e Z d d
d „ Z d „ Z d „ Z d „ Z d „ Z
d „ Z d „ Z d „ Z
RS( s‘
Provides a thread-safe dict-like container which maintains up to
``maxsize`` keys while throwing away the least-recently-used keys beyond
``maxsize``.
:param maxsize:
Maximum number of recent elements to retain.
:param dispose_func:
Every time an item is evicted from the container,
``dispose_func(value)`` is called. Callback which will get called
i
c C s1 | | _ | | _ | j ƒ | _ t ƒ | _ d S( N( t _maxsizet dispose_funct ContainerClst
_containerR t lock( R t maxsizeR ( ( s8 /usr/lib/python2.7/site-packages/urllib3/_collections.pyt __init__, s c C s7 | j ( | j j | ƒ } | | j | <| SWd QXd S( N( R R t pop( R t keyt item( ( s8 /usr/lib/python2.7/site-packages/urllib3/_collections.pyt __getitem__3 s
c C s— t } | j ] | j j | t ƒ } | | j | <t | j ƒ | j k rh | j j d t ƒ \ } } n Wd QX| j r“ | t k r“ | j | ƒ n d S( Nt last( t _NullR R t gett lenR t popitemt FalseR ( R R t valuet
evicted_valuet _key( ( s8 /usr/lib/python2.7/site-packages/urllib3/_collections.pyt __setitem__: s
$c C s? | j | j j | ƒ } Wd QX| j r; | j | ƒ n d S( N( R R R R ( R R R# ( ( s8 /usr/lib/python2.7/site-packages/urllib3/_collections.pyt __delitem__I s
c C s! | j t | j ƒ SWd QXd S( N( R R R ( R ( ( s8 /usr/lib/python2.7/site-packages/urllib3/_collections.pyt __len__P s
c C s t d ƒ ‚ d S( Ns7 Iteration over this class is unlikely to be threadsafe.( t NotImplementedError( R ( ( s8 /usr/lib/python2.7/site-packages/urllib3/_collections.pyt __iter__T s c C s` | j ' t t | j ƒ ƒ } | j j ƒ Wd QX| j r\ x | D] } | j | ƒ qB Wn d S( N( R t listR
R t clearR ( R t valuesR# ( ( s8 /usr/lib/python2.7/site-packages/urllib3/_collections.pyR, W s
c C s' | j t t | j ƒ ƒ SWd QXd S( N( R R+ R R ( R ( ( s8 /usr/lib/python2.7/site-packages/urllib3/_collections.pyt keysa s
N( R R
t __doc__R R t NoneR R R&