ó
ś2ec           @   s%   d  d l  Z  d  d l Z d   Z d S(   i’’’’Nc         C   s³   t  j j |   }  |  } t t  j j t j  } g  } d } xp |  | k rX d j |  S| j d t  j j |    t  j j	 |   }  | |  k r„ t
 d |   n  |  } q? Wd S(   so   
    Given a directory, finds the equivalent package name.  If it
    is directly in sys.path, returns ''.
    t   .i    s*   %s is not under any path found in sys.pathN(   t   ost   patht   abspatht   mapt   syst   Nonet   joint   insertt   basenamet   dirnamet
   ValueError(   t   dirt   orig_dirR   t   packagest   last_dir(    (    s@   /usr/local/lib/python2.7/dist-packages/paste/util/findpackage.pyt   find_package   s    (   R   R   R   (    (    (    s@   /usr/local/lib/python2.7/dist-packages/paste/util/findpackage.pyt   <module>   s   