+
    & i1  c                   sB   ^ RI t ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIH	t	H
t
Ht ^ RIHt ^ RIHt ^ RIHtHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHt ^ RIHtHtHtH t  ^ RI!H"t# ^ RI$H%t%H&t& ^ RI'H(t( ^ RI)H*t* ^ RI+H,t, ^ RI-H.t.H/t/H0t0H1t1 ^ RI2H3t3 ]R R l4       t4]R R l4       t5]R R l4       t6]R R l4       t7R R lt8R R  lt9R5R! R" llt:]R# R$ l4       t;R6R% R& llt<R7R' R( llt=]R) R* l4       t>]R+ R, l4       t?]/3R- R. llt@R/ R0 ltA]03R1 R2 lltBR3R8/R4 ltCR# )9i    N)	Generator)contextmanagerfind_library)LOCK_EXLOCK_UNflock)cache)new)BufferedIOBaseBufferedRandomPath)Pattern)compile)which)PIPESTDOUTPopenTimeoutExpired)open)
gettempdirmkdtemp)Any)BaseHTTPResponse)display)	TMPFS_MIN	UMU_CACHE	UMU_LOCALWINETRICKS_SETTINGS_VERBS)logc                $    V ^8  d   QhR\         /# )   pathstrZformat   "1/usr/lib/python3.14/site-packages/umu/umu_util.py__annotate__r'      s      S     c              #  sj  "   Rp \         P                  ! V \         P                  \         P                  ,          R4      p\	        V\
        4       Vx  Ve)   \	        V\        4       \         P                  ! V4       R# R#   Te(   \	        T\        4       \         P                  ! T4       i i ; i5i)z-Create a file and configure it to be locking.Ni  )osr   ZO_CREATZO_WRONLYr   r   r   close)r!   fd   & r&   
unix_flockr-      s}      BWWT2::3U;b'>"gHHRL 2>"gHHRL s   B3AB .B3-B00B3c                sT    V ^8  d   QhR\         R\        \        \        R3,          /# )r    namereturnN)r#   r    r
   r   r$   r%   r&   r'   r'   +   s&      C Inc4&?@ r(   c              #  s$  "   Rp \         P                  ! V \         P                  4      p\         P                  ! VR4       \         P                  ! VRR7      pVx  Ve   VP                  4        R# R#   Te   TP                  4        i i ; i5i)zCreate an anonymous file.NTzrb+)mode)r)   Zmemfd_createZMFD_CLOEXECZset_inheritableZfdopenr*   )r.   Zfpr+   s   &  r&   	memfdfiler1   *   sp      !%B__T2>>2
2t$YYr&>HHJ 2>HHJ s   BAA6 B6BBc                r   r    r/   r"   r$   r%   r&   r'   r'   :   s     # ## #r(   c                 s,    \        R4      ;'       g    R# )z$Find libc.so from the user's system.Zc r    r(   r&   get_libcr5   9   s     """r(   c                :    V ^8  d   QhR\         \        ,          /# r2   setr#   r$   r%   r&   r'   r'   @   s     ( (3s8 (r(   c            
     s   \        4       p \        4       p\        R4      ;'       g    RpRpV'       g   \        P                  ! R4       V #  \	        VR3RR\
        RR	R
R	/R7      ;_uu_ 4       pVP                  '       g   V uuRRR4       # VP                   F  pVP                  4       pV'       g   K  VR,          pVRVP                  V4       pVP                  V4      '       d   Wq9   d   KY  VP                  V4       V P                  \        P                  P                  V4      4       K  	  RRR4       V #   + '       g   i     T # ; i  \         d"   p\        P                  ! T4        Rp?T # Rp?ii ; i)z5Find the shared library paths from the user's system.ldconfigr3   Z/z6ldconfig not found in $PATH, cannot find library pathsz-pTutf-8ZLC_ALLZCZLANG)ZtextencodingstdoutZenvN)r8   r   r   warningr   r   r<   splitZrfindZ
startswithZaddr)   r!   ZrealpathZOSErrorZ	exception)	Zlibrary_pathsZpathsr9   ZrootproclinelinesprefixZes	            r&   get_library_pathsrD   ?   sP    "eMeE*%++HDLM t3,
 
 ;;;$
 
 

Ry0

4 01t,,		&!!!"''"2"26":; $
, -
 
