+
    KiS8  c                   s|   R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHtHtHtH	t	H
t
Ht ]t ! R R]4      t ! R R4      t/ tR tR6R	 ltR6R
 ltR6R ltRt]P.                  P1                  R4      ;'       g    ]P.                  P1                  R4      ;'       gb    ]P.                  P1                  R4      ;'       g?    ]P.                  P1                  R4      ;'       g    ]P.                  P1                  R4      t]'       d   ]P4                  ! ]4      t]'       d   ]P6                  '       g   . R7OtRRR.]P                  ! R4      ,           R]R]RR./t]P<                  P?                  R4      '       d   RM]P<                  t]PA                  ]. 4       F  t ]P4                  ! ]4      t M	  ]'       d   ]P6                  '       g	   ]"! R4      h]P                  t#R t$R t%R t&R t']PP                  t(]#](n)        ]	.](n*        ]PV                  t+R]+n)        ]#.]+n*        ]PX                  t,]],n)        ]#.],n*        ]PZ                  t-]	]-n)        ]#.]-n*        ]P\                  t/]]/n)        ]#].]/n*        ]$]/n0        R t.]Pb                  t2]]2n)        ]#]]
.]2n*        ]$]2n0        R t1]Pf                  t4]]4n)        ]#]	.]4n*        ]$]4n0        R  t3]Pj                  t6]	]6n)        ]#].]6n*        ]%]6n0        R! t5]Pn                  t7]	]7n)        ]#]	.]7n*        ]Pp                  t8]	]8n)        ]#].]8n*        ]Pr                  t9]	]9n)        ]#].]9n*        Rt:];! ]R"4      '       df   ];! ]R#4      '       dW   R$t:]Px                  t=]	]=n)        ]#]	]! ]
4      .]=n*        ]%]=n0        ]P|                  t?]	]?n)        ]#]	]! ]
4      .]?n*        ]%]?n0        R% t<R& t>Rt@];! ]R'4      '       d   R$t@]P                  tA]	]An)        . ]An*        R( tB^ tC^tD^tE^tF^tG^tHR)tI^tJR*tK^ tL^@tM^tNR+tOR,tPR-tQR.tRR/tSR0tTR1tUR2tVR3tWR4tXR5tY^ tZ^t[^t\^t]^t^^t_^t`R#   ]! d     EK  i ; i)8a  
magic is a wrapper around the libmagic file identification library.

See https://github.com/ahupp/python-magic for more information.

Usage:

>>> import magic
>>> magic.from_file("testdata/test.pdf")
'PDF document, version 1.2'
>>> magic.from_file("testdata/test.pdf", mime=True)
'application/pdf'
>>> magic.from_buffer(open("testdata/test.pdf").read(1024))
'PDF document, version 1.2'
>>>

N)POINTERbyrefc_char_pc_intc_size_tc_void_pc                   s2   a a ] tR t^t oV 3R ltRtVtV ;t# )MagicExceptionc                s2   < \         SV `  V4       Wn        R # N)Zsuper__init__message)selfr	   	__class__s   &&6/usr/lib/python3.14/site-packages/lutris/util/magic.pyr   ZMagicException.__init__    s    !    )r	   )__name__
__module____qualname____firstlineno__r   __static_attributes____classdictcell__Z__classcell__)r   __classdict__s   @@r   r   r      s      r   r   c                   sX   a  ] tR t^%t o RtRR ltR tR tR tR t	R t
R	 tR
 tRtV tR# )Magicz3
Magic is a wrapper around the libmagic C library.
Nc                sD   RV n         \        V n        V'       d   V ;P                  \        ,          un        V'       d   V ;P                  \        ,          un        V'       d   V ;P                  \
        ,          un        V'       d   V ;P                  \        ,          un        V'       d   V ;P                  \        ,          un        V'       d   V ;P                  \        ,          un        \        V P                  4      V n         \        P                  ! 4       V n        \        V P                   V4       V'       d'   \        '       d   \        4       R8  d   \!        R4      h\"        '       d    V P%                  \&        ^@4       R# R#   \(         d     R# i ; i)a  
Create a new libmagic wrapper.

mime - if True, mimetypes are returned instead of textual descriptions
mime_encoding - if True, codec is returned
magic_file - use a mime database other than the system default
keep_going - don't stop at the first match, keep going
uncompress - Try to look inside compressed files.
raw - Do not try to decode "non-printable" chars.
extension - Print a slash-separated list of valid extensions for the file type found.
Ni  z<MAGIC_EXTENSION is not supported in this version of libmagic)cookie
MAGIC_NONEflagsMAGIC_MIME_TYPEMAGIC_MIME_ENCODINGMAGIC_CONTINUEMAGIC_COMPRESS	MAGIC_RAWMAGIC_EXTENSION
magic_open	threadingZLocklock
magic_load_has_versionversionNotImplementedError
_has_paramsetparamMAGIC_PARAM_NAME_MAXr   )r
   mime
