ó õ^‚Rc!@sŸdZddlZddlZddlTddlZddlTdddddd d d d d ddddddddddddddddddd d!d"d#d$g!Zd%Zd&Zd'Zd%Z d(Z d%Z dZ d)Zd*„Zd+„Zd,„Zd-„Zd.„Zejje_d/„Zd0„Zd1„Zd2„Zd3„Zd4„Zd5„Zd6„Zd7efd8„ƒYZd9„Zd:„Z d;„Z!d<„Z"e#Z$dS(=s7Pathname and path-related operations for the Macintosh.iÿÿÿÿN(t*tnormcasetisabstjoint splitdrivetsplittsplitexttbasenametdirnamet commonprefixtgetsizetgetmtimetgetatimetgetctimetislinktexiststlexiststisdirtisfiletwalkt expandusert expandvarstnormpathtabspathtcurdirtpardirtseptpathseptdefpathtaltseptextseptdevnulltrealpathtsupports_unicode_filenamest:s::t.s sDev:NullcCs |jƒS(N(tlower(tpath((s/usr/lib/python2.7/macpath.pyRscCsd|ko|ddkS(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((ts((s/usr/lib/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/lib/python2.7/macpath.pyR*s     cCs˜d|krd|fSd}x7tt|ƒƒD]#}||dkr/|d}q/q/W||d ||}}|rŽd|krŽ|d}n||fS(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"tii(trangetlen(R&tcolontiR%tfile((s/usr/lib/python2.7/macpath.pyR:s  cCstj|tttƒS(N(t genericpatht _splitextRRR(R'((s/usr/lib/python2.7/macpath.pyRIscCs 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/lib/python2.7/macpath.pyRMscCst|ƒdS(Ni(R(R&((s/usr/lib/python2.7/macpath.pyRYscCst|ƒdS(Ni(R(R&((s/usr/lib/python2.7/macpath.pyRZscCs<t|ƒstSt|ƒ}t|ƒdko;|ddkS(NiiR)(RtFalseRR+(R&t components((s/usr/lib/python2.7/macpath.pytismount\s  cCs6y'ddl}|jj|dƒdSWntSXdS(s6Return true if the pathname refers to a symbolic link.iÿÿÿÿNii(t Carbon.FiletFiletResolveAliasFileR1(R&tCarbon((s/usr/lib/python2.7/macpath.pyRbs  cCs/ytj|ƒ}Wntjk r*tSXtS(sCTest whether a path exists. Returns True for broken symbolic links(tostlstatterrorR1tTrue(R%tst((s/usr/lib/python2.7/macpath.pyRns cCs|S(sEDummy to retain interface-compatibility with other operating systems.((R%((s/usr/lib/python2.7/macpath.pyRwscCs|S(sEDummy to retain interface-compatibility with other operating systems.((R%((s/usr/lib/python2.7/macpath.pyR|st norm_errorcBseZdZRS(sPath cannot be normalized(t__name__t __module__t__doc__(((s/usr/lib/python2.7/macpath.pyR=€scCsd|krd|S|jdƒ}d}x|t|ƒdkrª||dkr||ddkr|dkr‘||d|d5|d}q§td‚q,|d}q,Wdj|ƒ}|ddkrÿt|ƒ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 nameiÿÿÿÿi(RR+R=R(R&tcompsR-((s/usr/lib/python2.7/macpath.pyRƒs $   8 cCsžtjdddƒytj|ƒ}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( twarningstwarnpy3kR8tlistdirR:RRRR(ttoptfunctargtnamestname((s/usr/lib/python2.7/macpath.pyRŸs  cCsRt|ƒsHt|tƒr*tjƒ}n tjƒ}t||ƒ}nt|ƒS(sReturn an absolute path.(Rt isinstancetunicodeR8tgetcwdutgetcwdRR(R%tcwd((s/usr/lib/python2.7/macpath.pyRºs   cCs½t|ƒ}yddl}Wntk r0|SX|s;|S|jdƒ}|dd}x^|dD]R}t||ƒ}y#|jj|dƒdjƒ}Wqc|jjk r´qcXqcW|S(NiÿÿÿÿR"ii( RR4t ImportErrorRRR5tFSResolveAliasFilet as_pathnametError(R%R7R2tc((s/usr/lib/python2.7/macpath.pyR Ås   #(%R@R8RCtstatR/t__all__RRRRRRtNoneRRRRRRRR0RRRR3RRRRt ExceptionR=RRRR R;R!(((s/usr/lib/python2.7/macpath.pytsN