ó
²<ac           @   sT   d  d l  Z  d  d l m Z e  j d  Z d e d  Z d e f d     YZ	 d S(   i’’’’N(   t   dumpss/   .*?/usr/lib/python(\d.\d+)/(site|dist)-packagesc         C   s   t  |  t  r1 t d   |  j d  D  }  n  |  d	 k rJ d |  } n
 d |  } | rg d | } n  | r d | | f } n  | S(
   są   Return path to site-packages directory.

    >>> sitedir((2, 5))
    '/usr/lib/python2.5/site-packages/'
    >>> sitedir((2, 7), 'python-foo', True)
    'debian/python-foo/usr/lib/debug/usr/lib/python2.7/dist-packages/'
    c         s   s   |  ] } t  |  Vq d  S(   N(   t   int(   t   .0t   i(    (    s$   /usr/share/python/debpython/tools.pys	   <genexpr>%   s    t   .i   i   s#   /usr/lib/python%d.%d/dist-packages/s#   /usr/lib/python%d.%d/site-packages/s   /usr/lib/debug%ss   debian/%s%s(   i   i   (   t
   isinstancet
   basestringt   tuplet   split(   t   versiont   packaget   gdbt   path(    (    s$   /usr/share/python/debpython/tools.pyt   sitedir   s    "
t   memoizec           B   s   e  Z d    Z d   Z RS(   c         C   s   | |  _  i  |  _ d  S(   N(   t   funct   cache(   t   selfR   (    (    s$   /usr/share/python/debpython/tools.pyt   __init__5   s    	c         O   sH   t  | | f  } | |  j k r= |  j | |   |  j | <n  |  j | S(   N(   R    R   R   (   R   t   argst   kwargst   key(    (    s$   /usr/share/python/debpython/tools.pyt   __call__9   s    (   t   __name__t
   __module__R   R   (    (    (    s$   /usr/share/python/debpython/tools.pyR   4   s   	(
   t   ret   cPickleR    t   compilet   PUBLIC_DIR_REt   Nonet   FalseR   t   objectR   (    (    (    s$   /usr/share/python/debpython/tools.pyt   <module>   s   