ó
Ğ¸Vc           @   s]   y d  d l  m Z WnB e k
 rX d  d l Z d  d l Z e j e j Bd d  Z n Xd S(   i˙˙˙˙(   t   whichNc            s   d   } t  j j    r2 |   |  r.   Sd S| d k rY t  j j d t  j  } n  | sc d S| j t  j  } t	 j
 d k rt  j | k rİ | j d t  j  n  t  j j d d  j t  j  } t   f d   | D  rò   g } qg  | D] }   | ^ qù } n	   g } t   } xu | D]m } t  j j |  }	 |	 | k r+| j |	  x9 | D]. }
 t  j j | |
  } | | |  rc| SqcWq+q+Wd S(	   sS  Given a command, mode, and a PATH string, return the path which
        conforms to the given mode on the PATH, or None if there is no such
        file.
    
        `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result
        of os.environ.get("PATH"), or can be overridden with a custom search
        path.
    
        c         S   s5   t  j j |   o4 t  j |  |  o4 t  j j |   S(   N(   t   ost   patht   existst   accesst   isdir(   t   fnt   mode(    (    sG   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/ptyprocess/util.pyt   _access_check   s    $t   PATHt   win32i    t   PATHEXTt    c         3   s*   |  ]  }   j    j | j     Vq d  S(   N(   t   lowert   endswith(   t   .0t   ext(   t   cmd(    sG   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/ptyprocess/util.pys	   <genexpr>1   s    N(   R   R   t   dirnamet   Nonet   environt   gett   defpatht   splitt   pathsept   syst   platformt   curdirt   insertt   anyt   sett   normcaset   addt   join(   R   R   R   R   t   pathextt   filesR   t   seent   dirt   normdirt   thefilet   name(    (   R   sG   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/ptyprocess/util.pyR       s8    	! 		(   t   shutilR    t   ImportErrorR   R   t   F_OKt   X_OKR   (    (    (    sG   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/ptyprocess/util.pyt   <module>   s   