+
    Ki+c  c                   s.   R t ^ RIt^ RIt^ RIHt ^ RIHtHtHtH	t	H
t
Ht ^ RIHtHt ^ RIHt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 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/ R R lt0 ! R R4      t1R# )zBase module for runnersN)gettext)AnyCallableDictIterableOptionalSet)runtimesettings)format_runner_versionget_default_runner_version_info)LutrisConfig)get_game_by_field)MisconfigurationErrorMissingExecutableErrorUnavailableLibrariesError)MonitoredCommand)RunnerInstallationError)flatpakstringssystem)ExtractErrorextract_archive)GPUS)LINUX_SYSTEM)logger)Process)get_sniper_ld_library_pathget_sniper_run_commandc                sJ    V ^8  d   QhR\         R\        \         ,          RR/# )   sigpidsreturnN)intr   )formats   ":/usr/lib/python3.14/site-packages/lutris/runners/runner.py__annotate__r$      s*     F F F8C= FT F    c                s   V F$  p \         P                  ! \        V4      V 4       K&  	  R#   \         d#   p\        P
                  ! RT4        Rp?KR  Rp?i\         d    \        P
                  ! RT4        Kz  i ; i)zBSends a signal to a process list, logging errors without stopping.zFailed to kill game process: %sNz$Permission to kill process %s denied)osZkillr!   ZProcessLookupErrorr   debugZPermissionError)r   r   pidexs   &&  r#   kill_processesr*      sb    	FGGCHc"  " 	@LL:B?? 	FLL?E	Fs     -A>AA>"A>=A>c                   s  a  ] tR t^#t o RtRt. tRt. t. t	. t
. t. tRtRtRtRtRtRtRtRDR ltR t]R 4       t]R	 4       t]R
 4       t]P4                  R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       tR t ]R 4       t!]R 4       t"]R 4       t#]R 4       t$R t%R t&V 3R lR lt'R t(RER lt)V 3R lR lt*R t+R t,R  t-R! t.R" t/RDR# lt0R$ t1RFR% lt2R& t3R' t4R( t5V 3R) lR* lt6R+ t7RFV 3R, lR- llt8R. t9RFV 3R/ lR0 llt:V 3R1 lR2 lt;RDV 3R3 lR4 llt<RGV 3R5 lR6 llt=RDR7 lt>RHV 3R8 lR9 llt?RGV 3R: lR; llt@R< tAV 3R= lR> ltBR? tCV 3R@ lRA ltDRB tERCtFV tGR# )IRunnerz.Generic runner (base class for other runners).FNZ	main_file c                s    V'       d+   RV n         Wn        \        VP                  R4      V n        R# RV n         RV n        / V n        R# )zInitialize runner.TZ
configpathFN)has_explicit_config_configr   Zgame_config_id	game_data)selfconfig   &&r#   __init__ZRunner.__init__6   s<    '+D$!L.v/D/DlSDN',D$DLDNr%   c                s4    V P                   VP                   8  # N)name)r0   Zotherr2   r#   __lt__ZRunner.__lt__A   s    yy5::%%r%   c                .    V P                   P                  # r4   )Z	__class____name__r0      &r#   r5   ZRunner.nameD   s    ~~&&&r%   c                sr    \         P                  P                  \        P                  V P
                  4      # r4   )r&   pathjoinr   