magic_fileZmime_encodingZ
keep_goingZ
uncompressZrawZ	extensions   &&&&&&&&r   r   ZMagic.__init__*   s    , 
JJ/)JJJ--JJJ.(JJJ.(JJJ)#JJJ/)J ,NN$	4;;
+ llgi#o%&dee :2B7  "  s   6F FFc                s~   V P                   ;_uu_ 4         \        V\        4      '       d#   \        \        8w  d   VP	                  RRR7      p\        \        V P                  V4      4      uuRRR4       #   \         d&   pT P                  T4      u Rp?uuRRR4       # Rp?ii ; i  + '       g   i     R# ; i)z 
Identify the contents of `buf`
utf-8Zreplace)ZerrorsN)
r!   
isinstancestrbytesencodemaybe_decodemagic_bufferr   r   _handle509Bug)r
   bufe   && r   from_bufferZMagic.from_bufferg   s     YYY- c3''C5L**WY*?C#Lc$BC Y " -))!,, Y- YYs5   B+AA88B(B#B(B+#B((B++B<	c                sn   \        V4      ;_uu_ 4         R R R 4       V P                  ;_uu_ 4         \        \        V P                  V4      4      uuR R R 4       #   + '       g   i     LO; i  \
         d&   pT P                  T4      u R p?uuR R R 4       # R p?ii ; i  + '       g   i     R # ; ir   )
_real_openr!   r0   r*   r   r   r2   )r
   filenamer4   r5   r   	from_fileZMagic.from_filev   s{    !! " YYY-#Jt{{H$EF Y "! " -))!,,	 Y- YYs?   AB#A0A-	0B ;BB B#B  B##B4	c                s   V P                   ;_uu_ 4         \        \        V P                  V4      4      uuR R R 4       #   \         d&   pT P                  T4      u R p?uuR R R 4       # R p?ii ; i  + '       g   i     R # ; ir   )r!   r0   magic_descriptorr   r   r2   )r
   fdr4   r5   r   from_descriptorZMagic.from_descriptor   s_    YYY-#$4T[["$EF Y " -))!,,	 Y- YYs4   A3A  A0A+A0A3+A00A33B	c                s`    VP                   f    V P                  \        ,          '       d   R# Vh)Nzapplication/octet-stream)r	   r   r   )r
   r4      &&r   r2   ZMagic._handle509Bug   s$     99$**">">-r   c                s.    \        V P                  W4      # r   )magic_setparamr   )r
   paramvals   &&&r   r'   ZMagic.setparam   s    dkk566r   c                s.    \        V P                  V4      # r   )magic_getparamr   )r
   r?   r=   r   getparamZMagic.getparam   s    dkk511r   c                s    V P                   '       d-   \        '       d   \        V P                   4       R V n         R # R # R # r   )r   magic_close)r
      &r   __del__ZMagic.__del__   s+     ;;;;;$DK ';r   )r   r   r!   )FNFFFFF)r   r   r   r   __doc__r   r6   r9   r<   r2   r'   rB   rE   r   r   )r   s   @r   r   r   %   s8     ;z-	--72 r   r   c                 sb    \         P                  V 4      pVf   \        V R7      ;p\         V &   V# )N)r)   )
_instancesgetr   )r)   Zis   & r   _get_magic_typerI      s.    tAy$$//JtHr   Fc                :    \        V4      pVP                  V 4      # )z"
Accepts a filename and returns the detected filetype.  Return
value is the mimetype if mime=True, otherwise a human readable
name.

>>> magic.from_file("testdata/test.pdf", mime=True)
'application/pdf'
)rI   r9   )r8   r)   mr5   r   r9   r9      s     	A;;x  r   c                rJ   )z
Accepts a binary string and returns the detected filetype.  Return
value is the mimetype if mime=True, otherwise a human readable
name.

>>> magic.from_buffer(open("testdata/test.pdf").read(1024))
'PDF document, version 1.2'
)rI   r6   )Zbufferr)   rK   r5   r   r6   r6      s     	A==  r   c                rJ   )z
Accepts a file descriptor and returns the detected filetype.  Return
value is the mimetype if mime=True, otherwise a human readable
name.

