-í
ç¶<c       s<  d  Z  d k Z d k Z d d d d d d d d	 d
 d d d d d d d d d d d d d d g 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 e Z d S(0   s   Common pathname manipulations, WindowsNT/95 version.

Instead of importing this module directly, import os and refer to this
module as os.path.
Ns   normcases   isabss   joins
   splitdrives   splits   splitexts   basenames   dirnames   commonprefixs   getsizes   getmtimes   getatimes   islinks   existss   isdirs   isfiles   ismounts   walks
   expandusers
   expandvarss   normpaths   abspaths   splituncc    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   s(    (    s   /usr/lib/python2.2/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   s(    (    s   /usr/lib/python2.2/ntpath.pys   isabs! s     c    s{  |  } xj| D]b} d } | d j o
 d } n… t | ƒ ow | d d !d j p | d d !d j o
 d } nB t | ƒ d j p! t | ƒ d j o | d d j o
 d } n n | o
 | } n« | d d j o8 | o | d d j o | | d 7} n | | 7} nb | d d j o | | 7} nC | o1 | d d j o | | 7} n | d	 | 7} n | d	 7} q W| Sd
 S(   s=   Join two or more pathname components, inserting "\" as neededi    s    i   i   s   :i   iÿÿÿÿs   /\s   \N(   s   as   paths   ps   bs   b_winss   isabss   len(   s   as   ps   bs   paths   b_wins(    (    s   /usr/lib/python2.2/ntpath.pys   join) s6      
	(
7
 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   p(    (    s   /usr/lib/python2.2/ntpath.pys
   splitdriveb 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   \iÿÿÿÿN(   s   ps   firstTwos   normcases   normps   finds   indexs   len(   s   ps   indexs   normps   firstTwo(    (    s   /usr/lib/python2.2/ntpath.pys   splitunck 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   /\iÿÿÿÿN(   s
   splitdrives   ps   ds   lens   is   heads   tails   head2(   s   ps   tails   ds   is   heads   head2(    (    s   /usr/lib/python2.2/ntpath.pys   splitŒ s       c    s¹   d d f \ } } x– |  D]Ž } | 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    s   /s   \s   .N(   s   roots   exts   ps   c(   s   ps   exts   roots   c(    (    s   /usr/lib/python2.2/ntpath.pys   splitext¥ s      
c    s   t  |  ƒ d Sd S(   s)   Returns the final component of a pathnamei   N(   s   splits   p(   s   p(    (    s   /usr/lib/python2.2/ntpath.pys   basename¼ s     c    s   t  |  ƒ d Sd S(   s-   Returns the directory component of a pathnamei    N(   s   splits   p(   s   p(    (    s   /usr/lib/python2.2/ntpath.pys   dirnameÃ s     c    s‘   |  o d Sn |  d } xl |  D]d } x[ t t | ƒ ƒ D]G } | | 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   items   prefixs   i(    (    s   /usr/lib/python2.2/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   st(    (    s   /usr/lib/python2.2/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   st(    (    s   /usr/lib/python2.2/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   st(    (    s   /usr/lib/python2.2/ntpath.pys   getatimeã s     c    s   d Sd S(   s=   Test for symbolic link.  On WindowsNT/95 always returns falsei    N(    (   s   path(    (    s   /usr/lib/python2.2/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   st(    (    s   /usr/lib/python2.2/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   st(    (    s   /usr/lib/python2.2/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   st(    (    s   /usr/lib/python2.2/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   ps   uncs   rest(    (    s   /usr/lib/python2.2/ntpath.pys   ismounts     c    s¢   y t  i |  ƒ } Wn t  i j
 o d Sn X| | |  | ƒ d d f } xO | D]G } | | j o4 t	 |  | ƒ } t
 | ƒ o t | | | ƒ n n qS Wd S(   sI  Directory tree walk with callback function.

    For each directory in the directory tree rooted at top (including top
    itself, but excluding '.' and '..'), call func(arg, dirname, fnames).
    dirname is the name of the directory, and fnames a list of the names of
    the files and subdirectories in dirname (excluding '.' and '..').  func
    may modify the fnames list in-place (e.g. via del or slice assignment),
    and walk will only recurse into the subdirectories whose names remain in
    fnames; this can be used to implement a filter, or to impose a specific
    order of visiting.  No semantics are defined for, or required of, arg,
    beyond that arg is always passed to func.  It can be used, e.g., to pass
    a filename pattern, or a mutable object designed to accumulate
    statistics.  Passing None for arg is common.Ns   .s   ..(   s   oss   listdirs   tops   namess   errors   funcs   args
   exceptionss   names   joins   isdirs   walk(   s   tops   funcs   args   namess
   exceptionss   name(    (    s   /usr/lib/python2.2/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   userhomes   is   drives   n(    (    s   /usr/lib/python2.2/ntpath.pys
   expanduserP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   ascii_letterss   digitss   varcharss   ress   indexs   lens   pathlens   cs
   ValueErrors   vars   oss   environs   has_key(   s   paths   indexs   cs   strings   ress   varcharss   pathlens   var(    (    s   /usr/lib/python2.2/ntpath.pys
   expandvarsrsd     	 





 


c    sl  |  i d d ƒ }  t |  ƒ \ } }  x* |  d  d j o | d } |  d }  q' W|  i d ƒ } d } xÍ | t | ƒ j  o¹ | | d d f j o | | =n” | | d j ox | d j o | | d d j o  | | d | d 5| d 8} n3 | d j o | i d ƒ o | | =n | d 7} n | d 7} 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   endswiths   appends   join(   s   paths   compss   prefixs   i(    (    s   /usr/lib/python2.2/ntpath.pys   normpath­s0      
 "c    sX   |  o7 d k l } y | |  ƒ }  Wn t j
 o n Xn t i ƒ  }  t |  ƒ Sd S(   s%   Return the absolute version of a path(   s   _getfullpathnameN(   s   paths   nts   _getfullpathnames   WindowsErrors   oss   getcwds   normpath(   s   paths   _getfullpathname(    (    s   /usr/lib/python2.2/ntpath.pys   abspathÊs     	(   s   __doc__s   oss   stats   __all__s   normcases   isabss   joins
   splitdrives   splituncs   splits   splitexts   basenames   dirnames   commonprefixs   getsizes   getmtimes   getatimes   islinks   existss   isdirs   isfiles   ismounts   walks
   expandusers
   expandvarss   normpaths   abspaths   realpath(   s   realpaths   stats   commonprefixs   existss   splitexts   basenames   normcases   walks
   expandvarss
   expandusers   getmtimes   getatimes   dirnames   isfiles   isdirs   getsizes   joins   __all__s   splituncs   isabss   normpaths   ismounts
   splitdrives   splits   oss   abspaths   islink(    (    s   /usr/lib/python2.2/ntpath.pys   ? s6   		K				9			!															%	"	;		