+
    Kiw  c                   sP    R t ^ RIt^ RIHtHt ^ RIHt R tR	R ltR t	R t
R tR# )
z2Automatically detects game executables in a folderN)magicsystem)loggerc                    a RpV P                  4       o\        ;QJ d    V3R lV 4       F  '       g   K   R# 	  R# ! V3R lV 4       4      # )xdg-openc              3   ,   <"   T F	  qS9   x  K  	  R # 5iN .0Zexclude_fn   & </usr/lib/python3.14/site-packages/lutris/util/game_finder.py	<genexpr>Z"is_excluded_elf.<locals>.<genexpr>        6X'#~X   TF)r   Z	uninstallZloweranyZfilenameexcludedr
      & @r   is_excluded_elfr   	   s=    (H
..
C36X63363636X666    c                s   \         P                  ! V 4       EFT  w  r#p/ pV F  p\        V4      '       d   K  \         P                  P	                  W&4      p\
        P                  ! V4      pRV9   d   WuR&   RV9   d   WuR&   RV9   d   WuR&   RV9   g   RV9   d   WuR	&   R
V9   g
   RV9   g   K  WuR&   K  	  V'       g   K  V'       d.   VP                  4        F  p	\        P                  ! V	4       K  	  VP                  R4      ;'       g]    VP                  R4      ;'       gD    VP                  R4      ;'       g+    VP                  R	4      ;'       g    VP                  R4      u # 	  \        P                  ! RV 4       R# )zHLooks for a binary or shell script that launches the game in a directoryzASCII text executableZshellzBourne-Again shell scriptZbashzPOSIX shell script executableZposixz64-bit LSB executablez64-bit LSB shared object64bitz32-bit LSB executablez32-bit LSB shared object32bitz&Couldn't find a Linux executable in %s )oswalkr   pathjoinr    	from_fileZvaluesr   make_executablegetr   error)
r   r   base_dirsfiles
candidates_fileabspath	file_typeZ	candidates
   &&        r   find_linux_game_executabler)      sh    !ggdmU
Eu%%ggll4/G0I&)3&-7#*i7%,6".);&-7#&)37QU^7^&-7#&)37QU^7^&-7#  :!+!2!2!4I**95 "5 w' + +>>&)+ +>>'*+ + >>'*+ + >>'*+ ,8 LL94@r   c                 s   a Ro\         ;QJ d.    V3R lV P                  R4       4       F  '       g   K   R# 	  R# ! V3R lV P                  R4       4       4      # )Internet Explorerc              3   r   r   r   )r	   Zdir_namer   r   r   r   Z"is_excluded_dir.<locals>.<genexpr>=   s     DO8#Or   Z/TF)r*   z
Windows NTzCommon FileszWindows Media PlayerZwindowsZProgramDataZuserszGameSpy Arcade)r   Zsplit)r   r   s   &@r   is_excluded_dirr+   2   sE    	H 3DDJJsOD33D3D3DDJJsODDDr   c                 r   )unins000c              3   r   r   r   r   r   r   r   Z"is_excluded_exe.<locals>.<genexpr>K   r   r   TF)r,   ZuninstalZupdateZsetupz
config.exezgsarcade.exez
dosbox.exer   r   r   r   is_excluded_exer-   @   sA    H ..
C36X63363636X666r   c           	      sR   \         P                  ! V 4       EFe  w  rp/ p\        V4      '       d   K  V F  p\        V4      '       d   K  \         P                  P                  W4      p\         P                  P                  V4      '       d   K\  \        P                  ! V4      pR V9   d   WdR&   K  \        R Uu. uF  qV9   NK	  	  up4      '       d   WdR&   K  \        R Uu. uF  qV9   NK	  	  up4      '       g   K  \        R Uu. uF  qV9   NK	  	  up4      '       g   K  WdR&   K  	  V'       g   EK#  VP                  R4      ;'       g+    VP                  R4      ;'       g    VP                  R4      u # 	  \        P                  ! RV 4       R# u upi u upi u upi )	zMS Windows shortcutZlinkr   r   z(Couldn't find a Windows executable in %sr   )zPE32+ executable(GUI)zx86-64)zPE32 executabler.   )z
Intel i386zIntel 80386)r   r   r+   r-   r   r   Zislinkr    r   Zallr   r    r   r!   )	r   r"   r#   r$   r%   r&   r'   r(   Z_s	   &        r   find_windows_game_executabler/   N   sX    ggdmU
4  Eu%%ggll4/Gww~~g&&0I$	1%,6".UV.U9n.UVWW&-7#.JK.J9n.JKLLQT)FG)FAi)FGR R '.7#  :>>&)__Z^^G-D__
W^H__) ,* LL;TB WKGs   =F&FF$)F)Z__doc__r   Zlutris.utilr    r   Zlutris.util.logr   r   r)   r+   r-   r/   r   r   r   <module>r0      s,    8 	 % "7 FE7r   