>>> f = open("testdata/test.pdf")
>>> magic.from_descriptor(f.fileno())
'PDF document, version 1.2'
)rI   r<   )r;   r)   rK   r5   r   r<   r<      s     	AR  r   ZmagicZmagic1z
cygmagic-1z
libmagic-1zmsys-magic-1Zdarwinz/opt/local/lib/libmagic.dylibz/usr/local/lib/libmagic.dylibz//usr/local/Cellar/libmagic/*/lib/libmagic.dylibZwin32ZcygwinZlinuxzlibmagic.so.1z1failed to find libmagic.  Check your installationc                 sH    V f   \        V^ ,          4      p\        V4      hV # r   magic_errorr   ZresultZfuncZargsZerr   &&& r   errorcheck_nullrP      s%    ~$q'"S!!Mr   c                 sN    V R8X  d   \        V^ ,          4      p\        V4      hV # )i   irL   rN   rO   r   errorcheck_negative_onerQ     s'    |$q'"S!!Mr   c                 sH    \         \        8X  d   V # V P                  R R4      # )r+   Zbackslashreplace)r-   r.   Zdecode)ZsrD   r   r0   r0     s"    
e| 88G/00r   c                 sb    V f   R # \        V \        4      '       d   V P                  RR4      # V # )Nr+   Zsurrogateescape)r,   r-   r/   )r8   rD   r   coerce_filenamerR     s1    
 (C  w(9::Or   c                 ,    \        V \        V4      4      # r   )_magic_filerR   r   r8   r=   r   r*   r*   >      vx899r   c                 s,    \        W\        V4      4      # r   )_magic_bufferZlen)r   r3   r=   r   r1   r1   H  s    c#h//r   c                 s    \        W4      # r   )_magic_descriptor)r   r;   r=   r   r:   r:   R  s    V((r   c                 rS   r   )_magic_loadrR   rU   r=   r   r"   r"   \  rV   r   r>   rA   Tc                 sp    \         '       g   \        R 4      h\        V4      p\        W\	        V4      4      # )zmagic_setparam not implemented)r&   r%   r   _magic_setparamr   )r   r?   r@   ZvrO   r   r>   r>   z  s-    :!"BCCA6%(33r   c                 s    \         '       g   \        R 4      h\        4       p\        W\	        V4      4       VP
                  # )zmagic_getparam not implemented)r&   r%   r   _magic_getparamr   Zvalue)r   r?   r@   r5   r   rA   rA     s2    :!"BCC
*CF5:.99r   magic_versionc                  sD    \         '       g   \        R 4      h\        4       # )zmagic_version not implemented)r#   r%   r\    r   r   r$   r$     s    <!"ABB?r   i   i   i   i   i   i    i @  i   i   i   i   i   i   )F)z
magic1.dllzcygmagic-1.dllzlibmagic-1.dllzmsys-magic-1.dll)arF   ZctypesZctypes.utilZglobZsysr    r    r   r   r   r   r   Zopenr7   Z	Exceptionr   r   rG   rI   r9   r6   r<   ZlibmagicZutilZfind_libraryZdllZCDLLZ_nameZwindows_dllsZplatform_to_libZplatformZ
startswithrH   ZOSErrorZImportErrorZmagic_trP   rQ   r0   rR   r   ZrestypeZargtypesrC   rM   Zmagic_errnor*   rT   Zerrcheckr1   rW   r:   rX   r"   rY   Zmagic_setflagsZmagic_checkZmagic_compiler&   Zhasattrr>   rZ   rA   r[   r#   r\   r$   r   ZMAGIC_DEBUGZMAGIC_SYMLINKr   ZMAGIC_DEVICESr   r   Z
MAGIC_MIMEr   r   ZMAGIC_CHECKZMAGIC_PRESERVE_ATIMEr   ZMAGIC_ERRORZMAGIC_NO_CHECK_COMPRESSZMAGIC_NO_CHECK_TARZMAGIC_NO_CHECK_SOFTZMAGIC_NO_CHECK_APPTYPEZMAGIC_NO_CHECK_ELFZMAGIC_NO_CHECK_ASCIIZMAGIC_NO_CHECK_TROFFZMAGIC_NO_CHECK_FORTRANZMAGIC_NO_CHECK_TOKENSZMAGIC_PARAM_INDIR_MAXr(   ZMAGIC_PARAM_ELF_PHNUM_MAXZMAGIC_PARAM_ELF_SHNUM_MAXZMAGIC_PARAM_ELF_NOTES_MAXZMAGIC_PARAM_REGEX_MAXZMAGIC_PARAM_BYTES_MAXr]   r   r   <module>r^      s  $    
  F F 
Y ~ ~B 

!
!!  KKW% 0 0{{)0 0{{-0 0 {{-0 0 {{/  {{3Hx~~~YL24ST
))E
FG 	,/"O ,,11'::wH""8R0	{{3'H 1 x~~~
I
JJ
//1	   

 g
 "" y "" y "" y  !! * & : %%  !8X6 ( 0 -- $  %u-  ,  ) !! * . : (( "E* "" * && !8, 

8%&&78=M+N+NJ--O#O '0ABO6O--O#O '0ABO6O4 
8_%%L**M!MM 
  
 	"   !    !          G  		s   P//P;:P;