RUNNER_DIRr5   r9   r:   r#   	directoryZRunner.directoryH   s!    ww||H//;;r%   c                st    V P                   '       g   \        V P                  R 7      V n         V P                   # ))Zrunner_slug)r.   r   r5   r9   r:   r#   r1   Runner.configL   s%    |||'DII>DL||r%   c                s$    Wn         VR JV n        R # r4   )r.   r-   )r0   Z
new_configr2   r#   r1   r?   R   s    !#-T#9 r%   c                r7   )z*Return the cascaded game config as a dict.)r1   game_configr9   r:   r#   r@   ZRunner.game_configW   s     {{&&&r%   c                r7   )z,Return the cascaded runner config as a dict.)r1   runner_configr9   r:   r#   rA   ZRunner.runner_config\        {{(((r%   c                r7   )z,Return the cascaded system config as a dict.)r1   system_configr9   r:   r#   rC   ZRunner.system_configa   rB   r%   c                s8    V P                   P                  R4      # )z2Return the default path where games are installed.	game_path)rC   getr9   r:   r#   default_pathZRunner.default_pathf   s     !!%%k22r%   c                s   V P                   P                  R4      pV'       d    \        P                  P	                  V4      # V P
                  '       dj   V P                  P                  V P                  4      pV'       d=   \        P                  P                  \        P                  P	                  V4      4      # R# )z1Return the directory where the game is installed.r>   r,   )	r/   rE   r&   r;   
expanduserr-   r@   entry_point_optionZdirname)r0   rD   Zentry_point   &  r#   rD   ZRunner.game_pathk   s     NN&&{3	77%%i00###**..t/F/FGKwwrww'9'9+'FGGr%   c                    V P                   # )zReturns the path where the game is found; if game_path does not
provide a path, this may try to resolve the path by runner-specific means,
which can find things like /usr/games when applicable.)rD   r9   r:   r#   resolve_game_pathZRunner.resolve_game_pathy   s     ~~r%   c                sh    V P                   ;'       g     \        P                  P                  R4      # )z:Return the working directory to use when running the game.z~/)rD   r&   r;   rG   r9   r:   r#   working_dirZRunner.working_dir   s%     ~~99!3!3D!99r%   c                s    \         P                  P                  \        P                  V P
                  4      p\         P                  P                  V4      '       g   \         P                  ! V4       V# )zWReturn the cache directory for this runner to use. We create
