;ò
ïŒü?c        !   @   s“  d  Z  d k Z 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" g! Z d# Z d$ Z d# 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 d= „  Z d> „  Z  d? „  Z! d@ „  Z" e" Z# e$ Z% d S(A   sŒ   Common pathname manipulations, OS/2 EMX version.

Instead of importing this module directly, import os and refer to this
module as os.path.
Ns   normcases   isabss   joins
   splitdrives   splits   splitexts   basenames   dirnames   commonprefixs   getsizes   getmtimes   getatimes   getctimes   islinks   existss   isdirs   isfiles   ismounts   walks
   expandusers
   expandvarss   normpaths   abspaths   splituncs   curdirs   pardirs   seps   pathseps   defpaths   altseps   extseps   realpaths   supports_unicode_filenamess   .s   ..s   /s   \s   ;s   .;C:\binc         C   s   |  i d d ƒ i ƒ  Sd S(   sZ   Normalize case of pathname.

    Makes all characters lowercase and all altseps into seps.s   \s   /N(   s   ss   replaces   lower(   s   s(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   normcase   s     c         C   s/   t  |  ƒ d }  |  d j o |  d  d j Sd S(   s   Test whether a path is absolutei   s    s   /\N(   s
   splitdrives   s(   s   s(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   isabs,   s     c         G   sp   |  } x_ | D]W } t | ƒ o
 | } q | d j p | d d j o | | } q | d | } q W| Sd S(   s=   Join two or more pathname components, inserting sep as neededs    iÿÿÿÿs   /\:s   /N(   s   as   paths   ps   bs   isabs(   s   as   ps   bs   path(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   join4   s      
c         C   s;   |  d d !d j o |  d d !|  d f Sn d |  f Sd S(   sl   Split a pathname into drive and path specifiers. Returns a 2-tuple
"(drive,path)";  either part may be emptyi   i   s   :i    s    N(   s   p(   s   p(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys
   splitdriveD   s     c         C   sá   |  d d !d j o d |  f Sn |  d d !} | d d j p | d 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 Sd	 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   s   :s    i    s   /s   \iÿÿÿÿN(   s   ps   firstTwos   normcases   normps   finds   indexs   len(   s   ps   indexs   firstTwos   normp(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   splituncM   s     "c         C   sµ   t  |  ƒ \ } }  t |  ƒ } x+ | o |  | d d j o | d } q! W|  |  |  | f \ } } | } x' | o | d d j o | d  } qo W| p | } | | | f Sd 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ÿÿÿÿN(   s
   splitdrives   ps   ds   lens   is   heads   tails   head2(   s   ps   heads   ds   is   tails   head2(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   splitn   s       c         C   s¹   d d f \ } } x– |  D]Ž } | d d g j o | | | d f \ } } q | d j o+ | o | | | f \ } } q§ | } q | o | | } q | | } q W| | f Sd 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.s    s   /s   \s   .N(   s   roots   exts   ps   c(   s   ps   exts   roots   c(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   splitext‡   s      
c         C   s   t  |  ƒ d Sd S(   s)   Returns the final component of a pathnamei   N(   s   splits   p(   s   p(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   basenamež   s     c         C   s   t  |  ƒ d Sd S(   s-   Returns the directory component of a pathnamei    N(   s   splits   p(   s   p(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   dirname¥   s     c         C   s‘   |  o d Sn |  d } xl |  D]d } x[ t t | ƒ ƒ D]G } | | d  | | d  j o$ | |  } | d j o d Sn Pq: q: Wq! W| Sd S(   sG   Given a list of pathnames, returns the longest common leading components    i    i   N(   s   ms   prefixs   items   ranges   lens   i(   s   ms   is   items   prefix(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   commonprefix¬   s      
  
 c         C   s   t  i |  ƒ i Sd S(   s0   Return the size of a file, reported by os.stat()N(   s   oss   stats   filenames   st_size(   s   filename(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   getsize»   s     c         C   s   t  i |  ƒ i Sd S(   sB   Return the last modification time of a file, reported by os.stat()N(   s   oss   stats   filenames   st_mtime(   s   filename(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   getmtime¿   s     c         C   s   t  i |  ƒ i Sd S(   s<   Return the last access time of a file, reported by os.stat()N(   s   oss   stats   filenames   st_atime(   s   filename(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   getatimeÃ   s     c         C   s   t  i |  ƒ i Sd S(   s:   Return the creation time of a file, reported by os.stat().N(   s   oss   stats   filenames   st_ctime(   s   filename(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   getctimeÇ   s     c         C   s   t  Sd S(   s5   Test for symbolic link.  On OS/2 always returns falseN(   s   False(   s   path(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   islinkÎ   s     c         C   s8   y t  i |  ƒ } Wn t  i j
 o t Sn Xt Sd S(   s   Test whether a path existsN(   s   oss   stats   paths   sts   errors   Falses   True(   s   paths   st(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   existsÖ   s     	c         C   sD   y t  i |  ƒ } Wn t  i j
 o t Sn Xt i | i ƒ Sd S(   s"   Test whether a path is a directoryN(   s   oss   stats   paths   sts   errors   Falses   S_ISDIRs   st_mode(   s   paths   st(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   isdirá   s     	c         C   sD   y t  i |  ƒ } Wn t  i j
 o t Sn Xt i | i ƒ Sd S(   s%   Test whether a path is a regular fileN(   s   oss   stats   paths   sts   errors   Falses   S_ISREGs   st_mode(   s   paths   st(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   isfileî   s     	c         C   se   t  |  ƒ \ } } | o | d d d f j Sn t |  ƒ d } t | ƒ d j o | d d j Sd S(   s?   Test whether a path is a mount point (defined as root of drive)s    s   /s   \i   i    s   /\N(   s   splituncs   paths   uncs   rests
   splitdrives   ps   len(   s   paths   rests   ps   unc(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   ismountú   s     c         C   s¢   y t  i |  ƒ } Wn t  i j
 o d Sn X| | |  | ƒ d d f } xO | D]G } | | j o4 t	 |  | ƒ } t
 | ƒ o t | | | ƒ qš qS qS 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.Ns   .s   ..(   s   oss   listdirs   tops   namess   errors   funcs   args
   exceptionss   names   joins   isdirs   walk(   s   tops   funcs   args   names   namess
   exceptions(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   walk  s     	 c         C   s  |  d  d j o |  Sn d t |  ƒ f \ } } x- | | j  o |  | d j o | d } q4 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| |  | Sd S(	   sL   Expand ~ and ~user constructs.

    If user or $HOME is unknown, do nothing.i   s   ~s   /\s   HOMEs   HOMEPATHs	   HOMEDRIVEs    N(
   s   paths   lens   is   ns   oss   environs   userhomes   drives   KeyErrors   join(   s   paths   is   drives   ns   userhome(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys
   expanduser'  s&      c         C   s–  d |  j o |  Sn 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 Wqqt
 j
 o | |  } | d } qqXqd } | d } |  | | d !} xD | d j o
 | | j o) | | } | d } |  | | d !} qíW| t i j o | t i | } n | d j o | | } qn | | } | d } qM W| Sd S(   sZ   Expand shell variables of form $var and ${var}.

    Unknown variables are left unchanged.s   $Ns   _-s    i    s   'i   i   s   {s   }(   s   paths   strings   letterss   digitss   varcharss   ress   indexs   lens   pathlens   cs
   ValueErrors   vars   oss   environ(   s   paths   indexs   cs   strings   ress   varcharss   pathlens   var(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys
   expandvarsI  sd     	 





 


c         C   st  |  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 o% | d j o | | d d d f 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	 | ƒ Sd S(	   s0   Normalize path, eliminating double slashes, etc.s   \s   /i   i    s   .s   ..s    N(
   s   paths   replaces
   splitdrives   prefixs   splits   compss   is   lens   appends   join(   s   paths   is   compss   prefix(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   normpath‚  s,      
 93c         C   s5   t  |  ƒ o t t i ƒ  |  ƒ }  n t |  ƒ Sd S(   s%   Return the absolute version of a pathN(   s   isabss   paths   joins   oss   getcwds   normpath(   s   path(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   abspathœ  s     (&   s   __doc__s   oss   stats   __all__s   curdirs   pardirs   extseps   seps   altseps   pathseps   defpaths   normcases   isabss   joins
   splitdrives   splituncs   splits   splitexts   basenames   dirnames   commonprefixs   getsizes   getmtimes   getatimes   getctimes   islinks   existss   isdirs   isfiles   ismounts   walks
   expandusers
   expandvarss   normpaths   abspaths   realpaths   Falses   supports_unicode_filenames($   s   pardirs   existss   seps   splitexts   basenames   walks
   expandvarss   altseps
   expandusers   getmtimes   defpaths   dirnames   isfiles   supports_unicode_filenamess   __all__s   splituncs   pathseps   getsizes   curdirs   islinks   splits   realpaths   stats   commonprefixs   abspaths   normcases   getatimes   isdirs   joins   getctimes   isabss   normpaths   ismounts
   splitdrives   extseps   os(    (    s'   /mit/python/lib/python2.3/os2emxpath.pys   ?   sH   		i						!																"	9		