mò %U²Ic!@s°dZdkZdkTddddddd d d d d ddddddddddddddddddd d!d"d#g!Zd$Zd%Zd&Zd$Zd'Zd$Z dZ d(Z d)„Z d*„Zd+„Zd,„Zd-„Zd.„Zd/„Zd0„Zd1„Zd2„Zd3„Zd4„Zd5„Zd6„Zd7„Zd8„Zd9„Zd:„Zd;„Zd<„Z d=„Z!d>e"fd?„ƒYZ#d@„Z$dA„Z%dB„Z&dC„Z'e(Z)dS(Ds7Pathname and path-related operations for the Macintosh.N(t*tnormcasetisabstjoint splitdrivetsplittsplitexttbasenametdirnamet commonprefixtgetsizetgetmtimetgetatimetgetctimetislinktexiststlexiststisdirtisfiletwalkt expandusert expandvarstnormpathtabspathtcurdirtpardirtseptpathseptdefpathtaltseptextseptdevnulltrealpathtsupports_unicode_filenamest:s::t.s sDev:NullcCs |iƒS(N(tpathtlower(R$((t$/data/zmath/lib/python2.4/macpath.pyRscCsd|jo|ddjS(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"iN(ts(R'((R&RscGs |}x“|D]‹}| p t|ƒo |}q n|d djo|d}nd|jod|}n|ddjo|d}n||}q W|S(NiR"iÿÿÿÿ(R'R$tpttR(R'R(R)R$((R&R's cCs¢d|jod|fSnd}x9tt|ƒƒD]%}||djo|d}q4q4W||d ||}}|od|jo|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"tiiN(R'tcolontrangetlentiR$tfile(R'R.R+R/R$((R&R7s cCsI|idƒ}||idƒjo|dfSn|| ||fSdS(sÒSplit a path into root and extension. The extension is everything starting at the last dot in the last pathname component; the root is everything before that. It is always true that root + ext == p.R#R"R*N(R(trfindR.(R(R.((R&RFs cCs 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*N(R((R(((R&RSscCst|ƒdS(Ni(RR'(R'((R&R_scCst|ƒdS(Ni(RR'(R'((R&R`scCsBt|ƒptSnt|ƒ}t|ƒdjo|ddjS(NiiR*(RR'tFalseRt componentsR-(R'R2((R&tismountbs  cCs=yti|ƒ}Wntij o dSnXt|iƒS(s<Return true if the pathname refers to an existing directory.iN(toststatR'tstterrortS_ISDIRtst_mode(R'R6((R&Rhs  cCsti|ƒiS(s1Return the size of a file, reported by os.stat().N(R4R5tfilenametst_size(R:((R&R tscCsti|ƒiS(sCReturn the last modification time of a file, reported by os.stat().N(R4R5R:tst_mtime(R:((R&R xscCsti|ƒiS(s=Return the last access time of a file, reported by os.stat().N(R4R5R:tst_atime(R:((R&R |scCs6y$dk}|ii|dƒdSWn tSnXdS(s6Return true if the pathname refers to a symbolic link.Nii(t Carbon.FiletCarbontFiletResolveAliasFileR'R1(R'R?((R&Rs  cCs=yti|ƒ}Wntij o tSnXt|iƒS(s?Return true if the pathname refers to an existing regular file.N(R4R5R'R6R7R1tS_ISREGR9(R'R6((R&R‹s  cCsti|ƒiS(s:Return the creation time of a file, reported by os.stat().N(R4R5R:tst_ctime(R:((R&R ”scCs4yti|ƒ}Wntij o tSnXtS(sDTest whether a path exists. Returns False for broken symbolic linksN(R4R5R'R6R7R1tTrue(R'R6((R&R˜s  cCs4yti|ƒ}Wntij o tSnXtS(sCTest whether a path exists. Returns True for broken symbolic linksN(R4tlstatR$R6R7R1RD(R$R6((R&R¤s  cCsŒ|pdSn|d}xl|D]d}x[tt|ƒƒD]G}||d ||d jo$|| }|djodSnPq9q9Wq W|S(sGGiven a list of pathnames, returns the longest common leading componentR*iiN(tmtprefixtitemR,R-R.(RFR.RHRG((R&R ¯s    cCs|S(sEDummy to retain interface-compatibility with other operating systems.N(R$(R$((R&R»scCs|S(sEDummy to retain interface-compatibility with other operating systems.N(R$(R$((R&RÀst norm_errorcBstZdZRS(sPath cannot be normalized(t__name__t __module__t__doc__(((R&RIÄs cCsd|jo d|Sn|idƒ}d}x†|t|ƒdjon||djoO||ddjo:|djo ||d|d5|d}q²td‚q1|d}q1Wdi|ƒ}|ddjo8t|ƒdjo%|dt|ƒjo|d }n|S(sLNormalize a pathname. Will return the same result for equivalent paths.R"iR*s+Cannot use :: immediately after volume nameiÿÿÿÿiN(R'RtcompsR.R-RIR(R'R.RM((R&RÇs"  &  ;cCs“yti|ƒ}Wntij o dSnX||||ƒxL|D]D}t||ƒ}t |ƒo"t |ƒ ot |||ƒqGqGWdS(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.N( R4tlistdirttoptnamesR7tfunctargtnameRRRR(RORQRRRSRP((R&Rãs  cCs0t|ƒpttiƒ|ƒ}nt|ƒS(sReturn an absolute path.N(RR$RR4tgetcwdR(R$((R&Rýs cCs¦t|ƒ}y dk}Wntj o |SnX|p|Sn|idƒ}|dd}x@|dD]4}t||ƒ}|i i |dƒdi ƒ}qjW|S(NR"ii( RR$R>R?t ImportErrorRR2tcRR@tFSResolveAliasFilet as_pathname(R$RVR2R?((R&R s    #(*RLR4R5t__all__RRRRRRtNoneRRRRRRRRRRR3RR R R RRR RRR RRt ExceptionRIRRRR R1R!(%RRRRRRRRRR RRRRIRYRR!R RRRRR R RRR RRRR RRR3RRR4((R&t?sL i