this if it does not exist.)r&   r;   r<   r   ZSHADER_CACHE_DIRr5   isdirZmkdir)r0   r;      & r#   shader_cache_dirZRunner.shader_cache_dir   sE     ww||H55tyyAww}}T""HHTNr%   c                rJ   )zkThe path to place in __GL_SHADER_DISK_CACHE_PATH; NVidia
will place its cache cache in a subdirectory here.)rO   r9   r:   r#   nvidia_shader_cache_pathZRunner.nvidia_shader_cache_path   s     $$$r%   c                s~    V P                   P                  R 4      '       d   V P                   P                  R 4      # R# )discord_client_idN)r/   rE   r9   r:   r#   rQ   ZRunner.discord_client_id   s3    >>122>>%%&9:: 3r%   c                s(    V P                   ^ ,          # )i    )	platformsr9   r:   r#   get_platformZRunner.get_platform   s    ~~a  r%   c                s   V P                   R ,          pV P                  '       d#   VP                  RRRRR\        R4      RR/4       VP                  R	\        R
4      RRRRR\        R4      RRRRRR.R\        R4      /4       V# ):NNNoptionrunner_executableZtypeZfileZlabelz Custom executable for the runnerZadvancedTZsectionz
Side PanelZvisible_in_side_panelboolzVisible in Side PanelZdefaultZscoperunnerZhelpzSShow this runner in the side panel if it is installed or available through Flatpak.)runner_optionsrU   append_)r0   rX   rN   r#   get_runner_optionsZRunner.get_runner_options   s    ,,Q/!!!!!1FQAB	 	1\?1234D(op		
 r%   c                s    < V ^8  d   QhRS[ /# )r   r    )strr"   __classdict__   "r#   r$   Runner.__annotate__   s       r%   c                s   R V P                   9   d;   V P                   R ,          p\        P                  P                  V4      '       d   V# V P                  '       g%   \        RP                  V P                  4      4      h\        P                  P                  \        P                  V P                  4      p\        P                  P                  V4      '       g   \        \        R4      V,          4      hV# )rU   z runner_executable not set for {}'The executable '%s' could not be found.)rA   r&   r;   isfilerU   r   r"   r5   r<   r   r=   r   rZ   )r0   rU   exerI   r#   get_executableZRunner.get_executable   s    $"4"44 $ 2 23F Gww~~/00((%%%'(J(Q(QRVR[R[(\]]ggll8..0F0FGww~~c""(+T)UX[)[\\
r%   c                s    V P                  4       p\        P                  ! V4      '       g   \        \	        R4      V,          4      hV.pT P                  '       dX   \        4       pT'       d%   \        4       pRT,          pTRRRTR.T,           pT# \        P                  ! RT P                  4       T#   \
         dK    \        P                  ! T P                  4      '       d#   \        P                  ! T P                  4      u # h i ; i)zgReturns the command line to run the runner itself; generally a game
will be appended to this by play().ra   z7export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:%s"; exec "$@"z--Zbashz-cz[Runner %s wants Sniper runtime but it is not available; falling back to running without it.)rd   r   path_existsr   rZ   r   r   is_app_installed
flatpak_idZget_run_commanduse_sniper_runtimer   r   r   Zwarningr5   )r0   rc   commandZ
sniper_cmdZhost_lib_pathsZ	shell_cmds   &     r#   get_commandZRunner.get_command   s    		%%'C%%c**,Q/X-Y\_-_``eG """/1J "<!=UXff	%tVT9fMPWW  qII
 / % 	''88..t??		s   +B7 B7 70D( D
Dc                sb   / pV'       d   \         P                  ! 4       p\        P                  P	                  R4      '       d2   \
        P                  ! R\        P                  R,          4       RVR&   V P                  P	                  R4      pV'       d   WCR&   RVR&   V P                  VR&   V P                  P	                  R	4      pV'       do   \        P                  P                  V4      p\         P                  ! V4      '       d0   \        VR
RR7      ;_uu_ 4       pVP                  4       pRRR4       WSR&   V P                  P	                  R4      pV'       d   VR8w  d   WR&   \        \        4      ^8  d   V P                  P	                  R4      \        9   d   \        V P                  R,          ,          p	V	P                   R8X  d   RVR&   RVR&   RVR&   RVR&   MV	P"                  VR&   V	P$                  VR&   V	P$                  VR&   \'        V	R4      '       d   V	P(                  VR&   V P                  P	                  R4      '       d   RVR&   Rp
V'       g8   V P+                  4       '       d"   V P-                  4       pVP	                  R 4      p
V
'       d?   VP	                  R 4      p\        P.                  P1                  \3        RW.4      4      VR &   TP5                  V P                  P	                  R!4      ;'       g    / 4       V#   + '       g   i     EL; i)"z-Return environment variables used for a game.Z
SteamAppIdz$Game launched from steam (AppId: %s)r,   ZLC_ALLlocaleZ1Z__GL_SHADER_DISK_CACHEZ__GL_SHADER_DISK_CACHE_PATHsdl_gamecontrollerconfigZrzutf-8)ZencodingNZSDL_GAMECONTROLLERCONFIGsdl_video_fullscreenZoffZSDL_VIDEO_FULLSCREEN_DISPLAYgpuZnvidiaZ	DRI_PRIMEZ__NV_PRIME_RENDER_OFFLOADZ__GLX_VENDOR_LIBRARY_NAMEZNVIDIA_onlyZ__VK_LAYER_NV_optimusZVK_ICD_FILENAMESZVK_DRIVER_FILESdevice_uuidZDXVK_FILTER_DEVICE_UUIDZpulse_latencyZ60ZPULSE_LATENCY_MSECZLD_LIBRARY_PATHenv)r   Zget_environmentr&   environrE   r   inforC   rP   r;   rG   re   ZopenZreadZlenr   ZdriverZpci_idZ	icd_filesZhasattrro   use_runtimeget_runtime_envZpathsepr<   ZfilterZupdate)r0   Zos_envdisable_runtimerp   rk   rl   r;   Zcontrollerdb_filerm   rn   Zruntime_ld_library_pathZruntime_envZld_library_paths   &&&          r#   get_envZRunner.get_env   s   ((*C ::>>,''KK>

