N
O5c       s>    d  Z    k Z  k Z 	 k Z  d   Z  d   Z ' d   Z 7 d   Z E d   Z b d   Z	 w 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 e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(   sg   Normalize case of pathname.

    Makes all characters lowercase and all slashes into backslashes.

    s   /s   \N(   s   strings   lowers   replaces   s(   s   ss0   /var/tmp/python-root/usr/lib/python1.5/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   ss0   /var/tmp/python-root/usr/lib/python1.5/ntpath.pys   isabs s   c    s   ' ( ) |  } * xw | d * rj } + t |  o , | } nH - | d j p | d d j o . | | } n 0 | t i | } q W1 | 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   bs0   /var/tmp/python-root/usr/lib/python1.5/ntpath.pys   join' s   	 	"c    sJ   7 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   ps0   /var/tmp/python-root/usr/lib/python1.5/ntpath.pys
   splitdrive7 s   c    sz  E G H t  |   \ } }  I d } J xA J |  o |  d d j o$ K | |  d } L |  d  }  q* WM |  d j o N |  | }  n O d d f \ } } P xM |  d P r@ } Q | | } R | d j o S | | d f \ } } n q WT d } U xA U | o | d d j o$ V | | d } W | d  } qWX | d j o Y | | } n Z | | | f Sd S(   s|   Split a pathname.  Returns tuple "(head, tail)" where "tail" is 
everything after the final slash.  Either part may be emptys    i   s   /\i    N(   s
   splitdrives   ps   ds   slashess   heads   tails   c(   s   ps   ds   slashess   heads   tails   cs0   /var/tmp/python-root/usr/lib/python1.5/ntpath.pys   splitE s.   	  	!	 c    s   b d e d d f \ } } f x |  d f r } g | d d g j o! h | | | d f \ } } nm i | d j o4 j | o k | | | f \ } } n
 m | } n) n | o o | | } n q | | } q' Wr | | f Sd S(   s   Split the extension from a pathname.  Extension is everything from the
last dot to the end.  Returns "(root, ext)", either part may be emptys    i    s   /s   \s   .N(   s   roots   exts   ps   c(   s   ps   roots   exts   cs0   /var/tmp/python-root/usr/lib/python1.5/ntpath.pys   splitextb s    	!

c    s   w x y t  |   d Sd S(   s)   Returns the final component of a pathnamei   N(   s   splits   p(   s   ps0   /var/tmp/python-root/usr/lib/python1.5/ntpath.pys   basenamew s   c    s   ~   t  |   d Sd S(   s-   Returns the directory component of a pathnamei    N(   s   splits   p(   s   ps0   /var/tmp/python-root/usr/lib/python1.5/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   is0   /var/tmp/python-root/usr/lib/python1.5/ntpath.pys   commonprefix s     	 	  c    s      d Sd S(   s=   Test for symbolic link.  On WindowsNT/95 always returns falsei    N(    (   s   paths0   /var/tmp/python-root/usr/lib/python1.5/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   sts0   /var/tmp/python-root/usr/lib/python1.5/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   sts0   /var/tmp/python-root/usr/lib/python1.5/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   sts0   /var/tmp/python-root/usr/lib/python1.5/ntpath.pys   isfile s   c    s>      t  i |   }  t  i |  }  t | |  Sd S(   s9   Test whether two pathnames reference the same actual fileN(   s   oss   stats   f1s   s1s   f2s   s2s   samestat(   s   f1s   f2s   s1s   s2s0   /var/tmp/python-root/usr/lib/python1.5/ntpath.pys   samefile s   c    sJ      t  i |  i    }  t  i | i    }  t | |  Sd S(   sS   Test whether two open file objects reference the same file (may not
work correctly)N(   s   oss   fstats   fp1s   filenos   s1s   fp2s   s2s   samestat(   s   fp1s   fp2s   s1s   s2s0   /var/tmp/python-root/usr/lib/python1.5/ntpath.pys   sameopenfile s   c    s@      |  t i | t i j o |  t i | t i j Sd S(   s5   Test whether two stat buffers reference the same fileN(   s   s1s   stats   ST_INOs   s2s   ST_DEV(   s   s1s   s2s0   /var/tmp/python-root/usr/lib/python1.5/ntpath.pys   samestat s   c    sA      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)i   i    s   /\N(   s
   splitdrives   paths   ps   len(   s   paths   ps0   /var/tmp/python-root/usr/lib/python1.5/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   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   names0   /var/tmp/python-root/usr/lib/python1.5/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| |  | Sd S(	   sK   Expand ~ and ~user constructions.  If user or $HOME is unknown, 
do nothingi   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   drives0   /var/tmp/python-root/usr/lib/python1.5/ntpath.pys
   expanduser
s&    !s   _-c    s  -/0d |  j o 1|  Sn 2d } 3d } 4t |   } 5x5| | j  o6|  | } 7| d j o 8|  | d }  9t |   } :y2 ;t i |  d  } <| d |  | d  } Wn3 =t i j
 o! >| |  } ?| d } n Xn@| d j oA|  | d | d !d j o B| | } C| d } nD|  | d | d !d j o E|  | d }  Ft |   } GyT Ht i |  d  } I|  |  } Jt	 i
 i |  o K| t	 i
 | } n Wn3 Lt i j
 o! M| |  } N| d } n Xn Pd } Q| d } R|  | | d !} SxP S| d j o
 | t j o2 T| | } U| d } V|  | | d !} qQWWt	 i
 i |  o X| t	 i
 | } n Y| d j o Z| | } n n \| | } ]| d } qH W^| Sd	 S(
   sU   Expand shell variables of form $var and ${var}.  Unknown variables
are left unchangeds   $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   vars0   /var/tmp/python-root/usr/lib/python1.5/ntpath.pys
   expandvars-s`   		 	 c    s  efgt  i |  d d  }  ht |   \ } }  ix9 i|  d  t i j o! j| t i } k|  d }  q9 Wlt  i |  t i  } md } nx n| t
 |  j  o o| | d j o p| | =n q| | d j o% | d j o | | d d d f j o& r| | d | d 5s| d } nR t| | d j o | d j o | | d d j o u| | =n w| d } q Wy| o | o z| 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   is0   /var/tmp/python-root/usr/lib/python1.5/ntpath.pys   normpathes,    	 <6N(   s   __doc__s   oss   stats   strings   normcases   isabss   joins
   splitdrives   splits   splitexts   basenames   dirnames   commonprefixs   islinks   existss   isdirs   isfiles   samefiles   sameopenfiles   samestats   ismounts   walks
   expandusers   letterss   digitss   varcharss
   expandvarss   normpath(    s0   /var/tmp/python-root/usr/lib/python1.5/ntpath.pys   ? s2   				!8