-í
ç¶<c       sz   d  Z  d k Z d k Td d d d d d d	 g Z h  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d S(   sy   Maintain a cache of stat() information on files.

There are functions to reset the cache or to selectively remove items.
N(   s   *s   stats   resets   forgets   forget_prefixs
   forget_dirs   forget_except_prefixs   isdirc    sB   t  i |  t ƒ } | t j o t i |  ƒ t  |  <} n | Sd S(   s'   Stat a file, possibly out of the cache.N(   s   caches   gets   paths   Nones   rets   _oss   stat(   s   paths   ret(    (    s   /usr/lib/python2.2/statcache.pys   stat s
     c      s   t  i ƒ  d S(   s   Clear the cache.N(   s   caches   clear(    (    (    s   /usr/lib/python2.2/statcache.pys   reset s     c    s%   y t  |  =Wn t j
 o n Xd S(   s1   Remove a given item from the cache, if it exists.N(   s   caches   paths   KeyError(   s   path(    (    s   /usr/lib/python2.2/statcache.pys   forget s
     c    s9   x2 t  i ƒ  D]$ } | i |  ƒ o t | ƒ n q Wd S(   s)   Remove all pathnames with a given prefix.N(   s   caches   keyss   paths
   startswiths   prefixs   forget(   s   prefixs   path(    (    s   /usr/lib/python2.2/statcache.pys   forget_prefix& s
      c    s†   d k  l } l } | | |  d ƒ ƒ d }  t |  ƒ xI t i ƒ  D]; } | i |  ƒ o | | ƒ d |  j o t | ƒ n qC Wd S(   sA   Forget a directory and all entries except for entries in subdirs.(   s   splits   joins   xxxi    N(	   s   os.paths   splits   joins   prefixs   forgets   caches   keyss   paths
   startswith(   s   prefixs   joins   splits   path(    (    s   /usr/lib/python2.2/statcache.pys
   forget_dir, s     
 'c    s:   x3 t  i ƒ  D]% } | i |  ƒ o t | ƒ n q Wd S(   sk   Remove all pathnames except with a given prefix.

    Normally used with prefix = '/' after a chdir().
    N(   s   caches   keyss   paths
   startswiths   prefixs   forget(   s   prefixs   path(    (    s   /usr/lib/python2.2/statcache.pys   forget_except_prefix= s
      c    s?   y t  |  ƒ } Wn t i j
 o d Sn Xt | t ƒ Sd S(   s   Return 1 if directory, else 0.i    N(   s   stats   paths   sts   _oss   errors   S_ISDIRs   ST_MODE(   s   paths   st(    (    s   /usr/lib/python2.2/statcache.pys   isdirG s     	(   s   __doc__s   oss   _oss   stats   __all__s   caches   resets   forgets   forget_prefixs
   forget_dirs   forget_except_prefixs   isdir(
   s   resets   forget_except_prefixs   stats   forget_prefixs   _oss   __all__s
   forget_dirs   caches   isdirs   forget(    (    s   /usr/lib/python2.2/statcache.pys   ? s   							