<@XYCM ##''1"M ),$%-1-J-J)* $(#5#5#9#9:T#U #77%%&>?D!!$''$g66:K/@/E/E/G, 7.F*+  $11556LM$8E$A2F./t9q=T//33E:dBt))%01CzzX%#&K 36/03;/0/<+,#&::K &)mmC"#%(]]C!" sM**14-. !!/22(,C$%"&4#3#3#5#5..0K&1oo6G&H#"!gg&78O%'ZZ__VDCZBl5m%nC!" 	

4%%))%066B7
U 766s   %LL.	c                s:   < V ^8  d   QhRS[ S[S[3,          RR/# )r   rp   r    N)r   r\   r]   r_   r#   r$   r`   )  s#      d38n t r%   c                    R# )zThis is called by the Game after setting up the environment to allow the runner
to make final adjustments, which may be based on the environment so far.N )r0   rp   Zgame   &&&r#   
finish_envZRunner.finish_env)       	r%   c                sd    \         P                  ! V P                  P                  RR4      R7      # )zReturn runtime environment variables.

This method may be overridden in runner classes.
(Notably for Lutris wine builds)

Returns:
    dict

prefer_system_libsT)r|   )r   rv   rC   rE   r9   r:   r#   rt   ZRunner.get_runtime_env.  s(     $2D2D2H2HI]_c2deer%   c                sl    V P                  W4      VR&   V P                  V4      pV'       d   W1R&   R# R# )zlUpdates the gameplay_info to reflect a launch_config section. Called only
if a non-default config is chosen.ri   rL   N)get_launch_config_commandget_launch_config_working_dir)r0   gameplay_infolaunch_configconfig_working_dirs   &&& r#   apply_launch_configZRunner.apply_launch_config:  s:     $(#A#A-#_i !??N+=-( r%   c                s:   RV9   d   \         P                  ! VR,          4      pMV P                  4       pV P                  V4      pV'       d   VP	                  V4       VP                  R4      '       d%   V\         P                  ! VR,          4      ,          pV# )aL  Generates a new command for the gameplay_info, to implement the launch_config.
Returns a new list of strings; the caller can modify it further.

If launch_config has no command, this builds one from the gameplay_info command
and the 'exe' value in the launch_config.

Runners override this when required to control the command used.ri   Zargs)r   Zsplit_argumentsrj   get_launch_config_exerY   rE   )r0   r   r   ri   rc      &&&  r#   r}   Z Runner.get_launch_config_commandD  s~     %--mI.FGG&&(G((7NN3V$$w..}V/DEEGr%   c                s<   VP                  R4      pV P                  V4      pV'       d   \        P                  P	                  V4      pV'       d   \        P                  P                  V4      '       g   V P                  W#4      pV P                  V4      p\        P                  P                  V4      '       d_   \        P                  P                  V4      '       g:   \        P                  P                  WSR7      pVP                  R4      '       g   V# V# )zLocates the "exe" of the launch config. If it appears
to be relative to the game's working_dir, this will try to
adjust it to be relative to the config's instead.
rc   )startz../)
rE   r~   r&   r;   rG   isabsresolve_config_pathZexistsZrelpath
startswith)r0   r   rc   r   Zexe_from_configZexe_from_gameZrelatives   &&     r#   r   ZRunner.get_launch_config_exe[  s    
 &!??N''$$S)C!"''--*<*<"&":":3"S $ 8 8 =77>>-009X9X!ww}WH#..u55'
