³ò <¯bCc%@s«dZddkZddkZddddddd d d d d ddddddddddddddddddd d!d"d#d$d%g#Zd&Zd'Zd&Zd(Zd)Zd*Z d+Z d,Z d-„Z d.„Z d/„Zd0„Zd1„Zd2„Zd3„Zd4„Zd5„Zd6„Zd7„Zd8„Zd9„Zd:„Zd;„Zd<„ZeZd=„Zd>„Zd?„Zd@„Z dA„Z!dB„Z"dC„Z#dD„Z$e$Z%e&Z'dS(EsŒCommon pathname manipulations, OS/2 EMX version. Instead of importing this module directly, import os and refer to this module as os.path. iÿÿÿÿNtnormcasetisabstjoint splitdrivetsplittsplitexttbasenametdirnamet commonprefixtgetsizetgetmtimetgetatimetgetctimetislinktexiststlexiststisdirtisfiletismounttwalkt expandusert expandvarstnormpathtabspathtsplitunctcurdirtpardirtseptpathseptdefpathtaltseptextseptdevnulltrealpathtsupports_unicode_filenamest.s..t/s\t;s.;C:\bintnulcCs|iddƒiƒS(sZNormalize case of pathname. Makes all characters lowercase and all altseps into seps.s\R$(treplacetlower(ts((sos2emxpath.pycR scCs+t|ƒd}|djo|d djS(sTest whether a path is absoluteits/\(R(R)((sos2emxpath.pycR-scGsl|}x_|D]W}t|ƒo |}q |djp|ddjo||}q |d|}q W|S(s=Join two or more pathname components, inserting sep as neededR*iÿÿÿÿs/\:R$(R(tatptpathtb((sos2emxpath.pycR5s  cCs7|dd!djo|dd!|dfSnd|fS(slSplit a pathname into drive and path specifiers. Returns a 2-tuple "(drive,path)"; either part may be emptyiit:iR*((R,((sos2emxpath.pycREscCsÕ|dd!djod|fSn|dd!}|d jp |d jo‚t|ƒ}|iddƒ}|djod|fSn|id|dƒ}|djot|ƒ}n|| ||fSnd|fS( s@Split a pathname into UNC mount point and relative path specifiers. Return a 2-tuple (unc, rest); either part may be empty. If unc is not empty, it has the form '//host/mount' (or similar using backslashes). unc+rest is always the input path. Paths containing drive letters never have an UNC part. iiR/R*iR$s\iÿÿÿÿs//s\\(Rtfindtlen(R,tfirstTwotnormptindex((sos2emxpath.pycRNs    cCs¬t|ƒ\}}t|ƒ}x+|o#||ddjo|d}q!W|| ||}}|}x'|o|ddjo|d }qjW|p|}|||fS(s~Split a pathname. Return tuple (head, tail) where tail is everything after the final slash. Either part may be empty.is/\iÿÿÿÿ(RR1(R,tdtitheadttailthead2((sos2emxpath.pycRos  cCsŸd\}}x†|D]~}|djo|||d}}q|djo&|o|||}}q‘|}q|o||}q||}qW||fS(s‘Split the extension from a pathname. Extension is everything from the last dot to the end. Return (root, ext), either part may be empty.R*R$s\R#(R*R*(R$s\((R,troottexttc((sos2emxpath.pycRˆs    cCst|ƒdS(s)Returns the final component of a pathnamei(R(R,((sos2emxpath.pycRŸscCst|ƒdS(s-Returns the directory component of a pathnamei(R(R,((sos2emxpath.pycR¦scCs‚|pdSnt|ƒ}t|ƒ}tt|ƒt|ƒƒ}x5t|ƒD]'}||||jo || SqOqOW|| S(sGGiven a list of pathnames, returns the longest common leading componentR*(tmintmaxR1txrange(tmts1ts2tnR6((sos2emxpath.pycR­s   cCsti|ƒiS(s0Return the size of a file, reported by os.stat()(toststattst_size(tfilename((sos2emxpath.pycR »scCsti|ƒiS(sBReturn the last modification time of a file, reported by os.stat()(RDREtst_mtime(RG((sos2emxpath.pycR ¿scCsti|ƒiS(s<Return the last access time of a file, reported by os.stat()(RDREtst_atime(RG((sos2emxpath.pycR ÃscCsti|ƒiS(s:Return the creation time of a file, reported by os.stat().(RDREtst_ctime(RG((sos2emxpath.pycR ÇscCstS(s5Test for symbolic link. On OS/2 always returns false(tFalse(R-((sos2emxpath.pycR ÎscCs4yti|ƒ}Wntij o tSnXtS(sTest whether a path exists(RDREterrorRKtTrue(R-tst((sos2emxpath.pycRÖs  cCs@yti|ƒ}Wntij o tSnXti|iƒS(s"Test whether a path is a directory(RDRERLRKtS_ISDIRtst_mode(R-RN((sos2emxpath.pycRãs  cCs@yti|ƒ}Wntij o tSnXti|iƒS(s%Test whether a path is a regular file(RDRERLRKtS_ISREGRP(R-RN((sos2emxpath.pycRðs  cCsXt|ƒ\}}|o|djSnt|ƒd}t|ƒdjo|ddjS(s?Test whether a path is a mount point (defined as root of drive)R*R$s\iis/\(R*R$s\(RRR1(R-tunctrestR,((sos2emxpath.pycRüs cCsœyti|ƒ}Wntij o dSnX||||ƒd}xO|D]G}||jo4t||ƒ}t|ƒot|||ƒq”qMqMWdS(sëDirectory tree walk whth callback function. walk(top, func, arg) calls func(arg, d, files) for each directory d in the tree rooted at top (including top itself); files is a list of all the files and subdirs in directory d.NR#s..(R#s..(RDtlistdirRLRRR(ttoptfunctargtnamest exceptionstname((sos2emxpath.pycR s   cCsù|d djo|Sndt|ƒ}}x-||jo||djo|d}q/W|djo€dtijotid}qídtijo|Sqíytid}Wntj o d}nXt|tidƒ}n|S|||S(sLExpand ~ and ~user constructs. If user or $HOME is unknown, do nothing.it~s/\tHOMEtHOMEPATHt HOMEDRIVER*(R1RDtenvirontKeyErrorR(R-R6RCtuserhometdrive((sos2emxpath.pycR)s$  c Cs•d|jo|Snddk}|i|id}d}d}t|ƒ}xA||jo3||}|djoq||d}t|ƒ}y)|idƒ}|d||d }Wq‚tj o||}|d}q‚Xnž|djo†||d|d !djo||}|d}q‚||d|d !d joŠ||d }t|ƒ}yB|id ƒ}|| }|tijo|ti|}nWqttj o||}|d}qtXq‚d}|d}|||d!}xD|djo6||jo)||}|d}|||d!}qðW|tijo|ti|}n|djo||}q‚n ||}|d}qPW|S( sZExpand shell variables of form $var and ${var}. Unknown variables are left unchanged.t$iÿÿÿÿNs_-R*is'iit{t}(tstringtletterstdigitsR1R4t ValueErrorRDR_(R-RftvarcharstresR4tpathlenR<tvar((sos2emxpath.pycRKsb                  cCsj|iddƒ}t|ƒ\}}x*|d djo|d}|d}q'W|idƒ}d}xÏ|t|ƒjo»||djo ||=qi||djoB|djo5||ddjo ||d|d5|d}qi||djo-|djo ||ddjo ||=qi|d}qiW| o| o|idƒn|di|ƒS( s0Normalize path, eliminating double slashes, etc.s\R$iiR#s..R*(R*s..(R'RRR1tappendR(R-tprefixtcompsR6((sos2emxpath.pycR„s*  33 cCs0t|ƒpttiƒ|ƒ}nt|ƒS(s%Return the absolute version of a path(RRRDtgetcwdR(R-((sos2emxpath.pycRžs ((t__doc__RDREt__all__RRRRRRRR RRRRRRRRRRR R R R R RRRRRRRRRRR!RKR"(((sos2emxpath.pycssV     !              " 9