™N
¨´ 7c       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   ss"   /mit/gnome/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   ss"   /mit/gnome/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   bs"   /mit/gnome/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   ps"   /mit/gnome/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   cs"   /mit/gnome/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   cs"   /mit/gnome/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   ps"   /mit/gnome/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   ps"   /mit/gnome/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   is"   /mit/gnome/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   paths"   /mit/gnome/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   sts"   /mit/gnome/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   sts"   /mit/gnome/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   sts"   /mit/gnome/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   s2s"   /mit/gnome/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   s2s"   /mit/gnome/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   s2s"   /mit/gnome/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   ps"   /mit/gnome/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   names"   /mit/gnome/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   drives"   /mit/gnome/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   vars"   /mit/gnome/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   is"   /mit/gnome/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(    s"   /mit/gnome/lib/python1.5/ntpath.pys   ? s2   				!8