ryMac @sdZddlZddlTddlZddlTdddddd d d d d ddddddddddddddddddd d!d"d#g Zd$Zd%Zd&Zd$Zd'Z d$Z dZ d(Z d)d*Zd+dZd,dZd-dZd.dZd/d Zejje_d0dZd1d Zd2d Zd3d4Zd5dZd6dZd7dZd8dZGd9d:d:eZd;dZd<dZ d=d"Z!d>Z#dS(?u7Pathname and path-related operations for the Macintosh.iN(u*unormcaseuisabsujoinu splitdriveusplitusplitextubasenameudirnameu commonprefixugetsizeugetmtimeugetatimeugetctimeuislinkuexistsulexistsuisdiruisfileu expanduseru expandvarsunormpathuabspathucurdirupardirusepupathsepudefpathualtsepuextsepudevnullurealpathusupports_unicode_filenamesu:u::u.u uDev:NullcCst|trdSdSdS(Ns:u:(u isinstanceubytes(upath((u,/opt/alt/python33/lib64/python3.3/macpath.pyu _get_colonsu _get_coloncCs=t|ttfs3tdj|jjn|jS(Nu2normcase() argument must be str or bytes, not '{}'(u isinstanceubytesustru TypeErroruformatu __class__u__name__ulower(upath((u,/opt/alt/python33/lib64/python3.3/macpath.pyunormcase"s cCs,t|}||ko+|dd|kS(uReturn 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).Ni(u _get_colon(usucolon((u,/opt/alt/python33/lib64/python3.3/macpath.pyuisabs)s cGst|}|}x|D]}| s2t|r>|}qn|dd|krg|dd}n||kr||}n|dd|kr||}n||}qW|S(Nii(u _get_colonuisabs(usupucolonupathut((u,/opt/alt/python33/lib64/python3.3/macpath.pyujoin4s     cCst|}||kr,|dd|fSd}xAtt|D]-}|||d|krE|d}qEqEW|d|d||d}}|r||kr||}n||fS(uSplit 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.Nii(u _get_colonurangeulen(usucolonucoluiupathufile((u,/opt/alt/python33/lib64/python3.3/macpath.pyusplitEs  % cCs?t|tr%tj|dtdStj|tttSdS(Ns:s.(u isinstanceubytesu genericpathu _splitextualtsepusepuextsep(up((u,/opt/alt/python33/lib64/python3.3/macpath.pyusplitextUscCs|dd|fS(u@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).Ni((up((u,/opt/alt/python33/lib64/python3.3/macpath.pyu splitdrive\scCst|dS(Ni(usplit(us((u,/opt/alt/python33/lib64/python3.3/macpath.pyudirnamehscCst|dS(Ni(usplit(us((u,/opt/alt/python33/lib64/python3.3/macpath.pyubasenameiscCs7t|sdSt|}t|dko6|d S(NiiF(uisabsuFalseusplitulen(usu components((u,/opt/alt/python33/lib64/python3.3/macpath.pyuismountks  uismountc Cs:y'ddl}|jj|ddSWn dSYnXdS(u6Return true if the pathname refers to a symbolic link.iNiF(u Carbon.FileuFileuResolveAliasFileuFalse(usuCarbon((u,/opt/alt/python33/lib64/python3.3/macpath.pyuislinkqs  c Cs3ytj|}Wntjk r.dSYnXdS(uCTest whether a path exists. Returns True for broken symbolic linksFT(uosulstatuerroruFalseuTrue(upathust((u,/opt/alt/python33/lib64/python3.3/macpath.pyulexists}s  cCs|S(uEDummy to retain interface-compatibility with other operating systems.((upath((u,/opt/alt/python33/lib64/python3.3/macpath.pyu expandvarsscCs|S(uEDummy to retain interface-compatibility with other operating systems.((upath((u,/opt/alt/python33/lib64/python3.3/macpath.pyu expanduserscBs|EeZdZdZdS(u norm_erroruPath cannot be normalizedN(u__name__u __module__u __qualname__u__doc__(u __locals__((u,/opt/alt/python33/lib64/python3.3/macpath.pyu norm_errorsu norm_errorcCst|}||kr ||S|j|}d}xz|t|dkr|| r||dr|dkr||d|d=|d}qtdq8|d}q8W|j|}|dd|krt|dkr||t|kr|dd}n|S(uLNormalize a pathname. Will return the same result for equivalent paths.iu+Cannot use :: immediately after volume nameNiii(u _get_colonusplitulenu norm_errorujoin(usucolonucompsui((u,/opt/alt/python33/lib64/python3.3/macpath.pyunormpaths     >cCsRt|sHt|tr*tj}n tj}t||}nt|S(uReturn an absolute path.(uisabsu isinstanceubytesuosugetcwdbugetcwdujoinunormpath(upathucwd((u,/opt/alt/python33/lib64/python3.3/macpath.pyuabspaths   cCst|}yddl}Wntk r4|SYnX|s?|St|}|j|}|d|}xe|ddD]S}t||}y#|jj|ddj}Wqy|jj k rYqyXqyW|S(Nii( uabspathu Carbon.Fileu ImportErroru _get_colonusplitujoinuFileuFSResolveAliasFileu as_pathnameuError(upathuCarbonucolonu componentsuc((u,/opt/alt/python33/lib64/python3.3/macpath.pyurealpaths"    # T($u__doc__uosustatu genericpathu__all__ucurdirupardiruextsepusepupathsepudefpathuNoneualtsepudevnullu _get_colonunormcaseuisabsujoinusplitusplitextu _splitextu splitdriveudirnameubasenameuismountuislinkulexistsu expandvarsu expanduseru Exceptionu norm_errorunormpathuabspathurealpathuTrueusupports_unicode_filenames(((u,/opt/alt/python33/lib64/python3.3/macpath.pyusL