;
Êâ"Ic            (   @   sL  d  Z  d d l Z d d l Z d d l Z d d l Z d d l Td 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 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- e j k o
 d. Z n d/ e j k o
 d+ Z n d0 Z d1 „  Z d2 „  Z d3 „  Z d4 „  Z d5 „  Z d6 „  Z d7 „  Z d8 „  Z d9 „  Z d: „  Z d; „  Z d< „  Z e j j  e _  d= „  Z d> „  Z d? „  Z e Z  d@ „  Z! dA „  Z" dB „  Z# dC „  Z$ y d dD l% m& Z& Wn e' k
 o dE „  Z( Yn XdF „  Z( e( Z) e* e dG ƒ o e j+ ƒ  dH dI k Z, e dJ „ Z- d S(K   u   Common pathname manipulations, WindowsNT/95 version.

Instead of importing this module directly, import os and refer to this
module as os.path.
i    N(   u   *u   normcaseu   isabsu   joinu
   splitdriveu   splitu   splitextu   basenameu   dirnameu   commonprefixu   getsizeu   getmtimeu   getatimeu   getctimeu   islinku   existsu   lexistsu   isdiru   isfileu   ismountu
   expanduseru
   expandvarsu   normpathu   abspathu   splituncu   curdiru   pardiru   sepu   pathsepu   defpathu   altsepu   extsepu   devnullu   realpathu   supports_unicode_filenamesu   relpathu   .u   ..u   \u   ;u   /u   .;C:\binu   ceu   \Windowsu   os2u   nulc             C   s   t  |  t ƒ o d Sd Sd  S(   Ns   \u   \(   u
   isinstanceu   bytes(   u   path(    (    u#   /mit/python/lib/python3.0/ntpath.pyu   _get_sep%   s    c             C   s   t  |  t ƒ o d Sd Sd  S(   Ns   /u   /(   u
   isinstanceu   bytes(   u   path(    (    u#   /mit/python/lib/python3.0/ntpath.pyu   _get_altsep+   s    c             C   s   t  |  t ƒ o d Sd Sd  S(   Ns   \/u   \/(   u
   isinstanceu   bytes(   u   path(    (    u#   /mit/python/lib/python3.0/ntpath.pyu   _get_bothseps1   s    c             C   s   t  |  t ƒ o d Sd Sd  S(   Ns   .u   .(   u
   isinstanceu   bytes(   u   path(    (    u#   /mit/python/lib/python3.0/ntpath.pyu   _get_dot7   s    c             C   s   t  |  t ƒ o d Sd Sd  S(   Ns   :u   :(   u
   isinstanceu   bytes(   u   path(    (    u#   /mit/python/lib/python3.0/ntpath.pyu
   _get_colon=   s    c             C   s"   |  j  t |  ƒ t |  ƒ ƒ j ƒ  S(   ua   Normalize case of pathname.

    Makes all characters lowercase and all slashes into backslashes.(   u   replaceu   _get_altsepu   _get_sepu   lower(   u   s(    (    u#   /mit/python/lib/python3.0/ntpath.pyu   normcaseG   s    c             C   s=   t  |  ƒ d }  t |  ƒ d k o |  d d … t |  ƒ k S(   u   Test whether a path is absolutei   i    N(   u
   splitdriveu   lenu   _get_bothseps(   u   s(    (    u#   /mit/python/lib/python3.0/ntpath.pyu   isabsT   s    c             G   sÙ  t  |  ƒ } t |  ƒ } t |  ƒ } |  } x¨| D] } d } | p
 d } n‘ t | ƒ oƒ | d d … | k p | d d … | k o
 d } qÞ t | ƒ d k p* t | ƒ d k o! | d d … | k o
 d } qÞ n | o
 | } q1 t | ƒ d k p t ‚ | d d … | k oD | o/ | d d … | k o | | d d … 7} qÑ| | 7} q1 | d d … | k o | | 7} q1 | o7 | d d … | k o | | 7} qÑ| | | 7} q1 | | 7} q1 W| S(   uœ   Join two or more pathname components, inserting "\" as needed.
    If any component is an absolute path, all previous path components
    will be discarded.i    i   i   i   iÿÿÿÿN(   u   _get_sepu   _get_bothsepsu
   _get_colonu   isabsu   lenu   AssertionError(   u   au   pu   sepu   sepsu   colonu   pathu   bu   b_wins(    (    u#   /mit/python/lib/python3.0/ntpath.pyu   join\   s<     
	.
&
c             C   sP   |  d d … t  |  ƒ k o |  d d … |  d d … f S|  d d … |  f S(   ul   Split a pathname into drive and path specifiers. Returns a 2-tuple
"(drive,path)";  either part may be emptyi   i   i    N(   u
   _get_colon(   u   p(    (    u#   /mit/python/lib/python3.0/ntpath.pyu
   splitdriveš   s    c             C   sÿ   t  |  ƒ } |  d d … p |  d d … |  f S|  d d … } t | ƒ | | k o’ t |  ƒ } | j | d ƒ } | d k o |  d d … |  f S| j | | d ƒ } | d k o t |  ƒ } n |  d | … |  | d … f S|  d d … |  f S(   u@  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   Ni    iÿÿÿÿ(   u   _get_sepu   normcaseu   findu   len(   u   pu   sepu   firstTwou   normpu   index(    (    u#   /mit/python/lib/python3.0/ntpath.pyu   splitunc£   s    c             C   sÐ   t  |  ƒ } t |  ƒ \ } }  t |  ƒ } x+ | o# |  | d | k o | d } q- W|  d | … |  | d … } } | } x3 | o+ | d d … | k o | d d … } q‚ W| p | } | | | f S(   u~   Split a pathname.

    Return tuple (head, tail) where tail is everything after the final slash.
    Either part may be empty.i   Niÿÿÿÿ(   u   _get_bothsepsu
   splitdriveu   len(   u   pu   sepsu   du   iu   headu   tailu   head2(    (    u#   /mit/python/lib/python3.0/ntpath.pyu   splitÅ   s     ! c             C   s(   t  j |  t |  ƒ t |  ƒ t |  ƒ ƒ S(   N(   u   genericpathu	   _splitextu   _get_sepu   _get_altsepu   _get_dot(   u   p(    (    u#   /mit/python/lib/python3.0/ntpath.pyu   splitextß   s    c             C   s   t  |  ƒ d S(   u)   Returns the final component of a pathnamei   (   u   split(   u   p(    (    u#   /mit/python/lib/python3.0/ntpath.pyu   basenameç   s    c             C   s   t  |  ƒ d S(   u-   Returns the directory component of a pathnamei    (   u   split(   u   p(    (    u#   /mit/python/lib/python3.0/ntpath.pyu   dirnameî   s    c             C   s   d S(   uN   Test for symbolic link.
    On WindowsNT/95 and OS/2 always returns false
    F(   u   False(   u   path(    (    u#   /mit/python/lib/python3.0/ntpath.pyu   islinkõ   s    c             C   so   t  |  ƒ \ } } t | ƒ } | o | | d d … | k St |  ƒ d } t | ƒ d k o | d | k S(   u?   Test whether a path is a mount point (defined as root of drive)Ni    i   (   u   splituncu   _get_bothsepsu
   splitdriveu   len(   u   pathu   uncu   restu   pu   seps(    (    u#   /mit/python/lib/python3.0/ntpath.pyu   ismount  s    c             C   s„  t  |  t ƒ o
 d } n d } |  j | ƒ p |  Sd t |  ƒ } } x3 | | k  o% |  | t |  ƒ k o | d } qK Wd t j k o t j d } n{ d t j k o t j d } nZ d t j k o |  Sy t j d } Wn t k
 o d } Yn Xt | t j d ƒ } t  |  t ƒ o | j	 t
 j ƒ  ƒ } n | d k o# t t | ƒ |  d | … ƒ } n | |  | d	 … S(
   uL   Expand ~ and ~user constructs.

    If user or $HOME is unknown, do nothing.s   ~u   ~i   u   HOMEu   USERPROFILEu   HOMEPATHu	   HOMEDRIVEu    N(   u
   isinstanceu   bytesu
   startswithu   lenu   _get_bothsepsu   osu   environu   KeyErroru   joinu   encodeu   sysu   getfilesystemencodingu   dirname(   u   pathu   tildeu   iu   nu   userhomeu   drive(    (    u#   /mit/python/lib/python3.0/ntpath.pyu
   expanduser  s2    
 $#c             C   s›  t  |  t ƒ op t d ƒ |  k o t d ƒ |  k o |  Sd d l } t | j | j d d ƒ } d } d } d	 } d
 } nX d |  k o d |  k o |  Sd d l } | j | j d } d } d } d } d } |  d d … } d } t |  ƒ }	 x›| |	 k  o|  | | d … }
 |
 | k o~ |  | d d … }  t |  ƒ }	 y/ |  j |
 ƒ } | |
 |  d | d … } Wqˆt k
 o | |  } |	 d } YqˆXná|
 | k o,|  | d | d … | k o | |
 } | d } qˆ|  | d d … }  t |  ƒ }	 y |  j | ƒ } Wn, t k
 o  | | |  } |	 d } YqˆX|  d | … } t  |  t ƒ o | j	 d ƒ } n | t
 j k o t
 j | } n d | d } t  |  t ƒ o | j d ƒ } n | | } n¨|
 | k o|  | d | d … | k o | |
 } | d } qˆ|  | d | d … | k o:|  | d d … }  t |  ƒ }	 yÅ t  |  t ƒ o |  j d ƒ } n |  j d ƒ } |  d | … } t  |  t ƒ o | j	 d ƒ } n | t
 j k o t
 j | } n d | d } t  |  t ƒ o | j d ƒ } n | | } Wqzt k
 oB t  |  t ƒ o | d |  } n | d |  } |	 d } YqzXqˆd } | d } |  | | d … }
 xh |
 o` |
 | k oS t  |  t ƒ o | |
 j	 d ƒ } n | |
 } | d } |  | | d … }
 q¥W| t
 j k o t
 j | } n d | } t  |  t ƒ o | j d ƒ } n | | } |
 o | d } qˆn | |
 } | d } qü W| S(   uf   Expand shell variables of the forms $var, ${var} and %var%.

    Unknown variables are left unchanged.u   $u   %i    Nu   _-u   asciis   's   %s   {s   $u   'u   {i   i   s   }u   }u   ${s   ${u    (   u
   isinstanceu   bytesu   ordu   stringu   ascii_lettersu   digitsu   lenu   indexu
   ValueErroru   decodeu   osu   environu   encode(   u   pathu   stringu   varcharsu   quoteu   percentu   braceu   dollaru   resu   indexu   pathlenu   cu   varu   value(    (    u#   /mit/python/lib/python3.0/ntpath.pyu
   expandvarsE  sÄ    &
  



 




c             C   sé  t  |  ƒ } t |  ƒ d } |  j t |  ƒ | ƒ }  t |  ƒ \ } }  | p= xg |  d d … | k o | | } |  d d … }  qP Wn. |  j | ƒ o | | } |  j | ƒ }  n |  j | ƒ } d } xâ | t | ƒ k  oÎ | | p | | t |  ƒ k o | | =qÏ | | | k o | d k o8 | | d | k o# | | d | d … =| d 8} q¬| d k o! | j	 t  |  ƒ ƒ o | | =q¬| d 7} qÏ | d 7} qÏ W| o | o | j
 t |  ƒ ƒ n | | j | ƒ S(   u0   Normalize path, eliminating double slashes, etc.i   Ni   i    (   u   _get_sepu   _get_dotu   replaceu   _get_altsepu
   splitdriveu
   startswithu   lstripu   splitu   lenu   endswithu   appendu   join(   u   pathu   sepu   dotdotu   prefixu   compsu   i(    (    u#   /mit/python/lib/python3.0/ntpath.pyu   normpathº  s:    
 

 #"#(   u   _getfullpathnamec             C   sV   t  |  ƒ p? t |  t ƒ o t j ƒ  } n t j ƒ  } t | |  ƒ }  n t |  ƒ S(   u&   Return the absolute version of a path.(   u   isabsu
   isinstanceu   bytesu   osu   getcwdbu   getcwdu   joinu   normpath(   u   pathu   cwd(    (    u#   /mit/python/lib/python3.0/ntpath.pyu   abspathí  s    c             C   sH   |  o+ y t  |  ƒ }  Wq> t k
 o Yq> Xn t j ƒ  }  t |  ƒ S(   u&   Return the absolute version of a path.(   u   _getfullpathnameu   WindowsErroru   osu   getcwdu   normpath(   u   path(    (    u#   /mit/python/lib/python3.0/ntpath.pyu   abspathø  s    
u   getwindowsversioni   i   c             C   s¿  t  |  ƒ } | t k o t |  ƒ } n |  p t d ƒ ‚ n t | ƒ j | ƒ } t |  ƒ j | ƒ } | d j ƒ  | d j ƒ  k ow t |  ƒ \ } } t | ƒ \ } } t | ƒ t | ƒ Ao t d |  | f ƒ ‚ qt d | d | d f ƒ ‚ n xY t	 t
 t | ƒ t | ƒ ƒ ƒ D], } | | j ƒ  | | j ƒ  k o Pq$q$W| d 7} t |  t ƒ o
 d }	 n d }	 |	 g t | ƒ | | | d … }
 |
 p t |  ƒ St |
 Œ  S(	   u#   Return a relative version of a pathu   no path specifiedi    u,   Cannot mix UNC and non-UNC paths (%s and %s)u&   path is on drive %s, start on drive %si   s   ..u   ..N(   u   _get_sepu   curdiru   _get_dotu
   ValueErroru   abspathu   splitu   loweru   splituncu   boolu   rangeu   minu   lenu
   isinstanceu   bytesu   join(   u   pathu   startu   sepu
   start_listu	   path_listu   unc_pathu   restu	   unc_startu   iu   pardiru   rel_list(    (    u#   /mit/python/lib/python3.0/ntpath.pyu   relpath
  s6    !" !	

%(.   u   __doc__u   osu   sysu   statu   genericpathu   __all__u   curdiru   pardiru   extsepu   sepu   pathsepu   altsepu   defpathu   builtin_module_namesu   devnullu   _get_sepu   _get_altsepu   _get_bothsepsu   _get_dotu
   _get_colonu   normcaseu   isabsu   joinu
   splitdriveu   splituncu   splitu   splitextu	   _splitextu   basenameu   dirnameu   islinku   existsu   lexistsu   ismountu
   expanduseru
   expandvarsu   normpathu   ntu   _getfullpathnameu   ImportErroru   abspathu   realpathu   hasattru   getwindowsversionu   supports_unicode_filenamesu   relpath(    (    (    u#   /mit/python/lib/python3.0/ntpath.pyu   <module>   sj   


					
			>			"							1	u	/	