³ò :ºODc&@s>dZddkZddkZddkZddddddd d d d d ddddddddddddddddddd d!d"d#d$d%g#Zd&Zd'Zd&Zd(Zd)Z d*Z d+Z d,ei jo d-Z nd.ei jo d*Z nd/Z d0„Zd1„Zd2„Zd3„Zd4„Zd5„Zd6„Zd7„Zd8„Zd9„Zd:„Zd;„Zd<„Zd=„Zd>„Zd?„ZeZd@„ZdA„Z dB„Z!dC„Z"dD„Z#dE„Z$dF„Z%yddGk&l'Z'Wne(j odH„Z)n XdI„Z)e)Z*e+edJƒoei,ƒdKdLjZ-dS(MsCommon pathname manipulations, WindowsNT/95 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..s\t;t/s.;C:\bintces\Windowstos2tnulcCs|iddƒiƒS(saNormalize case of pathname. Makes all characters lowercase and all slashes into backslashes.R%s\(treplacetlower(ts((s ntpath.pycR&scCs+t|ƒd}|djo|d djS(sTest whether a path is absoluteits/\(R(R+((s ntpath.pycR3scGs‘|}x„|D]|}d}|djo d}n…t|ƒow|dd!djp|dd!djo d}q´t|ƒdjp$t|ƒdjo|ddjo d}q´n|o |}q t|ƒdjpt‚|ddjo8|o#|ddjo||d7}q‰||7}q |ddjo||7}q |o1|ddjo||7}q‰|d |7}q |d 7}q W|S( s=Join two or more pathname components, inserting "\" as needediR,iit:iiÿÿÿÿs/\s\(RtlentAssertionError(tatptpathtbtb_wins((s ntpath.pycR;s6   ( & cCs7|dd!djo|dd!|dfSnd|fS(slSplit a pathname into drive and path specifiers. Returns a 2-tuple "(drive,path)"; either part may be emptyiiR-iR,((R1((s ntpath.pycRtscCsÕ|dd!djod|fSn|dd!}|djp |djo‚t|ƒ}|iddƒ}|d jod|fSn|id|dƒ}|d jot|ƒ}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,is//s\\s\iÿÿÿÿ(RtfindR.(R1tfirstTwotnormptindex((s ntpath.pycR}s    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ÿÿÿÿ(RR.(R1tdtitheadttailthead2((s ntpath.pycRžs  cCs[|idƒ}|t|idƒ|idƒƒjo|dfSn|| ||fSdS(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,N(trfindtmax(R1R:((s ntpath.pycR·s(cCst|ƒdS(s)Returns the final component of a pathnamei(R(R1((s ntpath.pycRÆscCst|ƒdS(s-Returns the directory component of a pathnamei(R(R1((s ntpath.pycRÍscCs‚|pdSnt|ƒ}t|ƒ}tt|ƒt|ƒƒ}x5t|ƒD]'}||||jo || SqOqOW|| S(sGGiven a list of pathnames, returns the longest common leading componentR,(tminR?R.txrange(tmts1ts2tnR:((s ntpath.pycRÔs   cCsti|ƒiS(s0Return the size of a file, reported by os.stat()(toststattst_size(tfilename((s ntpath.pycR âscCsti|ƒiS(sBReturn the last modification time of a file, reported by os.stat()(RFRGtst_mtime(RI((s ntpath.pycR æscCsti|ƒiS(s<Return the last access time of a file, reported by os.stat()(RFRGtst_atime(RI((s ntpath.pycR êscCsti|ƒiS(s:Return the creation time of a file, reported by os.stat().(RFRGtst_ctime(RI((s ntpath.pycR îscCstS(s=Test for symbolic link. On WindowsNT/95 always returns false(tFalse(R2((s ntpath.pycR õscCs4yti|ƒ}Wntij o tSnXtS(sTest whether a path exists(RFRGterrorRMtTrue(R2tst((s ntpath.pycRüs  cCs@yti|ƒ}Wntij o tSnXti|iƒS(s"Test whether a path is a directory(RFRGRNRMtS_ISDIRtst_mode(R2RP((s ntpath.pycR s  cCs@yti|ƒ}Wntij o tSnXti|iƒS(s%Test whether a path is a regular file(RFRGRNRMtS_ISREGRR(R2RP((s ntpath.pycRs  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\(RRR.(R2tunctrestR1((s ntpath.pycR$s cCsœyti|ƒ}Wntij o dSnX||||ƒd}xO|D]G}||jo4t||ƒ}t|ƒot|||ƒq”qMqMWdS(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.NR#s..(R#s..(RFtlistdirRNRRR(ttoptfunctargtnamest exceptionstname((s ntpath.pycR5s   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,(R.RFtenvirontKeyErrorR(R2R:REtuserhometdrive((s ntpath.pycRZs$  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}(tstringt ascii_letterstdigitsR.R8t ValueErrorRFRa(R2RhtvarcharstresR8tpathlentctvar((s ntpath.pycR|sb                  cCs |iddƒ}t|ƒ\}}|djo1x[|d djo|d}|d}q4Wn.|idƒo|d}|idƒ}n|idƒ}d}xÇ|t|ƒjo³||djo ||=q§||djox|djo5||ddjo ||d|d5|d8}qi|djo|idƒo ||=qi|d7}q§|d7}q§W| o| o|idƒn|di|ƒS( s0Normalize path, eliminating double slashes, etc.R%s\R,iiR#s..(R#R,( R)Rt startswithtlstripRR.tendswithtappendR(R2tprefixtcompsR:((s ntpath.pycR·s6    " (t_getfullpathnamecCs0t|ƒpttiƒ|ƒ}nt|ƒS(s&Return the absolute version of a path.(RRRFtgetcwdR(R2((s ntpath.pycRès cCsG|o*yt|ƒ}Wq=tj oq=Xn tiƒ}t|ƒS(s&Return the absolute version of a path.(Rwt WindowsErrorRFRxR(R2((s ntpath.pycRïs  tgetwindowsversionii(.t__doc__RFRGtsyst__all__RRRRRRRtbuiltin_module_namesR RRRRRRRRRRR R R R R RRRRRRRRRtntRwt ImportErrorRR!thasattrRzR"(((s ntpath.pycssj       9 !             % " ; -