³ò
™›\Kc        %   @   s«  d  Z  d d k Z d d k Z d d d d d d d	 d
 d d d d d d d d d d d d d d d d d d d d d d  d! d" d# d$ d% g# Z d& Z d' Z d& Z d( Z d) Z d* Z	 d+ Z
 d, Z d- „  Z d. „  Z d/ „  Z d0 „  Z d1 „  Z d2 „  Z d3 „  Z d4 „  Z d5 „  Z d6 „  Z d7 „  Z d8 „  Z d9 „  Z d: „  Z d; „  Z d< „  Z e Z d= „  Z d> „  Z d? „  Z d@ „  Z  dA „  Z! dB „  Z" dC „  Z# dD „  Z$ e$ Z% e& Z' d S(E   sŒ   Common pathname manipulations, OS/2 EMX version.

Instead of importing this module directly, import os and refer to this
module as os.path.
iÿÿÿÿNt   normcaset   isabst   joint
   splitdrivet   splitt   splitextt   basenamet   dirnamet   commonprefixt   getsizet   getmtimet   getatimet   getctimet   islinkt   existst   lexistst   isdirt   isfilet   ismountt   walkt
   expandusert
   expandvarst   normpatht   abspatht   splitunct   curdirt   pardirt   sept   pathsept   defpatht   altsept   extsept   devnullt   realpatht   supports_unicode_filenamest   .s   ..t   /s   \t   ;s   .;C:\bint   nulc         C   s   |  i  d d ƒ i ƒ  S(   sZ   Normalize case of pathname.

    Makes all characters lowercase and all altseps into seps.s   \R$   (   t   replacet   lower(   t   s(    (    s    /usr/lib/python2.5/os2emxpath.pyR        s    c         C   s+   t  |  ƒ d }  |  d j o |  d  d j S(   s   Test whether a path is absolutei   t    s   /\(   R   (   R)   (    (    s    /usr/lib/python2.5/os2emxpath.pyR   -   s    c         G   sl   |  } x_ | D]W } t  | ƒ o
 | } q | d j p | d d j o | | } q | d | } q W| S(   s=   Join two or more pathname components, inserting sep as neededR*   iÿÿÿÿs   /\:R$   (   R   (   t   at   pt   patht   b(    (    s    /usr/lib/python2.5/os2emxpath.pyR   5   s     
c         C   s7   |  d d !d j o |  d d !|  d f Sn d |  f S(   sl   Split a pathname into drive and path specifiers. Returns a 2-tuple
"(drive,path)";  either part may be emptyi   i   t   :i    R*   (    (   R,   (    (    s    /usr/lib/python2.5/os2emxpath.pyR   E   s    c         C   sÕ   |  d d !d j o d |  f Sn |  d d !} | d	 j p | d
 j o‚ t  |  ƒ } | i d d ƒ } | d j o d |  f Sn | i d | d ƒ } | d j o t |  ƒ } n |  |  |  | f Sn d |  f S(   s@  Split a pathname into UNC mount point and relative path specifiers.

    Return a 2-tuple (unc, rest); either part may be empty.
    If unc is not empty, it has the form '//host/mount' (or similar
    using backslashes).  unc+rest is always the input path.
    Paths containing drive letters never have an UNC part.
    i   i   R/   R*   i    R$   s   \iÿÿÿÿs   //s   \\(   R    t   findt   len(   R,   t   firstTwot   normpt   index(    (    s    /usr/lib/python2.5/os2emxpath.pyR   N   s    c         C   s¬   t  |  ƒ \ } }  t |  ƒ } x+ | o# |  | d d j o | d } q! W|  |  |  | } } | } x' | o | d d j o | d  } qj W| p | } | | | f S(   s~   Split a pathname.

    Return tuple (head, tail) where tail is everything after the final slash.
    Either part may be empty.i   s   /\iÿÿÿÿ(   R   R1   (   R,   t   dt   it   headt   tailt   head2(    (    s    /usr/lib/python2.5/os2emxpath.pyR   o   s      c         C   sŸ   d \ } } x† |  D]~ } | d j o | | | d } } q | d j o& | o | | | } } q‘ | } q | o | | } q | | } q W| | f S(   s‘   Split the extension from a pathname.

    Extension is everything from the last dot to the end.
    Return (root, ext), either part may be empty.R*   R$   s   \R#   (   R*   R*   (   R$   s   \(    (   R,   t   roott   extt   c(    (    s    /usr/lib/python2.5/os2emxpath.pyR   ˆ   s     
c         C   s   t  |  ƒ d S(   s)   Returns the final component of a pathnamei   (   R   (   R,   (    (    s    /usr/lib/python2.5/os2emxpath.pyR   Ÿ   s    c         C   s   t  |  ƒ d S(   s-   Returns the directory component of a pathnamei    (   R   (   R,   (    (    s    /usr/lib/python2.5/os2emxpath.pyR   ¦   s    c         C   s‚   |  p d Sn t  |  ƒ } t |  ƒ } t  t | ƒ t | ƒ ƒ } x5 t | ƒ D]' } | | | | j o | |  SqO qO W| |  S(   sG   Given a list of pathnames, returns the longest common leading componentR*   (   t   mint   maxR1   t   xrange(   t   mt   s1t   s2t   nR6   (    (    s    /usr/lib/python2.5/os2emxpath.pyR   ­   s      c         C   s   t  i |  ƒ i S(   s0   Return the size of a file, reported by os.stat()(   t   ost   statt   st_size(   t   filename(    (    s    /usr/lib/python2.5/os2emxpath.pyR	   »   s    c         C   s   t  i |  ƒ i S(   sB   Return the last modification time of a file, reported by os.stat()(   RD   RE   t   st_mtime(   RG   (    (    s    /usr/lib/python2.5/os2emxpath.pyR
   ¿   s    c         C   s   t  i |  ƒ i S(   s<   Return the last access time of a file, reported by os.stat()(   RD   RE   t   st_atime(   RG   (    (    s    /usr/lib/python2.5/os2emxpath.pyR   Ã   s    c         C   s   t  i |  ƒ i S(   s:   Return the creation time of a file, reported by os.stat().(   RD   RE   t   st_ctime(   RG   (    (    s    /usr/lib/python2.5/os2emxpath.pyR   Ç   s    c         C   s   t  S(   s5   Test for symbolic link.  On OS/2 always returns false(   t   False(   R-   (    (    s    /usr/lib/python2.5/os2emxpath.pyR   Î   s    c         C   s4   y t  i |  ƒ } Wn t  i j
 o t Sn Xt S(   s   Test whether a path exists(   RD   RE   t   errorRK   t   True(   R-   t   st(    (    s    /usr/lib/python2.5/os2emxpath.pyR   Ö   s
    	c         C   s@   y t  i |  ƒ } Wn t  i j
 o t Sn Xt i | i ƒ S(   s"   Test whether a path is a directory(   RD   RE   RL   RK   t   S_ISDIRt   st_mode(   R-   RN   (    (    s    /usr/lib/python2.5/os2emxpath.pyR   ã   s
    	c         C   s@   y t  i |  ƒ } Wn t  i j
 o t Sn Xt i | i ƒ S(   s%   Test whether a path is a regular file(   RD   RE   RL   RK   t   S_ISREGRP   (   R-   RN   (    (    s    /usr/lib/python2.5/os2emxpath.pyR   ð   s
    	c         C   sX   t  |  ƒ \ } } | o | d j Sn t |  ƒ d } t | ƒ d j o | d d j S(   s?   Test whether a path is a mount point (defined as root of drive)R*   R$   s   \i   i    s   /\(   R*   R$   s   \(   R   R   R1   (   R-   t   unct   restR,   (    (    s    /usr/lib/python2.5/os2emxpath.pyR   ü   s
    c         C   sœ   y t  i |  ƒ } Wn t  i j
 o d Sn X| | |  | ƒ d } xO | D]G } | | j o4 t |  | ƒ } t | ƒ o t | | | ƒ q” qM qM Wd S(   së   Directory tree walk whth callback function.

    walk(top, func, arg) calls func(arg, d, files) for each directory d
    in the tree rooted at top (including top itself); files is a list
    of all the files and subdirs in directory d.NR#   s   ..(   R#   s   ..(   RD   t   listdirRL   R   R   R   (   t   topt   funct   argt   namest
   exceptionst   name(    (    s    /usr/lib/python2.5/os2emxpath.pyR     s    	 c         C   sù   |  d  d j o |  Sn d t  |  ƒ } } x- | | j  o |  | d j o | d } q/ W| d j o€ d t i j o t i d } qí d t i j o |  Sqí y t i d } Wn t j
 o d } n Xt | t i d ƒ } n |  S| |  | S(   sL   Expand ~ and ~user constructs.

    If user or $HOME is unknown, do nothing.i   t   ~s   /\t   HOMEt   HOMEPATHt	   HOMEDRIVER*   (   R1   RD   t   environt   KeyErrorR   (   R-   R6   RC   t   userhomet   drive(    (    s    /usr/lib/python2.5/os2emxpath.pyR   )  s$     c         C   s•  d |  j o |  Sn d d k  } | i | i d } d } d } t |  ƒ } xA| | j  o3|  | } | d j oq |  | d }  t |  ƒ } y) |  i d ƒ } | d |  | d  } Wq‚t j
 o | |  } | d } q‚Xnž| d j o†|  | d | d	 !d j o | | } | d } q‚|  | d | d	 !d
 j oŠ |  | d	 }  t |  ƒ } yB |  i d ƒ } |  |  } | t i j o | t i | } n Wqtt j
 o | |  } | d } qtXq‚d } | d } |  | | d !} xD | d j o6 | | j o) | | } | d } |  | | d !} qðW| t i j o | t i | } n | d j o | | } q‚n | | } | d } qP W| S(   sZ   Expand shell variables of form $var and ${var}.

    Unknown variables are left unchanged.t   $iÿÿÿÿNs   _-R*   i    s   'i   i   t   {t   }(   t   stringt   letterst   digitsR1   R4   t
   ValueErrorRD   R_   (   R-   Rf   t   varcharst   resR4   t   pathlenR<   t   var(    (    s    /usr/lib/python2.5/os2emxpath.pyR   K  sb     





 


c         C   sj  |  i  d d ƒ }  t |  ƒ \ } }  x* |  d  d j o | d } |  d }  q' W|  i d ƒ } d } xÏ | t | ƒ j  o» | | d j o | | =qi | | d j oB | d j o5 | | d d j o  | | d | d 5| d } qi | | d j o- | d j o  | | d d j o | | =qi | d } qi W| o | o | i d ƒ n | d i | ƒ S(	   s0   Normalize path, eliminating double slashes, etc.s   \R$   i   i    R#   s   ..R*   (   R*   s   ..(   R'   R   R   R1   t   appendR   (   R-   t   prefixt   compsR6   (    (    s    /usr/lib/python2.5/os2emxpath.pyR   „  s*     
 33c         C   s0   t  |  ƒ p t t i ƒ  |  ƒ }  n t |  ƒ S(   s%   Return the absolute version of a path(   R   R   RD   t   getcwdR   (   R-   (    (    s    /usr/lib/python2.5/os2emxpath.pyR   ž  s    ((   t   __doc__RD   RE   t   __all__R   R   R   R   R   R   R   R    R    R   R   R   R   R   R   R   R   R   R	   R
   R   R   R   R   R   R   R   R   R   R   R   R   R   R!   RK   R"   (    (    (    s    /usr/lib/python2.5/os2emxpath.pys   <module>   sV   						!																"	9		