r%   c                s    VP                  R4      pV'       d9   V P                  V4      p\        P                  P	                  V4      '       d   V# R# )zExtracts the "working_dir" from the config, and resolves this relative
to the game's working directory, so that an absolute path results.

This returns None if no working_dir is present, or if it found to be missing.
rL   N)rE   r   r&   r;   rM   )r0   r   r      && r#   r~   Z$Runner.get_launch_config_working_dirq  sG     +..}=!%!9!9:L!Mww}}/00))r%   c                s   \         P                  P                  V4      p\         P                  P                  V4      '       g<   V'       g   V P                  pV'       d    \         P                  P                  W!4      # V# )a  Interpret a path taken from the launch_config relative to
a working directory, using the game's working_dir if that is omitted,
and expanding the '~' if we get one.

This is provided as a method so the WINE runner can try to convert
Windows-style paths to usable paths.
)r&   r;   rG   r   rL   r<   )r0   r;   Zrelative_tory   r#   r   ZRunner.resolve_config_path  sT     ww!!$'ww}}T"""..ww||K66r%   c                s   \        4       p\        V P                  4       F  pV\        P                  9   g   K  V P                  '       dU   V P                  \        P                  V,           Uu. uF  q3P                  NK  	  up9   d   VP                  V4       K~  K  VP                  V4       K  	  \        V P                  4      V,
          pV'       d   \        W@P                  4      hR# u upi )zRun actions before running the game, override this method in runners; raise an
exception if prelaunch fails, and it will be reported to the user, and
then the game won't start.N)setrequire_libsr   Zshared_librariesarchaddr   )r0   Zavailable_libsZlibZ_libZunavailable_libss   &    r#   	prelaunchZRunner.prelaunch  s     t(()Cl333999yy<;X;XY\;]$^;]4YY;]$^^&**3/ _ #&&s+ * t001NB+,<iiHH  %_s   0C0c                    R # r4   rx   )r0   use_defaultr2   r#   get_versionZRunner.get_version      r%   c                sF    RV P                  4       RV P                  4       /# )zjReturn dict with command (exe & args list) and env vars (dict).

