ó
è¾bc        !   @   s¯  d  Z  d d l Z d d l Z d d l Td d l Z d d l Td d l m 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 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 e j j  e _  d0 „  Z d1 „  Z d2 „  Z d3 „  Z d4 „  Z d5 „  Z d6 „  Z d7 „  Z d8 e f d9 „  ƒ  YZ d: „  Z  d; „  Z! d< „  Z" d= „  Z# e$ Z% d S(>   s7   Pathname and path-related operations for the Macintosh.iÿÿÿÿN(   t   *(   t   _unicodet   normcaset   isabst   joint
   splitdrivet   splitt   splitextt   basenamet   dirnamet   commonprefixt   getsizet   getmtimet   getatimet   getctimet   islinkt   existst   lexistst   isdirt   isfilet   walkt
   expandusert
   expandvarst   normpatht   abspatht   curdirt   pardirt   sept   pathsept   defpatht   altsept   extsept   devnullt   realpatht   supports_unicode_filenamest   :s   ::t   .s   
s   Dev:Nullc         C   s
   |  j  ƒ  S(   N(   t   lower(   t   path(    (    s   /usr/lib/python2.7/macpath.pyR      s    c         C   s   d |  k o |  d d k S(   sø   Return true if a path is absolute.
    On the Mac, relative paths begin with a colon,
    but as a special case, paths with no colons at all are also relative.
    Anything else is absolute (the string up to the first colon is the
    volume name).R#   i    (    (   t   s(    (    s   /usr/lib/python2.7/macpath.pyR   !   s    c         G   s—   |  } xŠ | D]‚ } | s& t  | ƒ r2 | } q n  | d  d k rO | d } n  d | k rh d | } n  | d d k r… | d } n  | | } q W| S(   Ni   R#   iÿÿÿÿ(   R   (   R'   t   pR&   t   t(    (    s   /usr/lib/python2.7/macpath.pyR   +   s    c         C   s˜   d |  k r d |  f Sd } x7 t  t |  ƒ ƒ D]# } |  | d k r/ | d } q/ q/ W|  | d  |  | } } | rŽ d | k rŽ | d } n  | | f S(   sß   Split a pathname into two parts: the directory leading up to the final
    bit, and the basename (the filename, without colons, in that directory).
    The result (s, t) is such that join(s, t) yields the original argument.R#   t    i    i   (   t   ranget   len(   R'   t   colont   iR&   t   file(    (    s   /usr/lib/python2.7/macpath.pyR   ;   s     
 c         C   s   t  j |  t t t ƒ S(   N(   t   genericpatht	   _splitextR   R   R   (   R(   (    (    s   /usr/lib/python2.7/macpath.pyR   J   s    c         C   s
   d |  f S(   s@  Split a pathname into a drive specification and the rest of the
    path.  Useful on DOS/Windows/NT; on the Mac, the drive is always
    empty (don't use the volume name -- it doesn't have the same
    syntactic and semantic oddities as DOS drive letters, such as there
    being a separate current directory per drive).R*   (    (   R(   (    (    s   /usr/lib/python2.7/macpath.pyR   N   s    c         C   s   t  |  ƒ d S(   Ni    (   R   (   R'   (    (    s   /usr/lib/python2.7/macpath.pyR	   Z   R*   c         C   s   t  |  ƒ d S(   Ni   (   R   (   R'   (    (    s   /usr/lib/python2.7/macpath.pyR   [   R*   c         C   s<   t  |  ƒ s t St |  ƒ } t | ƒ d k o; | d d k S(   Ni   i   R*   (   R   t   FalseR   R,   (   R'   t
   components(    (    s   /usr/lib/python2.7/macpath.pyt   ismount]   s    c         C   s6   y' d d l  } | j j |  d ƒ d SWn t SXd S(   s6   Return true if the pathname refers to a symbolic link.iÿÿÿÿNi    i   (   t   Carbon.Filet   Filet   ResolveAliasFileR2   (   R'   t   Carbon(    (    s   /usr/lib/python2.7/macpath.pyR   c   s
    c         C   s/   y t  j |  ƒ } Wn t  j k
 r* t SXt S(   sC   Test whether a path exists.  Returns True for broken symbolic links(   t   ost   lstatt   errorR2   t   True(   R&   t   st(    (    s   /usr/lib/python2.7/macpath.pyR   o   s
    c         C   s   |  S(   sE   Dummy to retain interface-compatibility with other operating systems.(    (   R&   (    (    s   /usr/lib/python2.7/macpath.pyR   x   s    c         C   s   |  S(   sE   Dummy to retain interface-compatibility with other operating systems.(    (   R&   (    (    s   /usr/lib/python2.7/macpath.pyR   }   s    t
   norm_errorc           B   s   e  Z d  Z RS(   s   Path cannot be normalized(   t   __name__t
   __module__t   __doc__(    (    (    s   /usr/lib/python2.7/macpath.pyR>      s   c         C   s  d |  k r d |  S|  j  d ƒ } d } x | t | ƒ d k  rª | | d k r | | d d k r | d k r‘ | | d | d 5| d } q§ t d ‚ q, | d } q, Wd j | ƒ }  |  d d k rÿ t | ƒ d k rÿ |  d t |  ƒ k rÿ |  d  }  n  |  S(   sL   Normalize a pathname.  Will return the same result for
    equivalent paths.R#   i   R*   s+   Cannot use :: immediately after volume nameiÿÿÿÿi   (   R   R,   R>   R   (   R'   t   compsR.   (    (    s   /usr/lib/python2.7/macpath.pyR   „   s    $8c         C   sž   t  j d d d ƒy t j |  ƒ } Wn t j k
 r= d SX| | |  | ƒ xI | D]A } t |  | ƒ } t | ƒ rU t | ƒ rU t | | | ƒ qU qU 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.s4   In 3.x, os.path.walk is removed in favor of os.walk.t
   stackleveli   N(	   t   warningst   warnpy3kR9   t   listdirR;   R   R   R   R   (   t   topt   funct   argt   namest   name(    (    s   /usr/lib/python2.7/macpath.pyR       s    c         C   sR   t  |  ƒ sH t |  t ƒ r* t j ƒ  } n t j ƒ  } t | |  ƒ }  n  t |  ƒ S(   s   Return an absolute path.(   R   t
   isinstanceR   R9   t   getcwdut   getcwdR   R   (   R&   t   cwd(    (    s   /usr/lib/python2.7/macpath.pyR   »   s    c         C   s½   t  |  ƒ }  y d d  l } Wn t k
 r0 |  SX|  s; |  S|  j d ƒ } | d d }  x^ | d D]R } t |  | ƒ }  y# | j j |  d ƒ d j ƒ  }  Wqc | j j k
 r´ qc Xqc W|  S(   NiÿÿÿÿR#   i    i   (	   R   R5   t   ImportErrorR   R   R6   t   FSResolveAliasFilet   as_pathnamet   Error(   R&   R8   R3   t   c(    (    s   /usr/lib/python2.7/macpath.pyR!   Æ   s     #(&   RA   R9   RD   t   statR0   R   t   __all__R   R   R   R   R   R   t   NoneR   R    R   R   R   R   R   R1   R   R	   R   R4   R   R   R   R   t	   ExceptionR>   R   R   R   R!   R<   R"   (    (    (    s   /usr/lib/python2.7/macpath.pyt   <module>   sP   

		
																