
M9c       s<    d  Z    d k Z 	 d k Z  d   Z  d   Z % d   Z 5 d   Z > d   Z _ d   Z x 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 <d   Z wd   Z d   Z d S(   s   Common pathname manipulations, WindowsNT/95 version. 

Instead of importing this module directly, import os and refer to this
module as os.path.
Nc    s#      |  i d d  i   Sd S(   sa   Normalize case of pathname.

    Makes all characters lowercase and all slashes into backslashes.s   /s   \N(   s   ss   replaces   lower(   s   ss#   /mit/python/lib/python2.0/ntpath.pys   normcase s   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   ss#   /mit/python/lib/python2.0/ntpath.pys   isabs s   c    s   % & ' |  } ( xt | d ( rg } ) t |  o * | } nE + | d j p | d d j o , | | } n . | d | } q W/ | Sd S(   s=   Join two or more pathname components, inserting "\" as neededi    s    i   s   /\:s   \N(   s   as   paths   ps   bs   isabs(   s   as   ps   paths   bs#   /mit/python/lib/python2.0/ntpath.pys   join% s   	 	"c    sJ   5 7 8 |  d d !d j o 9 |  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   ps#   /mit/python/lib/python2.0/ntpath.pys
   splitdrive5 s   c    s  > E F |  d d !d j o G d |  f Sn H |  d d !} I | d j p
 | d j o N t |   } O | i d d  } P | d j o R d |  f Sn S | i d | d  } T | d j o U t |   } n V |  |  |  | f Sn W 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   \\s   \N(   s   ps   firstTwos   normcases   normps   finds   indexs   len(   s   ps   firstTwos   normps   indexs#   /mit/python/lib/python2.0/ntpath.pys   splitunc> s   c    s   _ c e t  |   \ } }  g t |   } h x1 h | o |  | d d j o i | d } q0 Wj |  |  |  | f \ } } l | } m x/ m | o | d d j o n | d  } q Wo | p | } 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   /\N(   s
   splitdrives   ps   ds   lens   is   heads   tails   head2(   s   ps   ds   is   heads   tails   head2s#   /mit/python/lib/python2.0/ntpath.pys   split_ s    	 c    s   x | } d d f \ } } ~ x |  d ~ r }  | d d g j o!  | | | d f \ } } nm  | d j o4  | o  | | | f \ } } n
  | } n)  | o  | | } n  | | } 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    i    s   /s   \s   .N(   s   roots   exts   ps   c(   s   ps   roots   exts   cs#   /mit/python/lib/python2.0/ntpath.pys   splitextx s    	!

c    s      t  |   d Sd S(   s)   Returns the final component of a pathnamei   N(   s   splits   p(   s   ps#   /mit/python/lib/python2.0/ntpath.pys   basename s   c    s      t  |   d Sd S(   s-   Returns the directory component of a pathnamei    N(   s   splits   p(   s   ps#   /mit/python/lib/python2.0/ntpath.pys   dirname s   c    s      |  o  d Sn  |  d }  x |  d  r{ }  xo t t |   d  rV }  | | d  | | d  j o0  | |  }  | d j o  d Sn  Pn qV Wq5 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   prefixs   items   is#   /mit/python/lib/python2.0/ntpath.pys   commonprefix s     	 	  c    s*      t  i |   }  | t i Sd S(   s0   Return the size of a file, reported by os.stat()N(   s   oss   stats   filenames   sts   ST_SIZE(   s   filenames   sts#   /mit/python/lib/python2.0/ntpath.pys   getsize s   c    s*      t  i |   }  | t i Sd S(   sB   Return the last modification time of a file, reported by os.stat()N(   s   oss   stats   filenames   sts   ST_MTIME(   s   filenames   sts#   /mit/python/lib/python2.0/ntpath.pys   getmtime s   c    s*      t  i |   }  | t i Sd S(   s<   Return the last access time of a file, reported by os.stat()N(   s   oss   stats   filenames   sts   ST_ATIME(   s   filenames   sts#   /mit/python/lib/python2.0/ntpath.pys   getatime s   c    s      d Sd S(   s=   Test for symbolic link.  On WindowsNT/95 always returns falsei    N(    (   s   paths#   /mit/python/lib/python2.0/ntpath.pys   islink s   c    sM      y  t  i |   } Wn   t  i j
 o  d Sn X d Sd S(   s   Test whether a path existsi    i   N(   s   oss   stats   paths   sts   error(   s   paths   sts#   /mit/python/lib/python2.0/ntpath.pys   exists s   c    s]      y  t  i |   } Wn   t  i j
 o  d Sn X t i | t i  Sd S(   s"   Test whether a path is a directoryi    N(   s   oss   stats   paths   sts   errors   S_ISDIRs   ST_MODE(   s   paths   sts#   /mit/python/lib/python2.0/ntpath.pys   isdir s   c    s]      y  t  i |   } Wn   t  i j
 o  d Sn X t i | t i  Sd S(   s%   Test whether a path is a regular filei    N(   s   oss   stats   paths   sts   errors   S_ISREGs   ST_MODE(   s   paths   sts#   /mit/python/lib/python2.0/ntpath.pys   isfile s   c    sz      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   uncs   rests   ps#   /mit/python/lib/python2.0/ntpath.pys   ismount s   
c    s    y t  i |   } Wn  t  i j
 o d Sn X| | |  |  	d d f } 
x` | d 
rS } | | j o= t	 |  |  } t
 |  o t | | |  n n qp 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   ..i    (   s   oss   listdirs   tops   namess   errors   funcs   args
   exceptionss   names   joins   isdirs   walk(   s   tops   funcs   args   namess
   exceptionss   names#   /mit/python/lib/python2.0/ntpath.pys   walk s    	c    sE  |  d  d j o |  Sn  d t |   f \ } } !x3 !| | j  o |  | d j o "| d } qF W#| d j o $t i i d  o %t i d } nu &t i i d  o '|  SnS )y *t i d } Wn +t	 j
 o ,d } n X-t
 | t i d  } n /|  S0| |  | 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   has_keys   userhomes   drives   KeyErrors   join(   s   paths   is   ns   userhomes   drives#   /mit/python/lib/python2.0/ntpath.pys
   expandusers&    !c    s5  <?@d |  j o A|  Sn Bd k } C| i | i d } Dd } Ed } Ft |   } GxG| | j  oH|  | } I| d j o J|  | d }  Kt |   } Ly/ M|  i d  } N| d |  | d  } Wn0 Ot
 j
 o! P| |  } Q| d } n XnR| d j oS|  | d | d !d j o T| | } U| d } nV|  | d | d !d	 j o W|  | d }  Xt |   } YyQ Z|  i d
  } [|  |  } \t i i |  o ]| t i | } n Wn0 ^t
 j
 o! _| |  } `| d } n Xn bd } c| d } d|  | | d !} exP e| d j o
 | | j o2 f| | } g| d } h|  | | d !} qhWit i i |  o j| t i | } n k| d j o l| | } n n n| | } o| d } qk Wp| 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   environs   has_key(   s   paths   strings   varcharss   ress   indexs   pathlens   cs   vars#   /mit/python/lib/python2.0/ntpath.pys
   expandvars<sd   		 	 c    s  wxy|  i d d  }  zt |   \ } }  {x3 {|  d  d j o || d } }|  d }  q6 W~|  i d  } d } x | t |  j  o | | d j o | | =n | | d j o% | d j o | | d d d f j o& | | d | d 5| d } nR | | d j o | d j o | | d d j o | | =n | d } q 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   prefixs   compss   is#   /mit/python/lib/python2.0/ntpath.pys   normpathws,    	 <6c    s   y d k  } Wn; t j
 o, d   } | a | |   Sn X|  o< y | i |   }  Wn | i j
 o
 n Xn t i   }  t	 |   Sd S(   s%   Return the absolute version of a pathNc    sA   t  |   o t t i   |   }  n t |   Sd  S(   N(   s   isabss   paths   joins   oss   getcwds   normpath(   s   paths#   /mit/python/lib/python2.0/ntpath.pys   _abspaths   (
   s   win32apis   ImportErrors   _abspaths   abspaths   paths   GetFullPathNames   errors   oss   getcwds   normpath(   s   paths   win32apis   _abspaths#   /mit/python/lib/python2.0/ntpath.pys   abspaths   	
(   s   __doc__s   oss   stats   normcases   isabss   joins
   splitdrives   splituncs   splits   splitexts   basenames   dirnames   commonprefixs   getsizes   getmtimes   getatimes   islinks   existss   isdirs   isfiles   ismounts   walks
   expandusers
   expandvarss   normpaths   abspath(    s#   /mit/python/lib/python2.0/ntpath.pys   ? s2   	!	";