usr/lib64/python2.7/macpath.pyo000064400000017001147204470660012224 0ustar00 zfc!@sdZddlZddlZddlTddlZddlTddlmZddddd d d d d ddddddddddddddddddd d!d"d#d$d%g!Zd&Zd'Zd(Z d&Z d)Z d&Z dZd*Zd+Zd,Zd-Zd.Zd/Zejje_d0Zd1Zd2Zd3Zd4Zd5Zd6Zd7Zd8efd9YZd:Z d;Z!d<Z"d=Z#e$Z%dS(>s7Pathname and path-related operations for the Macintosh.iN(t*(t_unicodetnormcasetisabstjoint splitdrivetsplittsplitexttbasenametdirnamet commonprefixtgetsizetgetmtimetgetatimetgetctimetislinktexiststlexiststisdirtisfiletwalkt expandusert expandvarstnormpathtabspathtcurdirtpardirtseptpathseptdefpathtaltseptextseptdevnulltrealpathtsupports_unicode_filenamest:s::t.s sDev:NullcCs |jS(N(tlower(tpath((s/usr/lib64/python2.7/macpath.pyRscCsd|ko|ddkS(sReturn 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((ts((s/usr/lib64/python2.7/macpath.pyR!scGs|}x|D]}| s&t|r2|}q n|d dkrO|d}nd|krhd|}n|ddkr|d}n||}q W|S(NiR#i(R(R'tpR&tt((s/usr/lib64/python2.7/macpath.pyR+s     cCsd|krd|fSd}x7tt|D]#}||dkr/|d}q/q/W||d ||}}|rd|kr|d}n||fS(sSplit 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#tii(trangetlen(R'tcolontiR&tfile((s/usr/lib64/python2.7/macpath.pyR;s  cCstj|tttS(N(t genericpatht _splitextRRR(R(((s/usr/lib64/python2.7/macpath.pyRJscCs d|fS(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/lib64/python2.7/macpath.pyRNscCst|dS(Ni(R(R'((s/usr/lib64/python2.7/macpath.pyR ZR*cCst|dS(Ni(R(R'((s/usr/lib64/python2.7/macpath.pyR[R*cCs<t|stSt|}t|dko;|ddkS(NiiR*(RtFalseRR,(R't components((s/usr/lib64/python2.7/macpath.pytismount]s  cCs6y'ddl}|jj|ddSWntSXdS(s6Return true if the pathname refers to a symbolic link.iNii(t Carbon.FiletFiletResolveAliasFileR2(R'tCarbon((s/usr/lib64/python2.7/macpath.pyRcs  cCs/ytj|}Wntjk r*tSXtS(sCTest whether a path exists. Returns True for broken symbolic links(tostlstatterrorR2tTrue(R&tst((s/usr/lib64/python2.7/macpath.pyRos cCs|S(sEDummy to retain interface-compatibility with other operating systems.((R&((s/usr/lib64/python2.7/macpath.pyRxscCs|S(sEDummy to retain interface-compatibility with other operating systems.((R&((s/usr/lib64/python2.7/macpath.pyR}st norm_errorcBseZdZRS(sPath cannot be normalized(t__name__t __module__t__doc__(((s/usr/lib64/python2.7/macpath.pyR>scCsd|krd|S|jd}d}x|t|dkr||dkr||ddkr|dkr||d|d5|d}qtdq,|d}q,Wdj|}|ddkrt|dkr|dt|kr|d }n|S(sLNormalize a pathname. Will return the same result for equivalent paths.R#iR*s+Cannot use :: immediately after volume nameii(RR,R>R(R'tcompsR.((s/usr/lib64/python2.7/macpath.pyRs $   8 cCstjdddytj|}Wntjk r=dSX||||xI|D]A}t||}t|rUt| rUt|||qUqUWdS(sIDirectory 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.s4In 3.x, os.path.walk is removed in favor of os.walk.t stackleveliN( twarningstwarnpy3kR9tlistdirR;RRRR(ttoptfunctargtnamestname((s/usr/lib64/python2.7/macpath.pyRs  cCsRt|sHt|tr*tj}n tj}t||}nt|S(sReturn an absolute path.(Rt isinstanceRR9tgetcwdutgetcwdRR(R&tcwd((s/usr/lib64/python2.7/macpath.pyRs   cCst|}yddl}Wntk r0|SX|s;|S|jd}|dd}x^|dD]R}t||}y#|jj|ddj}Wqc|jjk rqcXqcW|S(NiR#ii( RR5t ImportErrorRRR6tFSResolveAliasFilet as_pathnametError(R&R8R3tc((s/usr/lib64/python2.7/macpath.pyR!s   #(&RAR9RDtstatR0Rt__all__RRRRRRtNoneRR RRRRRR1RR RR4RRRRt ExceptionR>RRRR!R<R"(((s/usr/lib64/python2.7/macpath.pytsP