B b&@s0dZdZdZdZdZdZdZdZddlZddl Z ddl Z ddl Z dd l Td d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/g&Z d0d1Z d2d Zd3d Zd4d Zd5d Zd6dZd7dZe jje_d8dZd9dZd:dZd;dZydddZd?dZd@dZ dAdBZ!yddClm"Z"Wnek rxe!Z#Yn XdDd Z#e#Z$e%e dEoe &dFdGkZ'dOdHd+Z(dId/Z)y,e &ddGdJkrddKlm*Z*neWn"e+efk rdLdMZ*YnXyddNlm,Z-Wnek r*YnXdS)P.z..\;/z.;C:\binZnulN)*normcaseisabsjoin splitdrivesplitsplitextbasenamedirname commonprefixgetsizegetmtimegetatimegetctimeislinkexistslexistsisdirisfileismount expanduser expandvarsnormpathabspathcurdirpardirseppathsepdefpathaltsepextsepdevnullrealpathsupports_unicode_filenamesrelpathsamefile sameopenfilesamestat commonpathcCst|trdSdSdS)Ns\/z\/) isinstancebytes)pathr0)/opt/alt/python37/lib/python3.7/ntpath.py _get_bothseps"s r2c Csxt|}y.t|tr&|ddS|ddSWn:ttfk rrt|ttfsltd|j j dYnXdS)N/\rrz0normcase() argument must be str or bytes, not %r) osfspathr-r.replacelower TypeErrorAttributeErrorstr __class____name__)sr0r0r1r,s  cCs2t|}t|d}t|dko0|dt|kS)Nr)r5r6r lenr2)r>r0r0r1rCs  c GsTt|}t|tr"d}d}d}n d}d}d}y|sD|dd|t|\}}xttj|D]~}t|\}} | r| d|kr|s|s|}| }q^n*|r||kr||kr|}| }q^|}|r|d|kr||}|| }q^W|r|d|kr|r|dd|kr|||S||Sttt fk rNt j d |f|YnXdS) Nr4s\/:rz\/:rr ) r5r6r-r.r mapr8r9r: BytesWarning genericpath_check_arg_types) r/pathsr sepscolonZ result_driveZ result_pathpZp_driveZp_pathr0r0r1r KsF       cCst|}t|dkrt|tr0d}d}d}n d}d}d}|||}|dd|dkr|dd |kr||d}|d kr|dd|fS|||d }||d kr|dd|fS|d krt|}|d|||dfS|d d|kr|dd|ddfS|dd|fS) Nr4r3rArrrBrrCr?)r5r6r@r-r.r7find)rKr r#rJZnormpindexZindex2r0r0r1r zs.   $  cCs|t|}t|}t|\}}t|}x |rF||d|krF|d8}q(W|d|||d}}||pn|}|||fS)Nr?)r5r6r2r r@rstrip)rKrIdiheadtailr0r0r1r s   cCs8t|}t|tr$t|dddSt|dddSdS)Nr4r3.rrr)r5r6r-r.rF _splitext)rKr0r0r1r s  cCs t|dS)Nr?)r )rKr0r0r1r scCs t|dS)Nr)r )rKr0r0r1rsc Cs4yt|}Wnttfk r&dSXt|jS)NF)r5lstatOSErrorr:statS_ISLNKst_mode)r/str0r0r1rs cCs(yt|}Wntk r"dSXdS)NFT)r5rWrX)r/r\r0r0r1rs )_getvolumepathnamecCstt|}t|}t|}t|\}}|rD|d|krD| pB||kS||krPdStrl||t||kSdSdS)NrTF)r5r6r2rr r]rP)r/rIrootrestr0r0r1rs  cCst|}t|trd}nd}||s,|Sdt|}}x$||kr^||t|kr^|d7}q4szrelpath..cSsg|] }|r|qSr0r0)rrr0r0r1r5srr?r()r5r6r-r.r{rrr rr zipr@r r9r:rEDeprecationWarningrFrG)r/startr rrZ start_absZpath_absZ start_driveZ start_restZ path_driveZ path_rest start_list path_listrRZe1Ze2rel_listr0r0r1r(sF         c s|s tdtttj|}t|dtr8dddn dddy>fd d |D}fd d |D}ytfd d |D\}Wntk rtddYnXttdd |Ddkrtdt |d \}}| }fdd |D}fdd |D}t |}t |}xBt|D]&\} } | || kr,|d| }Pq,W|dt|}|rt|n|} | |Sttfk rtjd|YnXdS)Nz%commonpath() arg is an empty sequencerr4r3rUrrrcs g|]}t|qSr0)r r7r8)rrK)r#r r0r1raszcommonpath..csg|]\}}|qSr0)r )rrQrK)r r0r1rbsc3s"|]\}}|ddkVqdS)Nr?r0)rrQrK)r r0r1 eszcommonpath..z%Can't mix absolute and relative pathscss|]\}}|VqdS)Nr0)rrQrKr0r0r1rlsr?zPaths don't have the same drivecsg|]}|r|kr|qSr0r0)rr~)rr0r1rqscsg|]}fdd|DqS)csg|]}|r|kr|qSr0r0)rr~)rr0r1rssz)commonpath...r0)rr>)rr0r1rssr,)r,)r{tuplerDr5r6r-r.setr@r r7r minmax enumerater r9r:rFrG) rHZ drivesplits split_pathsrrkr/commons1s2rRr~rr0)r#rr r1r,PsF  )r)_getfinalpathnamecCs tt|S)N)rr)fr0r0r1rsr)_isdir)N).rrr$r r!r#r"r%r5sysrYrF__all__r2rrr r r r rV__doc__r rrrntr] ImportErrorrrrrrrrr&hasattrrr'r(r,rr:rrr0r0r0r1 sx       /8   2q1   85