/usr/lib/python2.6/site-packages/repoze/lru
NameSizeModeActions
tests.py236470644editdlrm
tests.pyc211860644editdlrm
__init__.py130570644editdlrm
__init__.pyc104950644editdlrm
Edit: /usr/lib/python2.6/site-packages/repoze/lru/__init__.pyc (10495B)
Ñò DVc@€s¥dZddklZddkZddkZddkZeƒZdZdefd„ƒYZ defd „ƒYZ d efd „ƒYZ d efd „ƒYZ dS(s! LRU caching class and decorator iÿÿÿÿ(twith_statementNii<tLRUCachecB€s>eZdZd„Zd„Zdd„Zd„Zd„ZRS(s Implements a pseudo-LRU algorithm (CLOCK) The Clock algorithm is not kept strictly to improve performance, e.g. to allow get() and invalidate() to work without acquiring the lock. cC€s¤t|ƒ}|djotdƒ‚n||_tiƒ|_d|_|d|_d|_ d|_ d|_ d|_ d|_ d|_d|_|iƒdS(Nissize must be >0i(tintt ValueErrortsizet threadingtLocktlockthandtmaxpostNonet clock_keyst clock_refstdatat evictionsthitstmissestlookupstclear(tselfR((s7/usr/lib/python2.6/site-packages/repoze/lru/__init__.pyt__init__s            cC€s~|iiiƒzch|_|i}tg||_tg||_d|_ d|_ d|_ d|_ d|_ WdQXdS(s!Remove all entries from the cacheiN(Rt__exit__t __enter__R Rt_MARKERR tFalseR RRRRR(RR((s7/usr/lib/python2.6/site-packages/repoze/lru/__init__.pyR&s      cC€sl|id7_y&|i|\}}|id7_Wn#tj o|id7_|SXt|i|<|S(s5Return value for key. If not in cache, return defaulti(RR RtKeyErrorRtTrueR (Rtkeytdefaulttpostval((s7/usr/lib/python2.6/site-packages/repoze/lru/__init__.pytget9s cC€s¯|i}|i}|i}|i}|iiiƒzp|i|ƒ}|dj o?|\}} | |j o||f||0i(tdefault_timeoutRRRRRRRR R R R R RRRRR(RRR.((s7/usr/lib/python2.6/site-packages/repoze/lru/__init__.pyR‹s              cC€s~|iiiƒzch|_|i}tg||_tg||_d|_ d|_ d|_ d|_ d|_ WdQXdS(s!Remove all entries from the cacheiN(RRRR RRR RR RRRRR(RR((s7/usr/lib/python2.6/site-packages/repoze/lru/__init__.pyRs      cC€s§|id7_y|i|\}}}Wn#tj o|id7_|SX|tiƒjo!|id7_t|i|<|S|id7_t|i|<|SdS(s@Return value for key. If not in cache or expired, return defaultiN( RR RRttimeRRR R(RRRRRtexpires((s7/usr/lib/python2.6/site-packages/repoze/lru/__init__.pyR±s  cC€sÖ|i}|i}|i}|i}|i}|djo |i}n|iiiƒzt|i |ƒ} | dj o6| d} | |t i ƒ|f||RR<RR=(RtnameR5R1((s7/usr/lib/python2.6/site-packages/repoze/lru/__init__.pyt_resolve_setting6s      cC€s?|i||ƒ\}}}t|ƒ}|i|R3(RRBR5t_R4((s7/usr/lib/python2.6/site-packages/repoze/lru/__init__.pytlrucacheLscC€sPdt|i|||ƒ\}}}t||ƒ}|i|R3(RRBR5R1R4((s7/usr/lib/python2.6/site-packages/repoze/lru/__init__.pytexpiring_lrucacheXs cG€sLt|ƒdjo|iiƒ}nx|D]}|i|iƒq-WdS(s_Clear the given cache(s). If no 'names' are passed, clear all caches. iN(tlenR>tkeysR(RtnamesRB((s7/usr/lib/python2.6/site-packages/repoze/lru/__init__.pyRgs N( R*R+R,R R2RRCRERFR(((s7/usr/lib/python2.6/site-packages/repoze/lru/__init__.pyR;(s   I( R,t __future__RRR/R@tobjectRR2RR-R3R;(((s7/usr/lib/python2.6/site-packages/repoze/lru/__init__.pyts    v†