Reimplement in derived runner if need be.ri   rp   )rj   rv   r9   r:   r#   get_run_dataZRunner.get_run_data  s"     4++-udllnEEr%   c                s   V P                   '       g   R# V P                  4       '       g0   V P                  V4      '       g   \        P                  ! R4       R# V P                  4       pVP                  R4      pVP                  R4      ;'       g    / P                  4       pV P                  4        \        W0VR7      pVP                  4        R# )zRun the runner alone.NzRunner install cancelledri   rp   )rW   rp   )runnable_aloneis_installedinstall_dialogr   rr   r   rE   Zcopyr   r   r   )r0   ui_delegateZcommand_datari   rp   Zcommand_runners   &&    r#   runZ
Runner.run  s    """  ""&&{3367((*""9-&,,"224)'CHr%   c                s^   \         P                  '       d   \        P                  ! R 4       R# V P                  P                  R4      '       d   \        P                  ! R4       R# V P                  '       d4   \        4       '       d$   \        P                  ! RV P                  4       R# R# )zRuntime disabled by environmentFru   z(Runtime disabled by system configurationz8Using Sniper runtime; old Lutris runtime disabled for %sT)	r   ZRUNTIME_DISABLEDr   rr   rC   rE   rh   r   r5   r9   r:   r#   rs   ZRunner.use_runtime  sw    ###KK9:!!"344KKBC"""'='?'?KKRTXT]T]^r%   c          	      sR   < V ^8  d   QhRS[ S[,          RS[RS[RS[S[,          /# )r   candidate_pids	game_uuidgame_folderr    )r   r!   r\   r   r]   r_   r#   r$   r`     s5     : :x} : :[^ :cfgjck :r%   c                s  a \        4       p\        4       pV P                  P                  R4      pV F  p\        V4      pVP                  ;'       g    Rp	W99   d   VP                  V4       V'       g   KE  VP                  ;'       g    RP                  R4      '       g   Kr  VP                  V4       K  	  \        V3R lV 4       4      p
WJ,          V,          # )zChecks the pids given and returns a set containing only those that are part of the running game,
identified by its UUID and directory.Z	gamescoper,   c              3   s~   <"   T F2  p\        V4      P                  P                  R 4      S8X  g   K.  Vx  K4  	  R# 5i)ZLUTRIS_GAME_UUIDN)r   rq   rE   )Z.0r(   r   s   & r#   Z	<genexpr>Z*Runner.filter_game_pids.<locals>.<genexpr>  s1     s~9M9M9Q9QRd9eir9r~s   +=
=)r   rC   rE   r   cmdliner   r5   r   )r0   r   r   r   Zfolder_pidsZgamescope_pidsZhas_gamescoper(   Zprocr   Z	uuid_pidss   &&f&       r#   filter_game_pidsZRunner.filter_game_pids  s     e**..{;!C3<Dll((bG%$}$))//r!=!=k!J!J""3' " s~ss	'>99r%   c                s    VP                  \        R4      \        R4      R7      '       d5   V P                  RR7      pV P                  WR7       V P	                  4       # R# )zYAsk the user if they want to install the runner.

Return success of runner installation.
zDThe required runner is not installed.
Do you wish to install it now?zRequired runner unavailable)ZquestionZtitleF)r   )version)Zshow_install_yesno_inquiryrZ   r   installr   )r0   r   r   r   r#   r   ZRunner.install_dialog  sc     11^_12 2 
 
 &&5&9GLLL6$$&&r%   c                s&   < V ^8  d   QhRS[ RS[ /# )r   flatpak_allowedr    )rV   r]   r_   r#   r$   r`     s     
g 
gD 
gD 
gr%   c                s    V P                  4       p\        P                  ! V4      '       d   R#  \	        T;'       d5    V P
                  ;'       d!    \        P                  ! V P
                  4      4      #   \         d     LTi ; i)z&Return whether the runner is installedT)rd   r   re   r   rV   rg   r   rf   )r0   r   rc   r   r#   r   ZRunner.is_installed  su    	%%'C!!#&& '
 OeeeeG<T<TUYUdUd<eff % 		s   +A8 8BBc                s"    V P                  4       # )zReturns whether the runner is installed. Specific runners can extract additional
script settings, to determine more precisely what must be installed.)r   )r0   Zinterpreterr2   r#   is_installed_forZRunner.is_installed_for  s       ""r%   c                s6   < V ^8  d   QhRS[ RS[S[,          /# )r   use_runner_configr    )rV   r   r\   r]   r_   r#   r$   r`     s"       YabeYf r%   c                r   r4   rx   )r0   Z	installerr   ry   r#   get_installer_runner_versionZ#Runner.get_installer_runner_version  r   r%   c                s:   < V ^8  d   QhRS[ S[S[3,          RR/# )r   installer_runner_configr    N)r   r\   r   r]   r_   r#   r$   r`     s%      d3PS8n Y] r%   c                rw   )zThis is called during installation to let to run fix up in the runner's section of
the confliguration before it is saved. This method should modify the dict given.Nrx   )r0   r   r2   r#   adjust_installer_runner_configZ%Runner.adjust_installer_runner_config  r{   r%   c                s\   < V ^8  d   QhRS[ S[,          RS[ S[S[S[3,          ,          /# )r   r   r    )r   r\   r   r]   r_   r#   r$   r`     s3     C C(3- C8DQTVYQYNC[ Cr%   c                s.    \        V P                  V4      # )zGet the appropriate version for a runner, as with get_default_runner_version(),
but this method allows the runner to apply its configuration.)r
   r5   )r0   r   r2   r#   get_runner_versionZRunner.get_runner_version  s     /tyy'BBr%   c                0   < V ^8  d   QhRS[ S[,          /# )r   r   r   r\   r]   r_   r#   r$   r`     s     $F $FHSM $Fr%   c           	     s   \         P                  ! RV P                  VV4       RVRV/pV P                  '       d-   V P                  VR&   V P
                  ! V P                  3/ VB # V P                  V4      pV'       g/   \        \        R4      P                  V P                  V4      4      hRV9  dU   V'       d(   \        \        RV: RV P                  : R	24      4      h\        \        R
