File: //usr/lib/python3.7/__pycache__/macpath.cpython-37.pyc
B
{a @ sJ d Z dZdZdZdZdZdZdZdZddl Z ddl
T ddlZddlT ddlZej
d ed
d dd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+g Zd,d- Zd.d Zd/d
Zd0d Zd1d Zd2d Zejj e_ d3d Zd4d Zd5d Zd6d7 Zd8d Zd9d Zd:d Zd;d ZG d<d= d=eZ d>d Z!d?d! Z"d@d* Z#dAZ$dS )Bz7Pathname and path-related operations for the Macintosh.:z::.
NzDev:Null )*zBthe macpath module is deprecated in 3.7 and will be removed in 3.8 )
stacklevelnormcaseisabsjoin
splitdrivesplitsplitextbasenamedirnamecommonprefixgetsizegetmtimegetatimegetctimeislinkexistslexistsisdirisfile
expanduser
expandvarsnormpathabspathcurdirpardirseppathsepdefpathaltsepextsepdevnullrealpathsupports_unicode_filenamesc C s t | trdS dS d S )N :r )
isinstancebytes)path r, /usr/lib/python3.7/macpath.py
_get_colon s
r. c C s( t | ttfs td| jj| S )Nz2normcase() argument must be str or bytes, not '{}')r) r* str TypeErrorformat __class____name__lower)r+ r, r, r- r ' s c C s t | }|| ko| dd |kS )zReturn 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).N )r. )scolonr, r, r- r . s c
G s yt | }| }|s"|d d | xj|D ]b}|r8t|r>|}q(|d d |krZ|dd }||krj|| }|dd |kr|| }|| }q(W |S tttfk
r tjd| f| Y nX d S )Nr r5 r
)r. r r0 AttributeErrorBytesWarninggenericpath_check_arg_types)r6 pr7 r+ tr, r, r- r
9 s(
c C s t | }|| kr | dd | fS d}x0tt| D ] }| ||d |kr2|d }q2W | d|d | |d }}|r||kr|| }||fS )zSplit 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.Nr r5 )r. rangelen)r6 r7 colir+ filer, r, r- r P s c C s. t | trt| dtdS t| tttS d S )Nr( .)r) r* r; _splitextr# r r$ )r= r, r, r- r
` s
c C s | dd | fS )a@ 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).Nr r, )r= r, r, r- r g s c C s t | d S )Nr )r )r6 r, r, r- r s c C s t | d S )Nr5 )r )r6 r, r, r- r t rF c C s* t | sdS t| }t|dko(|d S )NFr r5 )r r r@ )r6
componentsr, r, r- ismountv s rH c C s* yddl }|j| dd S dS dS )z6Return true if the pathname refers to a symbolic link.r Nr F)Carbon.FileFileZResolveAliasFile)r6 Carbonr, r, r- r | s
c C s( yt | }W n tk
r" dS X dS )zCTest whether a path exists. Returns True for broken symbolic linksFT)oslstatOSError)r+ str, r, r- r s
c C s | S )zEDummy to retain interface-compatibility with other operating systems.r, )r+ r, r, r- r s c C s | S )zEDummy to retain interface-compatibility with other operating systems.r, )r+ r, r, r- r s c @ s e Zd ZdZdS )
norm_errorzPath cannot be normalizedN)r3
__module____qualname____doc__r, r, r, r- rP s rP c C s t | }|| kr|| S | |}d}x^|t|d k r|| sz||d rz|dkrp||d |d = |d }qtdq(|d }q(W ||} | dd |krt|dkr| |t| kr| dd } | S )zLNormalize a pathname. Will return the same result for
equivalent paths.r5 z+Cannot use :: immediately after volume namer8 Nr )r. r r@ rP r
)r6 r7 compsrB r, r, r- r s
,c C s6 t | s.t| trt }nt }t|| } t| S )zReturn an absolute path.)r r) r* rL getcwdbgetcwdr
r )r+ cwdr, r, r- r s
c C s t | } ydd l}W n tk
r( | S X | s2| S t| }| |}|d | } xR|dd D ]B}t| |} y|j| dd } W q^ |jj k
r Y q^X q^W | S )Nr r5 )
r rI ImportErrorr. r r
rJ ZFSResolveAliasFileZas_pathnameError)r+ rK r7 rG cr, r, r- r&