
M9c       s   d  Z  d k Z d k 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 d   Z d   Z d   Z d   Z d   Z d   Z d   Z 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    ss   |  } xb | d rX } t |  o
 | } n< | 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    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   ps#   /mit/python/lib/python2.0/ntpath.pys
   splitdrive5 s     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 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   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   /\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   d d f \ } } x |  d r } | d d g j o | | | d f \ } } nX | d j o+ | 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 } xp |  d rf } x] t t |   d rG } | | d  | | d  j o$ | |  } | d j o d Sn Pn 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   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    s8   y t  i |   } Wn t  i j
 o d Sn Xd 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    sH   y t  i |   } Wn t  i j
 o d Sn Xt 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    sH   y t  i |   } Wn t  i j
 o d Sn Xt 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    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   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 } xQ | d rG } | | j o4 t	 |  |  } t
 |  o t | | |  n n qU 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    s	  |  d  d j o |  Sn d t |   f \ } } x- | | j  o |  | d j o | d } q4 W| d j o t i i d  o t i d } n` t i i d  o |  SnD 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   has_keys   userhomes   drives   KeyErrors   join(   s   paths   is   ns   userhomes   drives#   /mit/python/lib/python2.0/ntpath.pys
   expandusers&      c    s  d |  j o |  Sn d k } | i | i d } d } d } t |   } xG| | j  o9|  | } | d j oq |  | d }  t |   } y) |  i d  } | d |  | d  } Wn' t
 j
 o | |  } | d } n Xn| d j o|  | d | d !d j o | | } | d } nU|  | d | d !d	 j o |  | d }  t |   } yE |  i d
  } |  |  } t i i |  o | t i | } n Wn' t
 j
 o | |  } | d } n Xn d } | d } |  | | d !} xD | d j o
 | | j o) | | } | d } |  | | d !} qWt i i |  o | t i | } n | d j o | | } n 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   environs   has_key(   s   paths   strings   varcharss   ress   indexs   pathlens   cs   vars#   /mit/python/lib/python2.0/ntpath.pys
   expandvars<sd     	 





 


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 | | =n | | d j o% | d j o | | d d d f j o  | | d | d 5| d } nI | | d j o | d j o | | d d j o | | =n | 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   prefixs   compss   is#   /mit/python/lib/python2.0/ntpath.pys   normpathws,      
 93c    s   y d k  } Wn, t j
 o  d   } | a | |   Sn X|  o0 y | i |   }  Wn | i j
 o n Xn t i   }  t	 |   Sd S(   s%   Return the absolute version of a pathNc    s5   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   								!																"	;	