V P                  ,          4      4      hRV P                  9   d<   RVR&   \        P                  P                  V P                  \        V4      4      VR&   V P                  R8X  d7   RVR&   \        P                  P                  \        P                  R4      VR&   V P                  R8X  d?   V'       d7   RVR&   \        P                  P                  \        P                  R4      VR&   V P
                  ! VR,          3/ VB  R# )z0Install runner using package management systems.z'Installing %s (version=%s, callback=%s)install_ui_delegatecallbackdestz&Failed to retrieve {} ({}) informationurlzThe 'z' version of the 'z' runner can't be downloaded.z(The the '%s' runner can't be downloaded.wineTmerge_singleZ
supermodelZlibretroFzretroarch/coresN)r   r'   r5   download_urlr>   download_and_extractr   r   rZ   r"   r&   r;   r<   r	   r   r=   )r0   r   r   r   optsZrunner_version_infos   &&&&  r#   r   ZRunner.install  s   5II		
 &':JQ>>DL,,T->->G$GG"55g>")!,T*U*\*\]a]f]fho*pqq++-T[]a]f]fgh  .a0Z]a]f]f0f.ghhTYY#'D 77<<8MNa8bcDL99$#'D 77<<(;(;\JDL99
"w#(D 77<<(;(;=NODL!!"5e"<EEr%   c                s   VR ,          pVP                  RR4      pVP                  R4      p\        P                  P                  V4      p\        P                  P	                  \
        P                  V4      pV'       g   \
        P                  pVP                  W4      p	V	'       d   V P                  WWVR7       R# \        P                  ! R4       R# )r   r   Fr   )archiver   r   r   zDownload canceled by the user.N)rE   r&   r;   Zbasenamer<   r   Z	CACHE_DIRr=   Zdownload_install_fileextractr   rr   )
r0   r   r   r   r   r   r   Ztarball_filenameZrunner_archiveZdownload_successfuls
   &&&,      r#   r   ZRunner.download_and_extract1  s    "#89xx688J'77++C0h&8&8:JK&&D1GG\LLLiKK89r%   c                s,   < V ^8  d   QhRS[ RS[ RS[/# )r   r   r   r   )r\   rV   r]   r_   r#   r$   r`   @  s"      s # T r%   c                s    \         P                  ! VR R7      '       g$   \        \        R4      P	                  V4      4      h \        WVR7       \        P                  ! T4       T P                  R8X  d$   \        P                  ! R4       ^ R	IHp T! 4        T P                  '       dt   \        P                   P#                  \$        P&                  T P                  4      p\        P                   P)                  T4      '       d   \         P*                  ! T4       T'       d
   T! 4        R# R#   \         dA   p\        P                  ! RT4       \        \        R4      P	                  Y4      4      ThRp?ii ; i)
