B 3_r!&@sZdZdZdZdZdZdZdZdZddlZddl Z ddl Z ddl Z ddl Td d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.g&Z d/d0Z d1d Zd2d Zd3d Zd4d Zd5dZe jje_d6d Zd7dZd8dZd9dZd:dZd;dZddZd?dZ d@d+Z!dAdBZ"e j#dCkZ$dFdDd-Z%dEd.Z&dS)G.z../:z /bin:/usr/binNz /dev/null)*normcaseisabsjoin splitdrivesplitsplitextbasenamedirname commonprefixgetsizegetmtimegetatimegetctimeislinkexistslexistsisdirisfileismount expanduser expandvarsnormpathabspathsamefile sameopenfilesamestatcurdirpardirseppathsepdefpathaltsepextsepdevnullrealpathsupports_unicode_filenamesrelpath commonpathcCst|trdSdSdS)N/r) isinstancebytes)pathr0,/opt/alt/python37/lib/python3.7/posixpath.py_get_sep)s r2cCs.t|}t|ttfs*td|jj|S)Nz2normcase() argument must be str or bytes, not '{}') osfspathr-r.str TypeErrorformat __class____name__)sr0r0r1r4s   cCst|}t|}||S)N)r3r4r2 startswith)r:r"r0r0r1r@s c Gst|}t|}|}yb|s,|dd|xHttj|D]8}||rN|}q:|r\||rf||7}q:|||7}q:WWn.tttfk rt j d|f|YnX|S)Nrr) r3r4r2mapr;endswithr6AttributeError BytesWarning genericpath_check_arg_types)apr"r/br0r0r1rKs    cCs`t|}t|}||d}|d|||d}}|rX||t|krX||}||fS)N)r3r4r2rfindlenrstrip)rCr"iheadtailr0r0r1r hs  cCs6t|}t|trd}d}nd}d}t||d|S)Nr,.rr)r3r4r-r.r@ _splitext)rCr"r&r0r0r1r ys  cCst|}|dd|fS)Nr)r3r4)rCr0r0r1r s cCs,t|}t|}||d}||dS)NrE)r3r4r2rF)rCr"rIr0r0r1r s cCsNt|}t|}||d}|d|}|rJ||t|krJ||}|S)NrE)r3r4r2rFrGrH)rCr"rIrJr0r0r1r s   c Cs4yt|}Wnttfk r&dSXt|jS)NF)r3lstatOSErrorr>statS_ISLNKst_mode)r/str0r0r1rs cCs(yt|Wntk r"dSXdS)NFT)r3rNrO)r/r0r0r1rs cCsyt|}Wntk r"dSXt|jr4dSt|trJt|d}n t|d}t |}yt|}Wntk r~dSX|j }|j }||krdS|j }|j }||krdSdS)NFs..z..T) r3rNrOrPrQrRr-r.rr(st_devst_ino)r/s1parents2dev1dev2ino1ino2r0r0r1rs.    c Cs4t|}t|trd}nd}||s,|St|}||d}|dkrPt|}|dkrdtjkrddl }y| t j }Wqt k r|SXqtjd}nRddl }|d|}t|trt|d}y||}Wnt k r|SX|j }t|trt|}d}nd}||}|||dp2|S) N~~rErHOMEASCIIr,r)r3r4r-r.r;r2findrGenvironpwdgetpwuidgetuidpw_dirKeyErrorr5getpwnamfsencoderH) r/tilder"rIrcuserhomenamepwentrootr0r0r1rsB            c Cs\t|}t|trVd|kr |Sts:ddl}|d|jatj}d}d}t tdd}n:d|krb|St s|ddl}|d|ja t j}d }d }tj }d}x|||}|sP| d\}}| d } | |r| |r| d d } y.|dkrttj t| } n|| } Wntk r&|}YqX||d} |d|| }t|}|| 7}qW|S) N$rs\$(\w+|\{[^}]*\}){}environb$z\$(\w+|\{[^}]*\}){}rE)r3r4r-r. _varprogbrecompiler`searchgetattr_varprogrbspangroupr;r=rifsdecodergrG) r/rxrzstartendrbrImjrlvaluerKr0r0r1rsP          c Cst|}t|tr&d}d}d}d}nd}d}d}d}||krB|S||}|rp||d rp||d spd }||}g}xR|D]J}|||fkrq||ks|s|r|r|d |kr||q|r|qW|}||}|r|||}|p|S) Nr,rLs..rrz..rv) r3r4r-r.r;r appendpopr) r/r"emptydotdotdotinitial_slashescomps new_compscompr0r0r1rRs>          cCs@t|}t|s8t|tr&t}nt}t||}t|S)N) r3r4rr-r.getcwdbgetcwdrr)r/cwdr0r0r1rxs    cCs*t|}t|dd|i\}}t|S)Nr)r3r4 _joinrealpathr)filenamer/okr0r0r1r(s c Cst|trd}d}d}n d}d}d}t|r<|dd}|}x|r||\}}}|r>||krbq>||kr|rt|\}}||krt|||}q>|}q>t||}t|s|}q>||kr||}|dk rq>t||dfSd||<t|t ||\}} | st||dfS|||<q>W|d fS) Nr,rLs..rrz..rEFT) r-r.r partitionr rrrr3readlink) r/restseenr"r r!rl_newpathrr0r0r1rsH      rdarwinc Cs|s tdt|}t|tr.d}d}d}n d}d}d}|dkrH|}n t|}yndd t||D}d d t||D}tt||g}|gt||||d}|s|St |St t t t fk rtd ||YnXdS) Nzno path specifiedrLr,s..rrz..cSsg|] }|r|qSr0r0).0xr0r0r1 szrelpath..cSsg|] }|r|qSr0r0)rrr0r0r1rsr*) ValueErrorr3r4r-r.rr rGrrr6r>r?DeprecationWarningr@rA) r/rr r"r! start_list path_listrIrel_listr0r0r1r*s0   c s2|s tdtttj|}t|dtr4ddnddyƇfdd|D}ytfd d |D\}Wntk rtd dYnXfd d|D}t|}t |}|}x.t |D]"\}}|||kr|d|}PqW|rn dd}| |St t fk r,tjd|YnXdS)Nz%commonpath() arg is an empty sequencerr,rLrrcsg|]}|qSr0)r )rr/)r"r0r1rszcommonpath..c3s|]}|ddkVqdS)NrEr0)rrC)r"r0r1 szcommonpath..z%Can't mix absolute and relative pathscsg|]}fdd|DqS)csg|]}|r|kr|qSr0r0)rc)r r0r1rsz)commonpath...r0)rr:)r r0r1rsr+)r+)rtupler<r3r4r-r.setminmax enumeraterr6r>r@rA) paths split_pathsrrVrXcommonrIrprefixr0)r r"r1r+s6  )N)'r r!r&r"r#r$r%r'r3sysrPr@__all__r2rrrr r rM__doc__r r r rrrrr|rwrrrr(rplatformr)r*r+r0r0r0r1sX           *25& 3  )