‡Æ
âÞ?:c       s  d  Z  d k Z d k 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 „  Z d „  Z d „  Z d S(   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.
Nc    s   |  Sd S(   s6   Normalize case of pathname.  Has no effect under PosixN(   s   s(   s   ss8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.pys   normcase s     c    s   |  d  d j Sd S(   s   Test whether a path is absolutei   s   /N(   s   s(   s   ss8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.pys   isabs s     c    sw   |  } xf | d r\ } | d  d j o
 | } n< | d j p | d d j o | | } n | d | } q W| Sd S(   s=   Join two or more pathname components, inserting '/' as neededi    i   s   /s    N(   s   as   paths   ps   b(   s   as   ps   paths   bs8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.pys   join' s     	 
c    s‚   |  i d ƒ d } |  |  |  | f \ } } | o | d t | ƒ j o) x" | d d j o | d  } qN Wn | | 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   N(   s   ps   rfinds   is   heads   tails   len(   s   ps   is   heads   tails8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.pys   split9 s      c    sµ   d d f \ } } x’ |  d rˆ } | d 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.  Returns "(root, ext)", either part may be empty.s    i    s   /s   .N(   s   roots   exts   ps   c(   s   ps   roots   exts   cs8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.pys   splitextI s     	 
c    s   d |  f Sd S(   sK   Split a pathname into drive and path. On Posix, drive is always 
    empty.s    N(   s   p(   s   ps8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.pys
   splitdrive_ s     c    s   t  |  ƒ d Sd S(   s)   Returns the final component of a pathnamei   N(   s   splits   p(   s   ps8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.pys   basenameg s     c    s   t  |  ƒ d Sd S(   s-   Returns the directory component of a pathnamei    N(   s   splits   p(   s   ps8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.pys   dirnamen s     c    s•   |  o d Sn |  d } xp |  d rf } x] t t | ƒ ƒ d rG } | | 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   prefixs   items   is8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.pys   commonprefixu 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   sts8   /home/guest/edwardam/cmp2/py2/lib/python2.0/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   sts8   /home/guest/edwardam/cmp2/py2/lib/python2.0/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   sts8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.pys   getatimeŽ s     c    sN   y t  i |  ƒ } Wn  t  i t f j
 o d Sn Xt 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   sts8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.pys   islink— s     	c    s8   y t  i |  ƒ } Wn t  i j
 o d Sn Xd Sd S(   sD   Test whether a path exists.  Returns false for broken symbolic linksi    i   N(   s   oss   stats   paths   sts   error(   s   paths   sts8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.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   sts8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.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   sts8   /home/guest/edwardam/cmp2/py2/lib/python2.0/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   s1s   s2s8   /home/guest/edwardam/cmp2/py2/lib/python2.0/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   s1s   s2s8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.pys   sameopenfileÒ s     c    s7   |  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   s2s8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.pys   samestatÜ s     c    s®   y+ 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   s1s   s2s   dev1s   dev2s   ino1s   ino2s8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.pys   ismountå s     	c    s    y t  i |  ƒ } Wn t  i j
 o d Sn X| | |  | ƒ xY | d rO } t |  | ƒ } t  i	 | ƒ } t i | t i ƒ o t | | | ƒ n qI Wd S(   sÊ   walk(top,func,arg) 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".
    Ni    (   s   oss   listdirs   tops   namess   errors   funcs   args   names   joins   lstats   sts   stats   S_ISDIRs   ST_MODEs   walk(   s   tops   funcs   args   namess   names   sts8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.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 |  Sn t i d } nH d k } y | i	 |  d | !ƒ } Wn t j
 o |  Sn X| d } | d d j o | d } n | |  | Sd S(   sP   Expand ~ and ~user constructions.  If user or $HOME is unknown, 
    do nothing.i   s   ~s   /s   HOMENi   (   s   paths   lens   is   ns   oss   environs   has_keys   userhomes   pwds   getpwnams   pwents   KeyError(   s   paths   is   ns   userhomes   pwds   pwents8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.pys
   expandusers(      		
 c    s   d |  j o |  Sn t o d k } | i d ƒ a n d } xÖ d oÎ t i |  | ƒ } | o Pn | i d ƒ \ } } | i	 d ƒ } | d  d j o | d d j o | d d !} n t i i | ƒ o9 |  | } |  |  t i | }  t |  ƒ } |  | }  n | } qB W|  Sd S(   sZ   Expand shell variables of form $var and ${var}.  Unknown variables
    are left unchanged.s   $Ns   \$(\w+|\{[^}]*\})i    i   s   {s   }(   s   paths   _varprogs   res   compiles   is   searchs   ms   spans   js   groups   names   oss   environs   has_keys   tails   len(   s   paths   res   is   ms   js   names   tails8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.pys
   expandvars6s0      	 #
c    sü   |  d j o d Sn |  d d j } |  i d ƒ } g  } x† | d r| } | d d f j o qC n | d j p& | o | p | o | d d j o | i | ƒ n | o | i ƒ  n qC W| } d i | ƒ }  | o d |  }  n |  p d Sd S(   s0   Normalize path, eliminating double slashes, etc.s    s   .i    s   /s   ..i   N(	   s   paths   initial_slashs   splits   compss	   new_compss   comps   appends   pops   join(   s   paths   initial_slashs   compss	   new_compss   comps8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.pys   normpathVs&     	 6c    s5   t  |  ƒ o t t i ƒ  |  ƒ }  n t |  ƒ Sd S(   s   Return an absolute path.N(   s   isabss   paths   joins   oss   getcwds   normpath(   s   paths8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.pys   abspathls     (   s   __doc__s   oss   stats   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   abspath(    s8   /home/guest/edwardam/cmp2/py2/lib/python2.0/posixpath.pys   ? s8   																					
	
						 	