T)Zexclude_emptyzFailed to extract {})r   z4Failed to extract the archive %s file may be corruptzFailed to extract {}: {}Nr   zClearing wine version cache)clear_wine_version_cache)r   re   r   rZ   r"   r   r   r   Zerrorr&   Zremover5   r'   Zlutris.util.wine.winer   rU   r;   r<   r   r=   rb   Zmake_executable)r0   r   r   r   r   r)   r   rU   s   &&&&&   r#   r   ZRunner.extract@  s   !!'>>)!,B*C*J*J7*STT	eGE 			'99LL67F$&!!! "X-@-@$BXBX Yww~~/00&&'89J !  	eLLOQXY)!,F*G*N*Nw*[\bdd	es   D2 2E==;E88E=c                r   )r   rD   r   r]   r_   r#   r$   r`   X  s     , ,x} ,r%   c                sF    V'       d   \         P                  ! V4       R # R # r4   )r   remove_folder)r0   Zapp_idrD   ry   r#   remove_game_dataZRunner.remove_game_dataX  s      + r%   c                sT    \         P                  P                  V P                  4      # r4   )r&   r;   rM   r>   r9   r:   r#   can_uninstallZRunner.can_uninstall\  s    ww}}T^^,,r%   c                s6   < V ^8  d   QhRS[ . R3,          RR/# )r   uninstall_callbackNr    )r   r]   r_   r#   r$   r`   _  s$     ! !HRX,> !4 !r%   c                s    V P                   p\        P                  P                  V4      '       d   \        P
                  ! W!R 7       R# V! 4        R# ))Zcompletion_functionN)r>   r&   r;   rM   r   r   )r0   r   Zrunner_pathr   r#   	uninstallZRunner.uninstall_  s2    nn77==%%  U r%   c                sf    VR9  d   R# Rp\        W4       F  pVR,          V8X  g   K  Tp V# 	  V# )z1Retrieve an option dict if it exists in the groupNrT   )game_optionsrX   )Zgetattr)r0   Zoptions_groupZoption_nameZoutputZitemr   r#   find_optionZRunner.find_optionf  sB     BBD0DH~,	 1 r%   c                s4   < V ^8  d   QhRS[ S[,          RR/# )r   	game_pidsr    N)r   r!   r]   r_   r#   r$   r`   q  s     2 2# 24 2r%   c                s:    \        \        P                  V4       R# )zoStop the running game. If this leaves any game processes running,
the caller will SIGKILL them (after a delay).N)r*   signalZSIGTERM)r0   r   r2   r#   force_stop_gameZRunner.force_stop_gameq  s     	v~~y1r%   c                rw   )zThe config UI calls this to extract the game icon. Most runners do not
support this and do nothing. This is not called if a custom icon is installed
for the game.Nrx   )r0   Z	game_slugr2   r#   extract_iconZRunner.extract_iconv  s    r%   )r.   r/   r-   r4   )FF)T)NN)FN)Hr8   Z
__module__Z__qualname__Z__firstlineno____doc__Zmultiple_versionsrR   r   r   rX   Zsystem_options_overrideZcontext_menu_entriesr   rU   rH   r   r   rg   Z
human_namerh   r3   r6   Zpropertyr5   r>   r1   Zsetterr@   rA   rC   rF   rD   rK   rL   rO   rP   rQ   rS   r[   rd   rj   rv   rz   rt   r   r}   r   r~   r   r   r   r   r   rs   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Z__static_attributes__Z__classdictcell__)r^   s   @r#   r+   r+   #   sc    8INLN L$LDJJ	 & ' ' < <  
 ]]: : ' ' ) ) ) ) 3 3   : :   % %
 ; ;!4 BDL 

f>.,&I F$
: :*
g 
g#
  
C C
$F $FL: 0, ,-! !	2 2
 r%   r+   )2r   r&   r   r    rZ   Ztypingr   r   r   r   r   r   Zlutrisr   r   Z
lutris.apir	   r
   Zlutris.configr   Zlutris.database.gamesr   Zlutris.exceptionsr   r   r   Zlutris.monitored_commandr   Zlutris.runnersr   Zlutris.utilr   r   r   Zlutris.util.extractr   r   Zlutris.util.graphics.gpur   Zlutris.util.linuxr   Zlutris.util.logr   Zlutris.util.processr   Zlutris.util.sniperr   r   r*   r+   rx   r%   r#   <module>r      sY     	    ? ? $ M & 3 f f 5 2 0 0 = ) * " ' QFV	 V	r%   