,   asC   "E /E 
E B(E 6E  E	E E F E;;F c                s^    V ^8  d   QhR\         R\        \         ,          R\         R\        /# )r    commandoptsmsgr/   )r#   listintr$   r%   r&   r'   r'   k   s,     4 4 449 43 43 4r(   c                s.   \        R4      ;'       g    Rp\        V 4      ;'       g    Rp^ pV'       g   \        P                  ! R4       R# V'       g   \        P                  ! RV 4       R# \        V.VO\        \
        R7      ;_uu_ 4       p\        V RRRV 2R	R
R.\        R7      ;_uu_ 4       p VP                  RR7       TP                  '       d   TP                  P                  4        TP                  4       pRRR4       RRR4       T'       d   \        P                  ! RT4       T#   \         d/    TP                  4        \        P                  ! RT4       \        hi ; i  + '       g   i     Lu; i  + '       g   i     L; i)zExecute the command and pipe the output to zenity.

Intended to be used for long running operations (e.g. large file downloads)
zenityr3   zzenity was not found in systemz%s was not found in system)r<   Zstderrz
--progressz--auto-closez--text=z--percentage=0z	--pulsatez--no-cancel)stdini,  )Ztimeoutz%s timed out after 5 min.Nz&zenity exited with the status code: %sr=   )r   r   r>   r   r   r   Zwaitr   Z	terminateZTimeoutErrorrK   r*   )rE   rF   rG   rJ   ZcmdZretr@   Zzenity_procs   &&&     r&   
run_zenityrL   k   s_   
 /''RFW~##CC45	0':	 	L4L	
 	
 (#  
 
 #		#	&    !!'')""$C-
	
< <cBJ " #%%'7=""#
 
	
 	
sB   %F4E1	6D5E1	*E1	F59E..E1	1F<FF	c                sR    V ^8  d   QhR\         \        ,          R\        R\        /# )r    verbpfxr/   )rH   r#   r   boolr$   r%   r&   r'   r'      s%        DI  D  T  r(   c                s   RpV'       g   RV R2p\        V4      hV '       g   Rp\        V4      hVP                  R4      p\        V 4      pVP	                  4       '       g   V# VP                  RRR7      ;_uu_ 4       pV FI  pVP                  4       pWu9   g   K  V\        9  g   K(  R	pR
V RV R2p\        P                  ! V4        M	  RRR4       V#   + '       g   i     T# ; i)zCheck if a winetricks verb is installed in the umu prefix.

Determines the installation of verbs by reading winetricks.log file.
Fz
Value is 'z' for WINE prefixz#winetricks was passed an empty verbzwinetricks.logrr:   r0   r;   Tzwinetricks verb 'z' is already installed in ''N)
ZFileNotFoundError
ValueErrorZjoinpathr8   is_filer   Zstripr   r   error)rM   rN   Zis_installederrZwt_logverbsfilerA   s   &&      r&   is_installed_verbrY      s     Lu$56$$8o\\*+FIE>>	#	0	0DD

