N
u9c       sV    d  Z    k Z 	 k Z 
 k Z  d   Z  d   Z & d   Z 6 d   Z ? d   Z ` d   Z	 y 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 =e i e i d Z ?d   Z x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.
c    s)      t  i t  i |  d d   Sd S(   sa   Normalize case of pathname.

    Makes all characters lowercase and all slashes into backslashes.s   /s   \N(   s   strings   lowers   replaces   s(   s   ss*   /usr/lib/python1.5/site-packages/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*   /usr/lib/python1.5/site-packages/ntpath.pys   isabs s   c    s   & ' ( |  } ) xw | d ) rj } * t |  o + | } nH , | d j p | d d j o - | | } n / | t i | } q W0 | Sd S(   s=   Join two or more pathname components, inserting "\" as neededi    s    i   s   /\N(   s   as   paths   ps   bs   isabss   oss   sep(   s   as   ps   paths   bs*   /usr/lib/python1.5/site-packages/ntpath.pys   join& s   	 	"c    sJ   6 8 9 |  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*   /usr/lib/python1.5/site-packages/ntpath.pys
   splitdrive6 s   c    s  ? F G |  d d !d j o H d |  f Sn I |  d d !} J | d j p
 | d j o O t |   } P t i | d d  } Q | d j o S d |  f Sn T t i | d | d  } U | d j o V t |   } n W |  |  |  | f Sn X 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   strings   finds   indexs   len(   s   ps   firstTwos   normps   indexs*   /usr/lib/python1.5/site-packages/ntpath.pys   splitunc? s   c    s   ` d f t  |   \ } }  h t |   } i x1 i | o |  | d d j o j | d } q0 Wk |  |  |  | f \ } } m | } n x/ n | o | d d j o o | d  } q Wp | p | } q | | | 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*   /usr/lib/python1.5/site-packages/ntpath.pys   split` s    	 c    s   y } ~ 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*   /usr/lib/python1.5/site-packages/ntpath.pys   splitexty s    	!

c    s      t  |   d Sd S(   s)   Returns the final component of a pathnamei   N(   s   splits   p(   s   ps*   /usr/lib/python1.5/site-packages/ntpath.pys   basename s   c    s      t  |   d Sd S(   s-   Returns the directory component of a pathnamei    N(   s   splits   p(   s   ps*   /usr/lib/python1.5/site-packages/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*   /usr/lib/python1.5/site-packages/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*   /usr/lib/python1.5/site-packages/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*   /usr/lib/python1.5/site-packages/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_MTIME(   s   filenames   sts*   /usr/lib/python1.5/site-packages/ntpath.pys   getatime s   c    s      d Sd S(   s=   Test for symbolic link.  On WindowsNT/95 always returns falsei    N(    (   s   paths*   /usr/lib/python1.5/site-packages/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*   /usr/lib/python1.5/site-packages/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*   /usr/lib/python1.5/site-packages/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*   /usr/lib/python1.5/site-packages/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*   /usr/lib/python1.5/site-packages/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, args) 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*   /usr/lib/python1.5/site-packages/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 0|  S1| |  | 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*   /usr/lib/python1.5/site-packages/ntpath.pys
   expandusers&    !s   _-c    s  ?BCd |  j o D|  Sn Ed } Fd } Gt |   } HxH| | j  oI|  | } J| d j o K|  | d }  Lt |   } My2 Nt i |  d  } O| d |  | d  } Wn3 Pt i j
 o! Q| |  } R| d } n XnS| d j oT|  | d | d !d j o U| | } V| d } nW|  | d | d !d j o X|  | d }  Yt |   } ZyT [t i |  d  } \|  |  } ]t	 i
 i |  o ^| t	 i
 | } n Wn3 _t i j
 o! `| |  } a| d } n Xn cd } d| d } e|  | | d !} fxP f| d j o
 | t j o2 g| | } h| d } i|  | | d !} qQWjt	 i
 i |  o k| t	 i
 | } n l| d j o m| | } n n o| | } p| d } qH Wq| Sd	 S(
   sZ   Expand shell variables of form $var and ${var}.

    Unknown variables are left unchanged.s   $s    i    s   'i   i   s   {s   }N(   s   paths   ress   indexs   lens   pathlens   cs   strings   index_errors   vars   oss   environs   has_keys   varchars(   s   paths   ress   indexs   pathlens   cs   vars*   /usr/lib/python1.5/site-packages/ntpath.pys
   expandvars?s`   		 	 c    s  xyzt  i |  d d  }  {t |   \ } }  |x9 ||  d  t i j o! }| t i } ~|  d }  q9 Wt  i |  t i  } 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 | t  i | t i  Sd S(	   s0   Normalize path, eliminating double slashes, etc.s   /s   \i   i    s   .s   ..s    N(   s   strings   replaces   paths
   splitdrives   prefixs   oss   seps   splitfieldss   compss   is   lens   appends
   joinfields(   s   paths   prefixs   compss   is*   /usr/lib/python1.5/site-packages/ntpath.pys   normpathxs,    	 <6c    s   yG k  } y | i |   SWn  | i j
 o |  Sn XWnP t j
 oA t |   o t t i   |   }  n t	 |   Sn Xd S(   s%   Return the absolute version of a pathN(
   s   win32apis   GetFullPathNames   paths   errors   ImportErrors   isabss   joins   oss   getcwds   normpath(   s   paths   win32apis*   /usr/lib/python1.5/site-packages/ntpath.pys   abspaths   	N(   s   __doc__s   oss   stats   strings   normcases   isabss   joins
   splitdrives   splituncs   splits   splitexts   basenames   dirnames   commonprefixs   getsizes   getmtimes   getatimes   islinks   existss   isdirs   isfiles   ismounts   walks
   expandusers   letterss   digitss   varcharss
   expandvarss   normpaths   abspath(    s*   /usr/lib/python1.5/site-packages/ntpath.pys   ? s6   				!	"9