%PDF- %PDF-
Direktori : /proc/self/root/opt/plesk/python/2.7/lib64/python2.7/site-packages/psycopg2/ |
Current File : //proc/self/root/opt/plesk/python/2.7/lib64/python2.7/site-packages/psycopg2/_lru_cache.pyc |
� �ac @ sa d Z d d l m Z d d l m Z d d l m Z e d d d d d g � Z d d � Z d S( s� LRU cache implementation for Python 2.7 Ported from http://code.activestate.com/recipes/578078/ and simplified for our use (only support maxsize > 0 and positional arguments). i����( t namedtuple( t update_wrapper( t RLockt CacheInfot hitst missest maxsizet currsizeid c s � f d � } | S( s� Least-recently-used cache decorator. Arguments to the cached function must be hashable. See: http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used c s# t � � d d g � d \ � � � j � t � t � � g } | | d d g | (| g � d \ � � � � � r � d k s� t d � � � � � � � � � � � � � � � � � f d � } � � � � � � f d � } � � � � f d � } � | _ | | _ | | _ t | � � S( Ni i i i s maxsize %s not supportedc s� | } � �� � | � } | d k r� � \ } | \ } } } } | | � <| | � <| � } | | � <| � <| | � <| | � <� � c d 7<| SWd QX� | � } � �� � \ } | � k r� n� � � � � k r7| } | | � <| | � <| � } � d <| � } d | � <| � <� | =| � | <n6 | � } | | | | g } | | � <| � <� | <� � c d 7<Wd QX| S( Ni i ( t None( t argst keyt linkt roott link_prevt link_nextt resultt lastt oldroott oldkey( t HITSt KEYt MISSESt NEXTt PREVt RESULTt _lent cachet cache_gett lockR t nonlocal_roott statst user_function( sJ /opt/plesk/python/2.7/lib64/python2.7/site-packages/psycopg2/_lru_cache.pyt wrapper&