D}-F!F#.tf4OPSuTUV		#  
1  
1	0 s    CC+%CC+	c                sR    V ^8  d   QhR\         \        ,          R\        R\        /# )r    rW   patternr/   )rH   r#   rO   r$   r%   r&   r'   r'      s(      9"	r(   c                s    V '       g   R# \        V4      pV  F9  pVP                  V4      '       d   K  RV R2p\        P                  ! V4        R# 	  R# )z'Check if a string is a winetricks verb.Fz!Value is not a winetricks verb: 'rR   T)
re_compileZmatchr   rU   )rW   rZ   ZregexrM   rV   s   &&   r&   is_winetricks_verbr\      sP      wE{{4  :4&BCIIcN	  r(   c                r   )r    nor"   r$   r%   r&   r'   r'      s     	 	 	r(   c              #  s   "   Rp \         P                  ! V 4      pVx  Ve   VP                  4        R# R#   Te   TP                  4        i i ; i5i)zCreate a Display.N)r   ZDisplayr*   )r]   Zdr,   r&   xdisplayr^      sJ      !%AOOB=GGI 1=GGI s   A8 AAAc                sR    V ^8  d   QhR\         R\        \        ,          R\        /# )r    r!   resp
chunk_size)r   r	   r   rI   r$   r%   r&   r'   r'      s,      

+
+
 r(   c                s>   V'       g   Rp\        V4      p\        V4      pV P                  R^ R7      ;_uu_ 4       pVP                  V4      ;p'       d+   VP	                  VRV 4       VP                  VRV 4       KC   RRR4       V#   + '       g   i     T# ; i)a  Write a file to path in chunks from a response stream while hashing it.

Args:
    path: file path
    resp: urllib3 response streamed response
    hasher: hashlib object
    chunk_size: max size of data to read from the streamed response
Returns:
    hashlib._Hash instance

zab+)r0   Z	bufferingN   )	bytearray
memoryviewr   readintoZwriteupdate)r!   r_   Zhasherr`   ZbufferviewrX   sizes   &&&&    r&   write_file_chunksrh      s    * 
z"FfD		+	+tmmF++d+JJtET{#MM$u+& , 
,
 M 
,	+
 Ms   B*BB	c                s    V ^8  d   QhR\         R\        R,          R\        R\        \        \        ,          \
        R3,          /# )r    r!   sepNmaxsplitr/   )r   r#   rI   r    rH   r   r$   r%   r&   r'   r'     s@     = =
=4Z=+.=tCy#t#$=r(   c              #   s   aa"   V P                  R RR7      ;_uu_ 4       p\        VV3R lV 4       4      pR V 4        Rj  xL
  RRR4       R#  L  + '       g   i     R# ; i5i)rP   r:   rQ   c              3   sH   <"   T F  qP                  SSR 7      x  K  	  R# 5i))ri   rj   N)r?   ).0rA   rj   ri      & r&   	<genexpr>#_get_lines_split.<locals>.<genexpr>  s     MZZC(Z;;s   "c              3   s8   "   T F  q'       g   K  Vx  K  	  R # 5i)Nr4   )rk   Zcolumnsr,   r&   rm   rn     s     <5GGG5s   	
N)r   Ziter)r!   ri   rj   rX   rB   s   &ff  r&   _get_lines_splitro     sQ      
g	.	.$MMM<5<<< 
/	.< 
/	.	.s.   A(#AAA
A(AA%		A(c                r6   r2   r7   r$   r%   r&   r'   r'     s     W W3s8 Wr(   c                  sd    \        \        R 4      R^4       U u0 uF  q R,          kK  	  up # u up i )z/proc/filesystemsNr=   )ro   r   )rA   s    r&   _get_supported_fsrp     s2     "2$7J2KTST!UV!UHH!UVVVs   -c                s<    V ^8  d   QhR\         R\        R\        /# )r    r!   
filesystemr/   )r   r#   rO   r$   r%   r&   r'   r'     s&     S ST Ss St Sr(   c                s  aa S\        4       9  d   \        P                  ! RS4       R# \        \	        R4      R^4      p\        V 4      o\        ;QJ d     VV3R lV 4       F  '       g   K   R# 	  R# ! VV3R lV 4       4      # )z#Validate the file system of a path.z-Path is not a supported Linux file system: %sFz/proc/mountsNc              3   sf   <"   T F&  q^,          S8X  g   K  V^,          S8X  g   K"  Vx  K(  	  R# 5i)i   Nr4   )rk   rA   dstrq   rl   r&   rm   Z_fsck_path.<locals>.<genexpr>"  s(     RaCtDGz<Qtts   11
1T)rp   r   rU   ro   r   r#   any)r!   rq   rB   rr   s   &f @r&   
_fsck_pathrt     sj     *,,		A:N T.14;E
d)C3RR33R3R3RRRRr(   c                s0    V ^8  d   QhR\         R\         /# )r    r   r/   r   r$   r%   r&   r'   r'   %  s     V Vt VD Vr(   c                s^   \        \        4       4      pV\         P                  ! 4       8X  d   T p\        P                  ! V4      p\        VR4      ;'       d%    VP                  VP                  ,          \        8  pV'       d   \        \        4       4      # \        \        RV R7      4      # )a?  Get a path to a temporary directory on a tmpfs.

The temporary directory is created securely, and the path returned may be
on a tmpfs. For a temporary directory to be on a tmpfs, the destination
mount point must be >= TMPFS_MIN. Otherwise, file system at $XDG_CACHE_HOME
will be used to create the temporary directory.
Ztmpfs.)rC   Zdir)
r   r   Zcwdr)   Zstatvfsrt   Zf_frsizeZf_blocksr   r   )r   ZtmpdirZstatZhas_tmpfs_mins   &   r&   get_tempdirrv   %  s}     *,F ::fD67#RR(E(R 
 ,4	?UgSe6T1UUr(   c                sJ    V ^8  d   QhR\         R\         R\         R,          /# )r    r!   destr/   Nr   r$   r%   r&   r'   r'   =  s%      $ d td{ r(   c                s,   V P                  4       '       g   R# \        V RV P                  P                  R4       24      ;_uu_ 4       p ^ RIHp W2n        \        P                  ! R4       \        P                  ! R	W4       VP                  VR
7       RRR4       V#   \         dU    \        P                  ! R\        P                  4       \        P                  ! R4       \        P                  ! R4        Li ; i  + '       g   i     T# ; i)a  Read and securely extract a compressed TAR archive to path.

Warns the user if unable to extract the archive securely, falling
back to unsafe extraction. The filter used is 'tar_filter'.

See https://docs.python.org/3/library/tarfile.html#tarfile.tar_filter
Nzr:ru   )
tar_filterzUsing data filter for archivez
Python: %sz Using no data filter for archivez$Archive will be extracted insecurelyzExtracting: %s -> %sr!   )rT   taropenZsuffixZremoveprefixtarfilerx   Zextraction_filterr   ZdebugZImportErrorr>   sysZversionZ
extractall)r!   rw   Ztarrx   s   &&  r&   extract_tarfiler}   =  s     <<>> 
DKK44S9:;	<	<
	@*$.!II56 			($5D! 
=  K  	@KKckk2KK:;KK>?		@ 
=	<  Ks1   	D"B -)D AC?<D>C??DD	c                s0    V ^8  d   QhR\         R\        /# )r    r!   r/   )r   rO   r$   r%   r&   r'   r'   ]  s       T r(   c                s    V P                  4       ;'       dS    \        ;QJ d+    R V P                  R4       4       F  '       g   K   R# 	  R# ! R V P                  R4       4       4      # )z5Check if umu has been setup in our runtime directory.c              3   sj   "   T F)  qP                   P                  R 4      '       d   K%  Vx  K+  	  R# 5i)ZlockN)r.   Zendswith)rk   rX   r,   r&   rm   Z has_umu_setup.<locals>.<genexpr>_  s$      !'yy/A/A&/Is   "3
3Z*TF)Zexistsrs   Zglobry   s   &r&   has_umu_setupr~   ]  s_    ;;=  SS !3!SS S S !3!  r(   _bufsizec              s   \        V\        4      '       d   \        V4      MV! 4       p\        V R4      '       d"   VP	                  V P                  4       4       V# \        V R4      '       d)   \        V R4      '       d   V P                  4       '       g   RV : R2p\        V4      h\        V4      p\        V4      p V P                  V4      pV^ 8X  d    V# VP	                  VRV 4       K2  )a  Hash the contents of a file-like object. Returns a digest object.

*fileobj* must be a file-like object opened for reading in binary mode.
It accepts file objects from open(), io.BytesIO(), and SocketIO objects.
The function may bypass Python's I/O and use the file descriptor *fileno*
directly.

*digest* must either be a hash algorithm name as a *str*, a hash
constructor, or a callable that returns a hash object.
	getbufferrd   readablerR   z3' is not a file-like object in binary reading mode.N)Z
isinstancer#   hashnewZhasattrre   r   r   rS   rb   rc   rd   )ZfileobjZdigestr   Z	digestobjrV   Zbufrf   rg   s   ""$     r&   file_digestr   h  s     $.fc#:#:Iw$$**,- 	$$GZ(('OPo H
Cc?D
$19  	et%r(   )z ^[a-zA-Z_0-9-]+(=[a-zA-Z0-9]*)?$)ra   )r=   i   )Dr)   r|   Zcollections.abcr    Z
contextlibr   Zctypes.utilr   Zfcntlr   r   r   Z	functoolsr   Zhashlibr   r   Zior	   r
   Zpathlibr   Zrer   r   r[   Zshutilr   Z
subprocessr   r   r   r   r{   r   rz   Ztempfiler   r   Ztypingr   Zurllib3.responser   ZXlibr   Zumu.umu_constsr   r   r   r   Zumu.umu_logr   r-   r1   r5   rD   rL   rY   r\   r^   rh   ro   rp   rt   rv   r}   r~   r   r4   r(   r&   <module>r      s!   	 
 % % $ ) )  " -   $  : : # (  -  U U      # #
 ( (V4n F( 	 	D= W W
 S S ( V0@  ) ' 'r(   