Qfy dZdZdZdZdZdZdZdZddlZddl Z ddl Z ddl Z dd l gd Z d Z dd lmZmZmZd ZdZdZdZdZdZdZe j:j<e_dZdZ e!ejDdrdZ#ndZ#dZ$ ddl%m&Z&dZ'dZ(dZ) ddl%m*Z+d!Z, dd"l%m-Z-d#Z. dd$l%m/Z/m0Z1d%Z2d&Z3d'd(d)Z4d*Z5d4d+Z6d,Z7 dd-l%m8Z9dd.l%m:Z;dd/l%mZ? dd1l%m@Z@d2ZAy#e$rdZYwxYw#e$rdZ&YvwxYw#e$rd Z+YtwxYw#e$re,Z.YtwxYw#e$re.Z4YlwxYw#e$rYUwxYw#e$rd3ZAYywxYw)5...\;/z.;C:\binnulN)*)(normcaseisabsjoin splitdrive splitrootsplitsplitextbasenamedirname commonprefixgetsizegetmtimegetatimegetctimeislinkexistslexistsisdirisfileismount expanduser expandvarsnormpathabspathcurdirpardirseppathsepdefpathaltsepextsepdevnullrealpathsupports_unicode_filenamesrelpathsamefile sameopenfilesamestat commonpath isjunctionc&t|tryy)N\/\/) isinstancebytespaths -/opt/alt/python312/lib64/python3.12/ntpath.py _get_bothsepsr:#s$) LCMapStringExLOCALE_NAME_INVARIANTLCMAP_LOWERCASEcZ tj|}|s|St|tr]t j }|j |djdd}ttt|}|j|dSttt|jddS)Nsurrogateescaperr) osfspathr5r6sysgetfilesystemencodingdecodereplace_LCMapStringEx_LOCALE_NAME_INVARIANT_LCMAP_LOWERCASEencode)sencodings r9r r 3s  IIaLH a 002H#45==c4HA5/4A88H&78 8!"8"2"#))C"68 8r;c tj|}t|trFtjtj |j ddjS|j ddjS)Nrr)rArBr5r6fsencodefsdecoderFlower)rKs r9r r Fsg  IIaL a ;;r{{1~55c4@FFHI Iyyd#))++r;c tj|}t|trd}d}d}nd}d}d}|ddj ||}|j |s|j |dry y ) N\/s:\rrz:\TF)rArBr5r6rF startswith)rKr$r' colon_seps r9r r Wsq) ! A!U   "1 fc"A ||CALLA6 r;c8tj|}t|trd}d}d}nd}d}d} |s|dd|zt |\}}}t tj|D]b}t |\} } } | r | s|s| }| }| }| r/| |k7r*| j |j k7r| }| }| }N| }|r |d|vr||z}|| z}d|r|s|r|dd||zvr||z|zS||z|zS#tttf$rtjd |g|wxYw) NrRr3:rr4:rr ) rArBr5r6rmaprP TypeErrorAttributeError BytesWarning genericpath_check_arg_types) r8pathsr$sepscolon result_drive result_root result_pathpp_drivep_rootp_paths r9r r ks_ 99T?D$! !HsN1:4. k;RYY&A&/l #GVV,#*L$ $ W 4==?l&8&8&::#*L"(K"(K& {2d:)C/ %.K+'.  \"#.edlB#% 3 3k)K77 ~| 4$$VT:E: sB/C,$C,,-Dc0 t|\}}}|||zfSN)r)rhdriveroottails r9r r s($"! E4 $+ r;c tj|}t|tr d}d}d}d}d}n d}d}d}d }d }|j ||}|dd |k(r||d d |k(ri|dd j |k(rd nd }|j ||}|dk(r|||fS|j ||d z} | dk(r|||fS|d| || | d z|| d zdfS||dd |d dfS|d d |k(r!|d d|k(r|dd |d d|ddfS|dd ||d dfS|||fS)NrRrSrY\\?\UNC\r;rrrZ\\?\UNC\rUr[rT)rArBr5r6rFupperfind) rhr$r'rd unc_prefixemptynormpstartindexindex2s r9rrs  ! A!U$ #  IIfc "E RayC 1: r*j8AaEJJsE*E{%&ZZUQY/F|%&Wf:q 3Qvz{^C C!BQ%12& & qu  1: Ra5!Aa&!AB%' 'Ra5%12& &eQr;c tj|}t|}t|\}}}t |}|r||dz |vr|dz}|r ||dz |vr|d|||d}}||z|j |z|fSNrU)rArBr:rlenrstrip)rhrcdriheadrps r9rrs! ! A  DlGAq! AA !A#d" Q !A#d"2A!"$D q54;;t$ $d **r;ctj|}t|trt j |dddSt j |dddS)NrRrS.rrr)rArBr5r6r` _splitextrhs r9rrsG ! A!U$$QtT::$$Qc377r;c t|dSrrrs r9rr s3 8A;r;c t|dS)Nrrrs r9rrs7 8A;r;st_reparse_tagc tj|}t |j tjk(S#tttf$rYywxYwNF) rAlstatOSError ValueErrorr^boolrstatIO_REPARSE_TAG_MOUNT_POINTr8sts r9r1r1sP/ $BB%%)H)HHII^4  s>AAc0 tj|yr)rArBr7s r9r1r1#s/ $r;c\ tj|}y#ttf$rYywxYw)NFT)rArrrrs r9rr+s5M XXd^  Z s ++)_getvolumepathnamec@ tj|}t|}t|}t |\}}}|r |d|vr| S|r|syt rL|j |}t |j |}|j|jk(Sy)NrTF)rArBr:r!rrrcasefold)r8rcrnrorestxys r9rrAs# 99T?D  D 4=D!$E4 qT!x D KK  d # * *4 0zz|qzz|++r;c: tj|}t|trd}nd}|j |s|Sdt |}}||kr+||t |vr|dz }||kr||t |vrdtjvrtjd}nEdtjvr|S tjd}t|tjd}|dk7rs|d|}t|trtj|}tjjd}||k7r%|t|k7r|Stt||}t|trtj|}|||dzS#t$rd}YwxYw) N~~rU USERPROFILEHOMEPATH HOMEDRIVErtUSERNAME)rArBr5r6rVrr:environKeyErrorr rOgetrrrN)r8tildernuserhomern target_user current_users r9rr^s0 99T?D$ ??5 ! c$iqA a%DG=#66 Q a%DG=#66 "::m, 2:: %  JJ{+Erzz*56Av1Qi k5 )++k2Kzz~~j1 , & x11 GH-{;H$;;x( d12h / E s7F FFc tj|}t|trPd|vrd|vr|Sddl}t|j |j zdzd}d}d}d}d}d}ttd d}nDd |vrd |vr|Sddl}|j |j zdz}d }d }d }d}d }tj}|dd} d} t|} | | kr|| | dz} | |k(r5|| dzd}t|} |j| } | | |d| dzzz } n| |k(r|| dz| dz|k(r | | z } | dz } n|| dzd}t|} |j|} |d| } |:tjtjtj| }n|| }| |z } n%| |k(r|| dz| dz|k(r | | z } | dz } n|| dz| dz|k(rr|| dzd}t|} |j|} |d| } |:tjtjtj| }n|| }| |z } n|dd} | dz } || | dz} | r| |vr| | z } | dz } || | dz} | r| |vr |:tjtjtj| }n|| }| |z } | r | dz} n| | z } | dz } | | kr| S#t$r| | |zz } | dz } Y&wxYw#t$r || z|z}YjwxYw#t$r| ||zz } | dz } YZwxYw#t$r||z| z|z}YwxYw#t$r| ||z|zz } | dz } YwxYw#t$r|| z}YwxYw)N$%rz_-ascii'{}environb$%'{}rUru)rArBr5r6string ascii_lettersdigitsgetattrrrr}rrNrOr)r8rvarcharsquotepercentbracerbracedollarrresr}pathlencvarvalues r9rrsM- 99T?D$ t D 0K-- =DgN"j$/ d?s$K''&--7$>** r(C E$iG '/ uQw  : #D$iG $ 1 q4 +++'\EAIeai(G3q E!GH~d)! JJw/E v,C8"?$&KK 2;;s;K0L$ME$+CLE5LC &[EAIeai(F2q eai *e3E!GH~d)! JJv.E v,C>"?$&KK 2;;s;K0L$ME$+CLE5LC2Ah uqy)AM1HCQJEU519-AAM) " BJJr{{37G,H I ' u QJE 1HC  W '/X JI $q4x!  $,$8 '#  78"(7T>)C#aKE(@$> & 4v =>"(6E>D00C#aKE(4 )"SLE)so4KLAK6)MAL*9AM#K32K36L  L L'&L'*MMM M #M43M4)_path_normpathc tj|}t|tr d}d}d}d}nd}d}d}d}|j ||}t |\}}}||z}|j |}d } | t|kr_|| r|| |k(r|| =n?|| |k(r2| d kDr|| d z |k7r|| d z | d z=| d z} n| d k(r|r|| =n | d z } n| d z } | t|kr_|s|s|j|||j|zS) NrRrSr..rrrrrrU) rArBr5r6rFrrrappendr ) r8r$r'r"r#rnroprefixcompsrs r9r r s6>yy dE "CFFFCFFF||FC(%dOtT 3 #e*n8uQx61!HqV#q5U1Q3Z61ac!A#gFA!VaFAQ#e*ne LL ''r;c tj|}t|sEt|trtj }ntj }t||}t|Srm) rArBr r5r6getcwdbgetcwdr r )r8cwds r9_abspath_fallbackr4sR 99T?D ; dE "**,C))+CC D>r;)_getfullpathnamecn tt|S#ttf$rt |cYSwxYwrm)rr rrrr7s r9r!r!Ls84 +#HTN3 3$ +$T* * +s 44)_getfinalpathnamereadlinkcxd}t}t||vro|jt| |}t|}t |s.t |s|} |St tt||}t||vro|S#t$r}|j|vrYd}~|Sd}~wt$rY|SwxYw)N) rUrurT 2CWi&i(i)) setr add _nt_readlinkr rr r rrwinerrorr)r8allowed_winerrorseenold_pathexs r9_readlink_deeprYsLutnD( HHXd^ $ #D)T{"(+' $D):D$ABDtnD(,  ;;"22     s)%B B B9B)(B)) B98B9cfd}|dd}|r t|}|r t||S|S|S#t$r{}|j|vr t |}||k7r|r t||n|cYd}~Sn#t$rYnwxYwt |\}}|r |s ||zcYd}~S|r t||n|}Yd}~nd}~wwxYw|r)N)rUrurTrrrr5Arr{iir)rr rrrr)r8rrprnew_pathnames r9_getfinalpathname_nonstrictrs$XBQx :(.+/tD$'9T9* ) :;;&66  .d3H4'7;tHd3I(#4[ d$;&+/tD$'T' : sN(( B,B'A' B,&B'' A30B'2A33B' B,B''B,F)strictct|}t|trId}d}d}tj}t |t tj tk(r7yd}d}d}tj}t |t tk(ry|j|}|st|s t||} t|}d }|sU|j|rD|j|r||t%|dz} n|t%|d} t| |k(r| }|S|S#t$r,}|rtt|dt|}Yd}~d}~wt$r$}|r|j }t#|}Yd}~d}~wwxYw#t$r }Yd}~|Sd}~wt$r}|j k(r| }Yd}~|Sd}~wwxYw) Ns\\?\rrs\\s\\.\NULz\\?\rsz\\z\\.\NULr)r r5r6rArr rNr)rrVr r rrrstrrrr) r8rrrynew_unc_prefixr had_prefixinitial_winerrorrspaths r9r*r*s~ dE "F(J$N**,C~"++g*>!??$F'J#N))+C~'!22#__V, %+T?D 5$T*D "doof5z*&c*o.>)??S[\* !$U+t3 D t I " c"g&D0D>D 5!{{ .t4D  5&    !;;"22 D  !sB D,F, F 5"E F (FF  G G*GGTcN tj|}t|trd}d}d}nd}d}d}||}|s t dtj|} t t |}t t |}t|\}}} t|\} }} t|t| k7rt d| d || j|D cgc]} | s|  } } | j|D cgc]} | s|  }} d }t| |D]#\}}t|t|k7rn|d z }%|gt| |z z||dz}|s|St|Scc} wcc} w#ttttt f$rt#j$d ||wxYw) NrRrrrrrzno path specifiedzpath is on mount z, start on mount rrUr,)rArBr5r6rr!r rr rziprr r]r^r_DeprecationWarningr`ra)r8r|r$r"r# start_abspath_abs start_drive_ start_rest path_drive path_restr start_list path_listre1e2rel_lists r9r,r,s- 99T?D$ } ,-- IIe EHUO, 8D>*%.y%9" Q #,X#6 Ay K HZ$8 8K)* *",!1!1#!6BE-E#$E#(E-=E(E( AE-E-# E--7F$c b |s tdtttj|}t |dt rd}d}d}nd}d}d} |Dcgc]+}t|j||j-}}|Dcgc]\}}}|j|}}}}t|Dchc]\}}}| c}}}d k7r td t|Dchc]\}}}| c}}}d k7r td t|dj||\} } } | j|} | D cgc] } | s| |k7s | } } |D cgc]}|D cgc] } | s| |k7s | c} }}} t|}t|}t|D]\}} | ||k7s| d|} n| dt|} | | z|j| zScc}wcc}}}wcc}}}wcc}}}wcc} wcc} wcc} }w#t t"f$rt%j&d g|wxYw) Nz%commonpath() arg is an empty sequencerrRrSrrrrrUz%Can't mix absolute and relative pathszPaths don't have the same driver0)rtupler\rArBr5r6rrFrPrrminmax enumerater r]r^r`ra)rbr$r'r"rh drivesplitsrr split_pathsrnror8commonrrKs1s2rs r9r0r0.s.N @AA #bii' (E%(E"JOP%Qy63!7!=!=!?@% P3>?;1aqwws|; ? -gaA- .! 3DE E -gaA- .! 3>? ?%eAh&6&6vs&CDtTC#9VqQ&[!V9DOPKq1:1aa6k1:K P    bMDAqBqEz" HSW%Ft|chhv...5Q?- . ::P ~ &$$\:E: sH0GHG"+H: G) "H) G0 6AHG7 G7G7H H&G< .G< 4G< 8H=2H0,HH<HH'H.) _path_isdir) _path_isfile) _path_islink) _path_exists)_path_isdevdrivecL tt|S#t$rYywxYwr)rr!rr7s r9 isdevdriverts+N #GDM2 2  s  ##c yrr7s r9rrosNr;rm)Br"r#r(r$r%r'r&r)rArCrr`__all__r:_winapir<rGr=rHr>rIr ImportErrorr r r rrrr__doc__rrhasattr stat_resultr1rntrrrrrr rrr!rrrrrr*r+r,r0rrrrrrrrrrrr;r9r#s          O!,-- 8H(+b.1r +*8 ((00  2>>+,J$%:-zj`&(-P" +# +]> (T/b"'<@"+p.b  ())) #_ ,, ,t^#("(#(t G Hd  s} C2 DD 'D1D(D5(E2C=<C=D  D  DDD%$D%(D21D25D=<D=E  E