-
<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 d d g Z  d   Z # d   Z , d   Z > d   Z N d   Z d d    Z	 l d!   Z
 s d"   Z 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 +d0   Z Fe a Hd1   Z hd2   Z d3   Z d4   Z d S(5   s  Common operations on Posix pathnames.

Instead of importing this module directly, import os and refer to
this module as os.path.  The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Mac, Windows),
os.path provides the same operations in a manner specific to that
platform, and is an alias to another module (e.g. macpath, ntpath).

Some of this can actually be useful on non-Posix systems too, e.g.
for manipulation of the pathname component of URLs.
Ns   normcases   isabss   joins
   splitdrives   splits   splitexts   basenames   dirnames   commonprefixs   getsizes   getmtimes   getatimes   islinks   existss   isdirs   isfiles   ismounts   walks
   expandusers
   expandvarss   normpaths   abspaths   samefiles   sameopenfiles   samestatc    s      |  Sd S(   s6   Normalize case of pathname.  Has no effect under PosixN(   s   s(   s   s(    (    s   /usr/lib/python2.2/posixpath.pys   normcase s   c    s   # $ % |  d  d j Sd S(   s   Test whether a path is absolutei   s   /N(   s   s(   s   s(    (    s   /usr/lib/python2.2/posixpath.pys   isabs# s   c    s   , - . |  } / xu | D/ ]j } 0 | d  d j o 1 | } nD 2 | d j p | d d j o 3 | | } n 5 | d | } q W6 | Sd S(   s=   Join two or more pathname components, inserting '/' as neededi   s   /s    iN(   s   as   paths   ps   b(   s   as   ps   bs   path(    (    s   /usr/lib/python2.2/posixpath.pys   join, s   	
 	!c    s   > @ A |  i d  d } B |  |  |  | f \ } } C | o | d t |  j o0 D x& D | d d j o E | d  } q` Wn F | | f Sd S(   s   Split a pathname.  Returns tuple "(head, tail)" where "tail" is
    everything after the final slash.  Either part may be empty.s   /i   iN(   s   ps   rfinds   is   heads   tails   len(   s   ps   is   heads   tail(    (    s   /usr/lib/python2.2/posixpath.pys   split> s   ! c    s   N P Q d d f \ } } R x |  DR ] } S | d j o! T | | | d f \ } } nm U | d j o4 V | o W | | | f \ } } n
 Y | } n) Z | o [ | | } n ] | | } q% W^ | | 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 empty.s    s   /s   .N(   s   roots   exts   ps   c(   s   ps   exts   roots   c(    (    s   /usr/lib/python2.2/posixpath.pys   splitextN s   
 	!

c    s   d f g d |  f Sd S(   sJ   Split a pathname into drive and path. On Posix, drive is always
    empty.s    N(   s   p(   s   p(    (    s   /usr/lib/python2.2/posixpath.pys
   splitdrived s   c    s   l m n t  |   d Sd S(   s)   Returns the final component of a pathnamei   N(   s   splits   p(   s   p(    (    s   /usr/lib/python2.2/posixpath.pys   basenamel s   c    s   s t u t  |   d Sd S(   s-   Returns the directory component of a pathnamei    N(   s   splits   p(   s   p(    (    s   /usr/lib/python2.2/posixpath.pys   dirnames s   c    s   z { | |  o | d Sn } |  d } ~ x |  D~ ]y }  xm t t |   D ]V }  | | d  | | d  j o0  | |  }  | d j o  d Sn  Pn qR Wq3 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/posixpath.pys   commonprefixz s    
 	 	  c    s*      t  i |   }  | t i Sd S(   s1   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/posixpath.pys   getsize s   c    s*      t  i |   }  | t i Sd S(   sC   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/posixpath.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/posixpath.pys   getatime s   c    sc      y  t  i |   } Wn&  t  i t f j
 o  d Sn X t i | t i  Sd S(   s&   Test whether a path is a symbolic linki    N(	   s   oss   lstats   paths   sts   errors   AttributeErrors   stats   S_ISLNKs   ST_MODE(   s   paths   st(    (    s   /usr/lib/python2.2/posixpath.pys   islink s   c    sM      y  t  i |   } Wn   t  i j
 o  d Sn X d Sd S(   sD   Test whether a path exists.  Returns false for broken symbolic linksi    i   N(   s   oss   stats   paths   sts   error(   s   paths   st(    (    s   /usr/lib/python2.2/posixpath.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   st(    (    s   /usr/lib/python2.2/posixpath.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   st(    (    s   /usr/lib/python2.2/posixpath.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   s2s   s1(    (    s   /usr/lib/python2.2/posixpath.pys   samefile s   c    s>      t  i |   }  t  i |  }  t | |  Sd S(   s:   Test whether two open file objects reference the same fileN(   s   oss   fstats   fp1s   s1s   fp2s   s2s   samestat(   s   fp1s   fp2s   s2s   s1(    (    s   /usr/lib/python2.2/posixpath.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   s2(    (    s   /usr/lib/python2.2/posixpath.pys   samestat s   c    s      y1  t  i |   }  t  i t |  d   } Wn   t  i j
 o  d Sn X | t i }  | t i }  | | j o  d Sn  | t i
 }  | t i
 }  | | j o  d Sn  d Sd S(   s$   Test whether a path is a mount points   ..i    i   N(   s   oss   stats   paths   s1s   joins   s2s   errors   ST_DEVs   dev1s   dev2s   ST_INOs   ino1s   ino2(   s   paths   dev2s   dev1s   ino1s   ino2s   s2s   s1(    (    s   /usr/lib/python2.2/posixpath.pys   ismount s   c    s   y t  i |   } Wn  t  i j
 o d Sn X| | |  |  x | D] } t |  |  } y t  i	 |  } Wn t  i j
 o q_ n Xt i | t i  o t | | |  n q_ 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.N(   s   oss   listdirs   tops   namess   errors   funcs   args   names   joins   lstats   sts   stats   S_ISDIRs   ST_MODEs   walk(   s   tops   funcs   args   names   sts   names(    (    s   /usr/lib/python2.2/posixpath.pys   walks   
 	c    sP  +-.|  d  d j o /|  Sn 0d t |   f \ } } 1x3 1| | j  o |  | d j o 2| d } qF W3| d j o6 4t i i d  o 5|  Sn 6t i d } nZ 8d k } 9y :| i	 |  d | ! } Wn ;t j
 o <|  Sn X=| d } >| d d j o >| d } n ?| |  | Sd S(   sO   Expand ~ and ~user constructions.  If user or $HOME is unknown,
    do nothing.i   s   ~s   /s   HOMENi   i(   s   paths   lens   is   ns   oss   environs   has_keys   userhomes   pwds   getpwnams   pwents   KeyError(   s   paths   userhomes   pwds   is   pwents   n(    (    s   /usr/lib/python2.2/posixpath.pys
   expanduser+s(    ! c    si  HJKLd |  j o M|  Sn Nt o" Od k } P| i d  a n Qd } Rx Rd o St i |  |  } T| o UPn V| i d  \ } } W| i	 d  } X| d  d j o | d d j o Y| d d !} n Zt i i |  oE [|  | } \|  |  t i | }  ]t |   } ^|  | }  n
 `| } q` Wa|  Sd S(	   sZ   Expand shell variables of form $var and ${var}.  Unknown variables
    are left unchanged.s   $Ns   \$(\w+|\{[^}]*\})i    i   s   {is   }(   s   paths   _varprogs   res   compiles   is   searchs   ms   spans   js   groups   names   oss   environs   has_keys   tails   len(   s   paths   res   names   is   js   ms   tail(    (    s   /usr/lib/python2.2/posixpath.pys
   expandvarsHs0   	 
%c    sp  hij|  d j o kd Sn l|  i d  } o| o |  i d  o |  i d  o qd } n r|  i d  } sg  } tx | Dt] } u| d d f j o
 vq n w| d j p% | o | p | o | d d j o y| i |  n z| o {| i   n q W|| } }d i	 |  }  ~| o d | |  }  n |  p d Sd	 S(
   s0   Normalize path, eliminating double slashes, etc.s    s   .s   /s   //s   ///i   s   ..iN(
   s   paths
   startswiths   initial_slashess   splits   compss	   new_compss   comps   appends   pops   join(   s   paths	   new_compss   initial_slashess   comps   comps(    (    s   /usr/lib/python2.2/posixpath.pys   normpathhs*   +	
 	
8
	
c    sD   t  |   o t t i   |   }  n t |   Sd S(   s   Return an absolute path.N(   s   isabss   paths   joins   oss   getcwds   normpath(   s   path(    (    s   /usr/lib/python2.2/posixpath.pys   abspaths   c    s   t  |   }  d g |  i d  d } x t d t |  d  D] } t | d | !  } t	 |  oj t
 i |  } t |  \ } } t t | |   } t | g | |   } t |  Sn qO W|  Sd S(   sl   Return the canonical path of the specified filename, eliminating any
symbolic links encountered in the path.s   /i   i   i    N(   s   abspaths   filenames   splits   bitss   ranges   lens   is   joins	   components   islinks   oss   readlinks   resolveds   dirs   files   normpaths   newpaths   realpath(   s   filenames   resolveds   newpaths   is   bitss	   components   dirs   file(    (    s   /usr/lib/python2.2/posixpath.pys   realpaths    	(    s   __doc__s   oss   stats   __all__s   normcases   isabss   joins   splits   splitexts
   splitdrives   basenames   dirnames   commonprefixs   getsizes   getmtimes   getatimes   islinks   existss   isdirs   isfiles   samefiles   sameopenfiles   samestats   ismounts   walks
   expandusers   Nones   _varprogs
   expandvarss   normpaths   abspaths   realpath(   s   samefiles   realpaths   stats   commonprefixs   sameopenfiles   existss   splitexts   basenames   normcases   walks
   expandvarss
   expandusers   getmtimes   getatimes   dirnames   isfiles   isdirs   ismounts   joins   __all__s   isabss   normpaths   getsizes
   splitdrives   samestats   splits   oss   abspaths   islink(    (    s   /usr/lib/python2.2/posixpath.pys   ? s<   T		

	'	 
