+
    Ki7  c                   s   ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHtHt ^ RIHt	 ^ RI
HtHt ^ RIt]P                  ! RR4       ]P                  ! RR4       ^ RI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!H"t"H#t#H$t$ ^ RI%H&t&H't'H(t(H)t) ^ RI*H+t+H,t,H-t- ^ RI.H/t/ ^ RI0H1t1H2t2H3t3H4t4 ^ RI5H6t6 ^ RI7H8t8 ^ RI9H:t: ^ RI;H<t< ^ RI=H>t>H?t?H@t@HAtA ^ RIBHCtC ^ RIDHEtEHFtF ^ RIGHHtH ^ RIIHJtJHKtKHLtLHMtM ^ RINHOtOHPtP ^ RIQHRtRHStS ^ RITHUtUHVtVHWtW ^ RIXHYtYHZtZ ^ R I[H\t\ ^R!I]H^t^ ^R"I_H`t` ^R#IaHbtb ]P                  P                  R$4      R%8H  te ! R& R']P                  4      tgR# )(i    N)datetime	timedelta)gettext)ListOptionalZGdkz3.0Gtk)GioGLibr   )settings)get_runnersparse_installer_url)games)ServiceGameCollection)init_exception_backstops)
GAME_STARTGAME_STOPPEDGameexport_gameimport_game)ErrorDialogInstallOrPlayDialogNoticeDialogdisplay_error)CommandLineUIDelegateInstallUIDelegateLaunchUIDelegate)IssueReportWindow)INSTALLATION_COMPLETEDINSTALLATION_FAILEDInstallationKindInstallerWindow)LutrisStatusIcon)get_installers)migrate)exec_command)InvalidRunnerErrorRunnerInstallationErrorget_runner_namesimport_runner)get_enabled_services)init_lutrisrun_all_checks)StyleManager)datapathlog	resourcessystem)	HTTPErrorRequest)file_handlerlogger)
save_checkshow_save_statsupload_save)AppManifestget_appmanifests)get_steamapps_dirs)BusyAsyncCall)generate_script)LutrisWindow$LUTRIS_EXPERIMENTAL_FEATURES_ENABLEDZ1c                   s  a a ] tR t^Dt oV3R lV 3R lltR tR tR tV3R lR ltR t	R5R
 lt
R	R	]P                  3R ltR tR t]R 4       tR tR tR tV3R lR ltV3R lR ltR tR tV3R lR lt]R 4       tV3R lR ltV3R lR ltV3R lR  lt]R! 4       tR" t R# t!R$ t"R% t#R& t$]R' 4       t%R( t&R) t'R* t(R+ t)R, t*R- t+R. t,R/ t-R0 t.R1 t/R2 t0R3 t1R4t2Vt3V ;t4# )6LutrisApplicationc                   < V ^8  d   QhRR/#    returnN format__classdict__   ";/usr/lib/python3.14/site-packages/lutris/gui/application.py__annotate__LutrisApplication.__annotate__E   s     ,b ,b$ ,b    c                s$  < \         SV `  R \        P                  P                  RR7       \        4        \        P                  ! V P                  4       \        P                  ! V P                  4       \        P                  P                  V P                  4       \        P                  ! V P                  4       \         P                  ! V P                  4       \"        P$                  ! \'        R4      4       \"        P(                  ! R 4       RV n        \,        P.                  P1                  4       V n        RV n        \7        4       V n        \;        4       V n        . V n        / V n         RV n!        RV n"        \G        4       V n$        \J        PL                  ! 4       ^ 8X  d+   \O        \'        R4      4       \P        PR                  ! ^4        V P2                  PU                  \J        PV                  PY                  \Z        P\                  ! 4       RR4      4       \e        V R	4      '       d   V Pg                  4        R# \i        \'        R
4      4       R#   \"        P^                   d!   p\`        Pb                  ! T4        Rp?LjRp?ii ; i)znet.lutris.LutrisT)Zapplication_idZflagsZregister_sessionZLutrisFNzDo not run Lutris as root.Zuiz
lutris.cssadd_main_optionzCYour Linux distribution is too old. Lutris won't function properly.)5Zsuper__init__r   ZApplicationFlagsZHANDLES_COMMAND_LINEr   r   registeron_game_startr   on_game_stoppedr   ZSETTINGS_CHANGEDon_settings_changedr   on_install_endedr   r   Zset_application_name_Zset_prgnameforce_updatesr   ZCssProvidernewcss_providerwindowr   launch_ui_delegater   install_ui_delegate_running_gamesapp_windowstrayquit_on_game_exitr*   style_managerosZgeteuidr   sysZexitZload_from_pathpathjoinr+   getZErrorr2   	exceptionhasattradd_argumentsr   )selfe	__class__   & rG   rL   ZLutrisApplication.__init__E   s   .&&;;! 	 	
 	!"D../d223!!**4+C+CD''(=(=>$$T%:%:;!!!H+.,-"OO//1.2"2"4#4#6  	!&)^::<1789HHQK	 ,,RWW\\(,,.$P\-]^ 4*++ _`a zz 	 Q	 s   AI J/J

Jc           	     s   \        V R 4      '       d   V P                  \        R4      4       M\        P                  ! R4       V P                  R\        R4      \        P                  P                  \        P                  P                  \        R4      R4       V P                  R\        R4      \        P                  P                  \        P                  P                  \        R	4      R4       V P                  R
\        R4      \        P                  P                  \        P                  P                  \        R4      R4       V P                  R\        R4      \        P                  P                  \        P                  P                  \        R4      R4       V P                  R\        R4      \        P                  P                  \        P                  P                  \        R4      R4       V P                  R\        R4      \        P                  P                  \        P                  P                  \        R4      R4       V P                  R\        R4      \        P                  P                  \        P                  P                  \        R4      R4       V P                  R\        R4      \        P                  P                  \        P                  P                  \        R4      R4       V P                  R\        R4      \        P                  P                  \        P                  P                  \        R4      R4       V P                  R^ \        P                  P                  \        P                  P                  \        R 4      R4       V P                  R!^ \        P                  P                  \        P                  P                  \        R"4      R4       V P                  R#^ \        P                  P                  \        P                  P                  \        R$4      R4       V P                  R%\        R&4      \        P                  P                  \        P                  P                  \        R'4      R4       V P                  R(^ \        P                  P                  \        P                  P                  \        R)4      R4       V P                  R*\        R+4      \        P                  P                  \        P                  P                  \        R,4      R4       V P                  R-\        R.4      \        P                  P                  \        P                  P                  \        R/4      R4       V P                  R0^ \        P                  P                  \        P                  P                  \        R14      R4       V P                  R2^ \        P                  P                  \        P                  P                  \        R34      R4       \        '       d   V P                  R4^ \        P                  P                  \        P                  P                  \        R54      R4       V P                  R6^ \        P                  P                  \        P                  P                  \        R74      R4       V P                  R8^ \        P                  P                  \        P                  P                  \        R94      R4       V P                  R:^ \        P                  P                  \        P                  P                  \        R;4      R4       V P                  R<\        R=4      \        P                  P                  \        P                  P                  \        R>4      R4       V P                  R?^ \        P                  P                  \        P                  P                  \        R@4      R4       V P                  RA^ \        P                  P                  \        P                  P                  \        RB4      R4       V P                  \        P                  ^ \        P                  P                  \        P                  P                  \        RC4      RD4       R# )Eset_option_context_summarya  Run a game directly by adding the parameter lutris:rungame/game-identifier.
If several games share the same identifier you can use the numerical ID (displayed when running lutris --list-games) and add lutris:rungameid/numerical-id.
To install a game, add lutris:install/game-identifier.zUGLib.set_option_context_summary missing, was added in GLib 2.56 (Released 2018-03-12)versionZvz$Print the version of Lutris and exitNdebugdzShow debug messagesinstallizInstall a game from a yml fileforceZfzForce updatesoutput-scriptZbz7Generate a bash script to run a game without the clientexecrg   z)Execute a program with the Lutris Runtime
list-gamesZlzList all games in database	installedZozOnly list installed gameslist-steam-gamesZszList available Steam gameslist-steam-foldersz$List all known Steam library folderslist-runnerszList all known runnerslist-wine-versionszList all known Wine versionslist-all-service-gamesZaz+List all games for all services in databaselist-service-gamesz/List all games for provided service in databaseinstall-runnerZrzInstall a Runneruninstall-runnerZuzUninstall a RunnerexportzExport a gameimportzImport a game
save-statsz"Show statistics about a game savessave-uploadzUpload saves
save-checkzVerify status of save syncingdestzDestination path for exportjsonZjz(Display the list of games in JSON format	reinstallzReinstall gamesubmit-issuezSubmit an issuezURI to openZURI)rd   rj   rR   r2   warningrK   Zordr   ZOptionFlagsZNONEZ	OptionArgZSTRINGr<   OPTION_REMAININGZSTRING_ARRAYrf      &rG   re   ZLutrisApplication.add_argumentss   s   4566++M NNrsH!!NN45	
 	H!!NN#$	
 	H!!NN!!./	
 	H!!NNo	
 	H!!NN!!GH	
 	H!!NN!!9:	
 	H!!NN*+	
 	H!!NN)*	
 	H!!NN*+	
 	 !!NN45	
 	!!NN&'	
 	 !!NN,-	
 	$H!!NN;<	
 	 !!NN!!?@	
 	H!!NN!! !	
 	H!!NN!!"#	
 	!!NN!!o	
 	!!NN!!o	
 0/    %%%%67     %%%%.!     %%%%12 	!!NN!!+,	
 	H!!NN89	
 	!!NN	
 	^Q0@0@0E0Et~~GZGZ\]^o\prvw!!!!NN''m	
rJ   c                s  a  \         P                  P                  S 4       \        P                  ! 4        \
        P
                  ! \
        P                  \
        P                  4       \        P                  P                  R4      pVP                  RV 3R l4       S P                  V4       S P                  RR4       R# )z'Sets up the application on first start.quitactivatec                  s$   < SP                  4       # N)r   )xrf   s   *rG   <lambda>Z.LutrisApplication.do_startup.<locals>.<lambda>S  s    diikrJ   z
<Primary>qzapp.quitN)r   Application
do_startupr1   Z
doRolloversignalSIGINTZSIG_DFLr   ZSimpleActionrT   connectZ
add_actionZadd_accelerator)rf   actions   f rG   r   ZLutrisApplication.do_startupL  sx    ""4(!fmmV^^4!!%%f-z#9:\:6rJ   c                s    V P                   '       gl   \        V R 7      V n         V P                   P                  P                  p\        P
                  P                  WP                  \        P                  4       R# R# )applicationN)	rV   r;   Zpropsscreenr   ZStyleContextZadd_provider_for_screenrU   Z#STYLE_PROVIDER_PRIORITY_APPLICATION)rf   r      & rG   do_activateZLutrisApplication.do_activateW  sT    {{{&48DK[[&&--F44V=N=NPSPwPwx rJ   c                r>   r?   rB   rC   rF   rG   rH   rI   ]  s     B Bt BrJ   c                s   \         P                  P                  R 4      '       d   \        P                  ! R4       R# V P
                  '       g   \        P                  ! R4       R# V P
                  P                  V P                  4       R# )ZLUTRIS_SKIP_INITzSkipping initializationz5Runtime updates can't be started with a LutrisWindow.N)	r^   environrb   r2   rl   rV   errorstart_runtime_updatesrS   r   r   rG   r   Z'LutrisApplication.start_runtime_updates]  sQ    ::>>,--LL23LLPQKK--d.@.@ArJ   c                s   VP                  R 4      '       d
   VR ,          # VP                  R4      '       d   VR,          P                  # VP                  R4      '       d;   VR,          ^ ,          pVP                  R4      ;'       g    VP                  R4      # VP                  R4      '       d   VR,          P                  # \        V4      # )appidrunner
installersslug	game_sluggame)rb   nameidstr)rf   kwargsZ	installers   &, rG   get_window_keyZ LutrisApplication.get_window_keye  s    ::g'?"::h(#(((::l##|,Q/I==(FFIMM+,FF::f&>$$$6{rJ   Nc           	     s   \        VP                  4      V P                  ! R/ VB ,           pV P                  P	                  V4      '       dG   V P                  V,          P                  4        V P                  V,          pV'       d	   V! V4       V# \        V\        P                  4      '       d7   RV9   d
   V! R/ VB pMV! RRV P                  /VB pVP                  V 4       M
V! RRV /VB pVP                  RV P                  V P                  ! R/ VB 4       V'       d	   V! V4       WPP                  V&   VP                  4        VP                  4        V# )a|  Instantiate a window keeping 1 instance max

Params:
    window_class (Gtk.Window): class to create the instance from
    update_function (Callable): Function to initialize or update the window (if possible before being shown)
    kwargs (dict): Additional arguments to pass to the instanciated window

Returns:
    Gtk.Window: the existing window instance or a newly created one
parentr   destroyrB   )r   __name__r   rZ   rb   presentZ
issubclassr   ZDialogrV   Zset_applicationr   on_app_window_destroyedshow)rf   Zwindow_classZupdate_functionr   
window_keyZwindow_insts   &&&,  rG   show_windowZLutrisApplication.show_windowq  s0    ../$2E2E2O2OO

++Z(002**:6K,lCJJ//6!*4V4*H$++HH''-&B4B6BKIt'C'CTEXEXEb[aEbcK('2$rJ   c                s6    V P                  \        WW4R 7       R# ))r   servicer   installation_kindN)r   r   )rf   r   r   r   r   s   &&&&&rG   show_installer_windowZ'LutrisApplication.show_installer_window  s    
5 	 	
rJ   c                s6   a  V 3R  lp\        \        W!R7       R# )c                 s   < V'       d   \        VSP                  R 7       R# V '       d   SP                  V 4       R# \        \	        R4      SP                  R 7       R# ))r   zNo installer available.N)r   rV   r   r   rR   )r   r   rf      &&rG   on_installers_readyZKLutrisApplication.show_lutris_installer_window.<locals>.on_installers_ready  s9    eDKK8**:6A78MrJ   )r   N)r9   r    )rf   r   r   s   f& rG   show_lutris_installer_windowZ.LutrisApplication.show_lutris_installer_window  s    	N 	n&9OrJ   c                s<   \        VP                  P                  4      V,           p V P                  V R#   \         dZ    \
        P                  ! RT4       \
        P                  ! RRP                  T P                  P                  4       4      4        R# i ; i)z=Remove the reference to the window when it has been destroyedzFailed to remove window %szAvailable windows: %s, T)
r   rh   r   rZ   KeyErrorr2   r   infora   Zkeys)rf   Z
app_windowr   s   &&&rG   r   Z)LutrisApplication.on_app_window_destroyed  s    --667*D
	U  ,   	UNN7DKK/4;K;K;P;P;R1ST	Us   7 A BBc                s6    V P                  WR ,           4       R# )Z
N)Zdo_print_literal)command_lineZstring   &&rG   _printZLutrisApplication._print  s     	%%lTMBrJ   c                s6   VP                  R 4      '       d   \        P                  P                  \        P
                  ^ ,          4      p\        VR,           \        P                  ,           4       \        P                  ! \        P                  4       ^ # R# )rk   -)containsr^   r`   basenamer_   argvprintr   VERSIONr2   setLevelloggingZNOTSET)rf   optionsZexecutable_name   && rG   do_handle_local_optionsZ)LutrisApplication.do_handle_local_options  sa     I&& gg..sxx{;O/C'(*:*::;OOGNN+	rJ   c                sR   a aa$ SP                  4       p\        \        P                  4      ^,
          pR\        P                  9   g   R\        P                  9   d
   V^,          pV'       g.   \        P
                  P                  \        P                  4       VP                  R4      '       dR   \        P
                  P                  \        P                  4       \        P                  ! \        P                  4       VP                  R4      '       d   RS n        \        P                   ! R\"        P$                  4       \'        4        \)        4        \+        4        VP                  R4      '       d!   VP-                  R4      P/                  4       pMRpVP                  R	4      '       d   VP-                  R	4      P/                  4       p\0        P2                  ! VR
4      ;'       g7    \0        P2                  ! VR4      ;'       g    \0        P2                  ! VR4      pV'       d   VR
,          '       g   \        P4                  ! RV4       ^# \7        \        S P8                  WfR,           R24       ^ # VP                  R4      '       dr   \0        P:                  ! VP                  R4      '       d   R^/MRR7      pVP                  R4      '       d   S P=                  SV4       ^ # S P?                  SV4       ^ # VP                  R4      '       Ed   VP-                  R4      P/                  4       p\0        P:                  ! R^RV/R7      p\@        PB                  ! V4      p	V	 F@  o$\D        ;QJ d    V$3R lV 4       F  '       g   K   RM	  RM! V$3R lV 4       4      S$R&   KB  	  VP                  R4      '       d"   V	 U
u. uF  qR,          '       g   K  V
NK  	  p	p
VP                  R4      '       d   S PG                  SV	4       ^ # S PI                  SV	4       ^ # VP                  R4      '       d   \0        P:                  ! R^/R7      p\@        PJ                  ! 4       p	V	 F@  o$\D        ;QJ d    V$3R lV 4       F  '       g   K   RM	  RM! V$3R lV 4       4      S$R&   KB  	  VP                  R4      '       d"   V	 U
u. uF  qR,          '       g   K  V
NK  	  p	p
VP                  R4      '       d   S PG                  SV	4       ^ # S PI                  SV	4       ^ # VP                  R4      '       d   S PM                  S4       ^ # VP                  R4      '       d   S PO                  S4       ^ # VP                  R4      '       d   S PQ                  4        ^ # VP                  R4      '       d   S PS                  4        ^ # VP                  R4      '       d3   VP-                  R4      P/                  4       pS PU                  V4       ^ # VP                  R4      '       d3   VP-                  R4      P/                  4       pS PW                  V4       ^ # VP                  R4      '       dB   VP-                  R4      P/                  4       pV'       g   \Y        R 4       ^ # \[        W4       ^ # VP                  R!4      '       dB   VP-                  R!4      P/                  4       pV'       g   \Y        R 4       ^ # \]        W4       ^ # \^        '       Ed   VV 3R" lpVP                  R#4      '       dV   V! VP-                  R#4      P/                  4       4      o$S$'       d'   \a        S$VP                  R4      '       d   RMR$R%7       ^ # VP                  R&4      '       d;   V! VP-                  R&4      P/                  4       4      o$S$'       d   \c        S$4       ^ # VP                  R'4      '       d;   V! VP-                  R'4      P/                  4       4      o$S$'       d   \e        S$4       ^ # VP                  R(4      '       d3   VP-                  R(4      P/                  4       pS Pg                  V4       ^ # VP                  R)4      '       d   \i        S R*7       ^ # VP-                  \j        Pl                  4      p S Po                  V4      pTR,,          pTR-,          pTR,          pTR.,          pTR/,          p\y        T4      S n        TR0,          pRpTP                  R14      '       Ed   TP-                  R14      P/                  4       pTP{                  RD4      '       d    \}        T4      P                  4       p \        TP                  4      pTR3,          P                  R4^4      RE,          p\        P                  P                  \        P                  ! 4       T4      pS Ps                  S\u        R54      P                  TTR67      4       \        TR74      ;_uu_ 4       pTP                  TP                  4       RRR4       TpR1pM~\        P                  P                  T4      '       g9   SP                  4       pT'       d!   \        P                  P                  TT4      p\        P                  P                  T4      pR1p\        P                  P                  T4      '       g%   S Ps                  S\u        R84      T,          4       ^# RpT'       d   T'       g   TR98X  d    RS nT        \0        P2                  ! TR
4      pMTR:8X  d    RS nT        \0        P2                  ! TR4      pMTR18X  d?   RS nT        \0        P2                  ! TR4      ;'       g    \0        P2                  ! TR4      pMU\0        P2                  ! TR
4      ;'       g7    \0        P2                  ! TR4      ;'       g    \0        P2                  ! TR4      pTP                  R;4      '       d   R1pS P                  4        S P                  4        T'       g   T'       d_   TR,          '       dP   \        TR<,          4      pTP                  '       g   R=pMBTP                  R>8X  d   R:pM.TP                  R18X  d   R1pMT'       g   T'       g	   T'       d   R1pT'       dI   \@        P                  ! TT4      p T '       d*   \        4       T,          ! 4       pTP                  T 4       ^ # TR=8X  d3   S P                  P                  4       '       g   S P                  4        ^ # TR18X  d*   \        TTTR?7      p!T!'       d   S P                  T!4       ^ # TRF9   Ed]   T'       d   TR
,          '       gI   \        P4                  ! R@4       S P                  P                  4       '       g   S P                  4        ^ # RA RB lp"\        TR
,          4      o$S$P                  P                  T"4       S$P                  S P8                  4       S$P                  S$P                  8X  d1   S P                  P                  4       '       g   S P                  4        S P                  '       dQ   T$3RC lp#\        P                  ! \        P                  T#4       \        P                  ! \        P                  T#4       ^ # S P                  '       dT   S P                  S n        S P                  S nj        S P                  P                  4        S P                  4        RS nT        ^ # u up
i u up
i   \p         d5    S Ps                  S\u        R+4      TPw                  4       ,          4        ^# i ; i  \         d'    S Ps                  S\u        R24      T,          4        ^# i ; i  \        \        3 d$    \        P                  P                  T4      p ELSi ; i  + '       g   i     EL; i)Gi   z-dz--debugrl   rp   TzStarting Lutris %sr   Nrq   r   r   Zinstaller_slugz]No valid game (%s) provided to generate the script. Use the -l option to find suitable games!z.shrs   rt   )Zfiltersr   rz   r   c              3   s\   <"   T F!  pR SR,          3VP                  4       9   x  K#  	  R# 5i)
service_idr   NZitems.0Zitemr   ri   rG   	<genexpr>4LutrisApplication.do_command_line.<locals>.<genexpr>  s(     'lbkZ^tG}(E(Ubks   ),Fry   c              3   s   <"   T F8  pVR ,          SR ,          8X  g   K  RSR,          3VP                  4       9   x  K:  	  R# 5i)r   r   r   Nr   r   ri   rG   r   r     s?      ( )I$y/9 B\4=1TZZ\A )s
   A$Aru   rv   rw   rx   r{   r|   r}   zNo destination dir givenr~   c           
      sn  < \         P                  ! V 4      pV'       g   \         P                  ! R V /R7      p\        V4      ^8  d3   SP	                  SRV : RRP                  R V 4       4      : 24       R# V'       g   SP	                  SRV ,          4       R# \        V^ ,          R,          4      # )	r   )ZsearcheszMultiple games matching z: Z,c              3   s2   "   T F  qR ,          x  K  	  R# 5i)r   NrB   )r   r   r   rG   r   ZLLutrisApplication.do_command_line.<locals>.get_game_match.<locals>.<genexpr>T  s     Jjdi\`PV<<dis   NzNo matching game for %sr   )games_dbZget_games_by_slug	get_gameslenr   ra   r   )r   r   r   rf   s   & rG   get_game_matchZ9LutrisApplication.do_command_line.<locals>.get_game_matchK  s     2248$..GEu:>KK$<@#((JjdiJjBjk KK.G$.NOE!HTN++rJ   r   Ztext)Zoutput_formatr   r   rr   r   r   z%s is not a valid URIr   r   r   launch_config_namerevisionrn   zFailed to download %szContent-DispositionZ=z download {url} to {file} started)urlZfileZwbzNo such file: %s	rungameidrungamer   r   ZcancelZplay)r   installer_filer   zNo game found in libraryc                s(    V ^8  d   QhR\         RR/# )r@   r   rA   N)ZBaseException)rD   s   "rG   rH   Z7LutrisApplication.do_command_line.<locals>.__annotate__  s     E E E$ ErJ   c                 s4    \         P                  ! R V 4       R# )zUnable to launch game: %sN)r2   rc   )r   r   rG   on_errorZ3LutrisApplication.do_command_line.<locals>.on_error  s      !<eDrJ   c                 sV   < \         P                  ! R V 4       SP                  4        R# )z%signal handler called with signal: %dN)r2   rl   stop)ZsignumZ_framer   r   rG   game_stop_signal_handlerZCLutrisApplication.do_command_line.<locals>.game_stop_signal_handler   s    LL!H&QIIKrJ   )zhttp:zhttps:r   )r   r   )mZget_options_dictr   r_   r   r,   Zconsole_handlerZ	setStreamZstderrr   ZsetFormatterZDEBUG_FORMATTERr2   r   r   ZDEBUGrS   r   r   r   r(   r!   r)   Zlookup_valueZ
get_stringr   Zget_game_by_fieldr   r:   rW   r   print_game_jsonprint_game_listr   Zget_for_serviceZanyprint_service_game_jsonprint_service_game_listZget_service_gamesprint_steam_listprint_steam_foldersprint_runnersprint_wine_runnersinstall_runneruninstall_runnerr   r   r   r<   r4   r5   r3   execute_commandr   r   r   get_lutris_action
ValueErrorr   rR   get_strvr   
startswithr0   rb   r/   ZdictZresponse_headersZsplitr   Z
IndexErrorr^   r`   r   ra   tempfileZ
gettempdirrD   ZopenZwriteZcontentZisabsZget_cwdZabspathZisfiler\   set_tray_iconr   r   r   Zget_gamer'   rn   rV   
is_visibler   r    r   r   Z
game_errorrM   ZlaunchstateSTATE_STOPPEDr   ZSIGTERMr   rX   r   r   )%rf   r   r   ZargcZdest_dirZsearchstringZexport_script_game	game_listr   Zservice_game_listrm   r   r   Zfilepathr   commandr   installer_infor   r   r   r   r   r   ZrequestZheadersZ	file_nameZ	file_pathZ	dest_fileZcwdZdb_gameZdlgZservice_gamer   r   r   r   s%   ff                                  @rG   do_command_lineZ!LutrisApplication.do_command_line  s    //1 388}q 388yCHH4AID ))#**5 G$$,,S-@-@AOOGMM*G$$!%D((*:*:;	F##++F3>>@HHO,,"//@KKML**<> N N--lFCN N--l<LM  &-?-E-Es  FD$;$;=OgmTnSoorQst L)) **HXHXYdHeHe[!4DkoqI''$$\9=  $$\9= 011**+?@KKMG **KIw3WXI 5 E Eg N)$'C'lbk'lCCC'lbk'l$l[! *,,0A$T0A1{^^QQ0A!$T'',,\;LM  ,,\;LM 455 **K3CDI 5 G G I)$'C ( )(CCC ( )( %[! * ,,0A$T0A1{^^QQ0A!$T'',,\;LM  ,,\;LM .//!!,/ 011$$\2 N++  011##% ,--))*:;FFHF' .//))*<=HHJF!!&)H%%''1<<>D01  D+H%%++H5@@BH01  H///," --%g&:&:<&H&S&S&UV#D'BRBRSYBZBZ`fg..%g&:&:=&I&T&T&VW%--%g&:&:<&H&S&S&UVt$ F##**62==?G  )N++$/""4#8#89	!33C8N
 #;/	) +w'+,@A"78J"K!*-I&&$11)<GGIN(()<==%n599;GA"7#;#;<G '(= > D DS! LR PI GGLL)<)<)>	J	 !$F"G"N"NSahq"N"r )T**iOOGOO4 +!*" ww}}^44&..0C)+c>)J!#!@"77>>.11L!,>*?.*PQW$)-&"44YE9$)-&"44YG9$)-&"44YG  8KeKe/L ..y$? O O11)VDO O11)=MN  K((F 	7;//)'&/:zzz%FZZ6)&FZZ9,&Fn #099'5IL.09;-X;;))++		Y'#-!J
 **:6F E //'$--9:{{--//IIKE &DOO$$X.KK//0zzT///8N8N8P8P		%%%  fnn.FGfmm-EF  [[[ '+kkD#'+{{D$KK!&&(%*D"_ %U$ %UN  	KKa(?&@3<<>&QR	( ! KKa0G.H>.YZ !*- A " 0 0 @IA +**s`   }&}}#(}#}( /~* 	5 1A@(;~'&~'*-0A@@A@@A@&	c                s    VR 8X  dc   VR8X  d   W P                   n        R# VR8X  dC   V P                  '       d1   V P                  P                  4       '       d   V P	                  4        R# )lutrispreferred_themeshow_tray_iconT)r]   r   rV   Zget_visibler   )rf   Zsetting_keyZ	new_valueZsections   &&&&rG   rP   Z%LutrisApplication.on_settings_changed  sY    h//5>""2   00T[[[;;**,,&&(rJ   c                $   < V ^8  d   QhRS[ RR/# r@   r   rA   Nr   rC   rF   rG   rH   rI     s      $ 4 rJ   c                s    V P                   P                  V4       V P                  '       d;   \        P                  ! R 4      '       d   V P                  P                  4        R# R# R# )hide_client_on_game_startN)rY   appendrV   r   read_bool_settingZhiderf   r   r   rG   rN   ZLutrisApplication.on_game_start  sH    ""4(;;;8556QRRKK S;rJ   c                r   r   r   rC   rF   rG   rH   rI     s        D  T  rJ   c                sl   V P                    Uu. uF  q"P                  NK  	  ppVP                  V9   dJ   \        P                  ! RVP                  4        V P                   VP	                  VP                  4       MAV'       d$   \        P                  ! RVP                  V4       M\        P                  ! R4       V P                  '       dK   \        P                  ! R4      '       d/   V P                  '       g   V P                  P                  4        R# V P                  '       d!   V P                  P                  4       '       gQ   V P                  '       g=   V P                  '       g   V P                  4       '       g   V P                  4        R# R# R# R# u upi   \
         d     Li ; i)zFCallback to quit Lutris is last game stops while the window is hidden.zRemoving %s from running IDsz%s not in %sz/Game has already been removed from running IDs?r   N)rY   r   r2   rl   Zindexr   r   rV   r   r   r\   r   r   has_running_gameshas_tray_iconr   )rf   r   gZrunning_game_ids   &&  rG   rO   Z!LutrisApplication.on_game_stopped  s4   *.*=*=>*=QDD*=>77&&LL7A''(8(>(>tww(GH NN>4774DELLJK;;;8556QRR[_[q[q[qKKDKK$:$:$<$<))))))1C1C1E1EIIK 2F * %= ?
  s   F &F% %F32F3c                s
   V P                   '       d!   V P                   P                  4       '       gQ   V P                  '       g=   V P                  '       g   V P	                  4       '       g   V P                  4        R # R # R # R # r   )rV   r   r   r\   r   r   r   r   rG   rQ   Z"LutrisApplication.on_install_ended4  s\    {{{$++"8"8":":))))))1C1C1E1EIIK 2F * #;rJ   c                s    V P                   # r   )rW   r   r   rG   get_launch_ui_delegateZ(LutrisApplication.get_launch_ui_delegate:  s    &&&rJ   c                0   < V ^8  d   QhRS[ S[,          /# r@   rA   )r   r   rC   rF   rG   rH   rI   =  s     N N4: NrJ   c                s|    V P                    Uu. uF!  qP                  VP                  8w  g   K  VNK#  	  up# u upi r   )rY   r   r   )rf   r   r   rG   get_running_gamesZ#LutrisApplication.get_running_games=  s3      ..M.a''Q__2L.MMMs   99c                s4    \        V P                  4       4      # r   )boolr  r   r   rG   r   Z#LutrisApplication.has_running_gamesB  s    D**,--rJ   c                r  r  )r   r   rC   rF   rG   rH   rI   F  s     > >d3i >rJ   c                s^    V P                  4        Uu. uF  qP                  NK  	  up# u upi )z/Returns the ids of the games presently running.)r  r   r   r   rG   get_running_game_idsZ&LutrisApplication.get_running_game_idsF  s'    $($:$:$<=$<D$<===s   *c                &   < V ^8  d   QhRS[ RS[/# r@   game_idrA   )r   r  rC   rF   rG   rH   rI   J  s     M MS MT MrJ   c                s`    \        T;'       d    \        V4      V P                  4       9   4      # )z3True if the ID is the ID of a game that is running.)r  r   r  )rf   r	  r   rG   is_game_running_by_idZ'LutrisApplication.is_game_running_by_idJ  s'    GKKG0I0I0K KLLrJ   c                r  r  )r   r   rC   rF   rG   rH   rI   N  s      c d rJ   c                s    V P                  4        F!  pVP                  \        V4      8X  g   K  Vu # 	  \        V4      # )zReturns the game with the ID given; if it's running this is the running
game instance, and if not it's a fresh copy off the database.)r  r   r   r   )rf   r	  r   r   rG   get_game_by_idZ LutrisApplication.get_game_by_idN  s8     **,Dww#g,& - G}rJ   c                s    R RRRRRRRRRRR/pV '       d   V P                  4       p V '       d   V ^ ,          p \        V 4      pV# )r   Nr   r   r   r   r   )r   r
   )r   r   r   rG   r   Z#LutrisApplication.get_lutris_actionW  sU     dtT $
 ,,.Ca&C05NrJ   c                s    V Fm  pT P                  TR P                  VR,          VR,          R,          VR,          R,          VR,          ;'       g    RVR,          ;'       g    R4      4       Ko  	  R# )	z({:4} | {:<40} | {:<40} | {:<15} | {:<64}r   r   Ni(   Nr   r   r   	directoryNr   rD   rf   r   r   r      &&& rG   r   Z!LutrisApplication.print_game_listj  sg    DKK:AAJL%L%N))c%,,	 rJ   c                s"   . pV EF]  pVR ,          '       d   \        VR ,          R7      MRpVR,          '       d   \        P                  ! VR,          4      MRpV'       d(   \        P                  P                  V4      '       g   RpRVR,          RVR,          RVR,          RVR,          RVR,          ;'       g    RRVR,          ;'       g    RR	VR	,          ;'       g    RR V'       d   \        V4      MRR
V'       d   VP                  4       MRRVR,          '       d'   \        \        P                  ! VR,          4      4      MRRV/pVP                  V4       EK`  	  V P                  V\        P                  ! V^R7      4       R# )playtime)ZhoursNr   r   r   r   ZplatformZyearr  ZplaytimeSecondsZ
lastplayedZ	coverPathZindent)r   r-   Zget_cover_pathr^   r`   Zexistsr   Ztotal_secondsr    Zfromtimestampr   r   r   dumps)rf   r   r   r   r   r  Z
cover_pathZgame_objs   &&&     rG   r   Z!LutrisApplication.print_game_jsonw  s>   D<@<L<LytJ'78RVHCG<<11$v,?UYJ"''.."<"<!
 d4jVV$x.D,44V,,T+.66$XCM4!x8#9#9#;TRVWcRdRds8#9#9$|:L#MNjnZH LL"+ . 	L$**U1"=>rJ   c                s    V Fj  pT P                  TR P                  VR,          VR,          R,          VR,          R,          VR,          R,          VR,          '       d   RMR	4      4       Kl  	  R
# )z({:4} | {:<40} | {:<40} | {:<15} | {:<15}r   r   r  r   r   :Ni   Nrt   truefalseNr  r  r  rG   r   Z)LutrisApplication.print_service_game_list  sc    DKK:AAJL%L%OC(";//F\	 rJ   c                s    V Uu. uFD  pR VR ,          RVR,          RVR,          RVR,          RVR,          RVR,          RVR,          /NKF  	  ppV P                  V\        P                  ! V^R7      4       R# u upi )	r   r   r   r   r   rt   Zdetailsr  N)r   r   r  )rf   r   r   r   r   s   &&&  rG   r   Z)LutrisApplication.print_service_game_json  s     "
 " d4jVV4	?gT+.4	? " 	 
 	L$**U1"=>
s   A
A;c                sl   \        4       pV'       d   TM.  F  p\        V4      pV F  p\        \        P                  P                  W54      4      pT P                  TR P                  VP                  VP                  ;'       g    RRP                  VP                  4      4      4       K  	  K  	  R# )z {:8} | {:<60} | {}r   r   N)r8   r7   r6   r^   r`   ra   r   rD   Zsteamidr   Zstates)rf   r   steamapps_pathsr`   Zappmanifest_filesZappmanifest_fileZappmanifests   &&     rG   r   Z"LutrisApplication.print_steam_list  s    ,.'6OB>D 0 6$5 )"'',,t*NO )00#++#((//C		+"4"45 %6 ?rJ   c                s    \         P                  ! RV 4       \        V 4      p \        P                  ! 4       P                  4        R#   \         d    TP                  4         R# i ; i)znExecute an arbitrary command in a Lutris context
with the runtime enabled and monitored by a MonitoredCommand
zRunning command '%s'N)r2   r   r"   r   ZMainLoopZrunZKeyboardInterruptr   )r   Zmonitored_commandr   rG   r   Z!LutrisApplication.execute_command  sP    
 	*G4(1	%MMO!  	%""$	%s   #A	 	A('A(c                sb    \        4       pV'       d   V F  pV P                  W4       K  	  R # R # r   )r8   r   )rf   r   r  r`   r   rG   r   Z%LutrisApplication.print_steam_folders  s(    ,.'L/ ( rJ   c                s^    \        4       p\        VR  R7      pV F  p\        V4       K  	  R# )c                 s"    V P                  4       # r   )lower)r   r   rG   r   Z1LutrisApplication.print_runners.<locals>.<lambda>  s
    !'')rJ   )ZkeyN)r%   Zsortedr   )rf   Zrunner_namesZsorted_namesr   s   &   rG   r   ZLutrisApplication.print_runners  s(    ')l0CD D$K !rJ   c                st    \        R 4      pVR,           F  pVR,          '       g   K  \        V4       K!  	  R# )wineZversionsrk   N)r	   r   )rf   ZrunnersNamero   s   &  rG   r   Z$LutrisApplication.print_wine_runners  s.    !&)Z((A||a )rJ   c                s|    VP                  R 4      '       d   V P                  V4       R# V P                  V4       R# )r   N)r   install_wine_cliinstall_cli)rf   r   r   rG   r   Z LutrisApplication.install_runner  s/    X&&!!&)V$rJ   c                s   R V9   dK   \        R4       \        4       pVP                  4       R9   d   V P                  V4       R# \        R4       R# VP	                  R4      '       d   V P                  V4       R# V P                  V4       R# )r  zGAre sure you want to delete Wine and all of the installed runners?[Y/N]zNot Removing Winer   N)ZyZyes)r   Zinputr  uninstall_runner_clir   wine_runner_uninstall)rf   r   Zansr   rG   r   Z"LutrisApplication.uninstall_runner  sl    V[\'Cyy{l*))&1)*x((&&v.%%f-rJ   c                s   \         P                  P                  \        P                  R4      p\         P                  P                  Y! RV9   d   RMR 24      p\         P                  P                  V4      '       d   \        RV R24       R#  \        R4      pV! 4       P                  V P                  VR7       \        RV R24       R#   \        \        3 d!   p\        TP                  4        Rp?R# Rp?ii ; i)	z0
Downloads wine runner using lutris -r <runner>
r  -x86_64 Wine version '' is already installed.)rk   z' has been installed.N)r^   r`   ra   r   
RUNNER_DIRisdirr   r&   rn   rX   r#   r$   message)rf   rk   WINE_DIRrunner_pathr   exs   &&    rG   r  Z"LutrisApplication.install_wine_cli  s    
 77<< 3 3V<ggll8yyG?SYb8c-de77==%%N7)+BCD"&v.  !9!97 Kwi/DEF&(?@ "bjj!!"s   <C D!C<<Dc                st   T R V9   d   RMR  2p\         P                  P                  \        P                  R4      p\         P                  P                  W!4      p\         P                  P                  V4      '       d(   \        P                  ! V4       \        RV R24       R# \        RV R24       R# )r  r  r  r  z' has been removed.z-
Specified version of Wine is not installed: z.
Please check if the Wine Runner and specified version are installed (for that use --list-wine-versions).
Also, check that the version specified is in the correct format.
                N)	r^   r`   ra   r   r!  r"  r.   Zremove_folderr   )rf   rk   r$  r%  r   rG   r  Z'LutrisApplication.wine_runner_uninstall   s    II$8biHI77<< 3 3V<ggll8577==%%  -N7)+>?@--4I 6rJ   c                s8    \        V4      ! 4       pVP                  4       '       d   \        RV R24       R# VP                  V P                  RRR7       \        RV R24       R#   \
        \        3 d!   p\        TP                  4        Rp?R# Rp?ii ; i)z5
install the runner provided in prepare_runner_cli()
'r   N)rk   Zcallbackz' has been installed)r&   is_installedr   rn   rX   r#   r$   r#  )rf   runner_namer   r&  r   rG   r  ZLutrisApplication.install_cli  s    
	";/1F""$$+&=>?t77PTU+&:;<"$;< 	"**	s   5A( -A( (B9BBc                sX    \        V4      pV! 4       pTP	                  4       '       g   \        RT R24       R# TP                  4       '       d"   TP                  4        \        RT R24       R# \        RT R24       R#   \         d    \        P                  ! RT4        R# i ; i)zw
uninstall the runner given in application file located in lutris/gui/application.py
provided using lutris -u <runner>
zFailed to import Runner: %sNzRunner 'z' is not installed.r'  z' has been uninstalled.z' cannot be uninstalled.)r&   r#   r2   r   r(  r   Zcan_uninstallZ	uninstall)rf   r)  Zrunner_classr   r   rG   r  Z&LutrisApplication.uninstall_runner_cli  s    
	(5L!^F ""$$H[M)<=>!!Ak]"9:;H[M)ABC " 	LL6D	s   B "B)(B)c                s0   \         P                  ! R 4       V P                  '       dO   RV P                  P                  ,          p\        P
                  ! RV4       V P                  P                  4        \        P                  P                  V 4       R# )zShutting down Lutrisz%s:%sselected_categoryN)
r2   r   rV   r*  r   Zwrite_settingr   r   r   do_shutdown)rf   r*  r   rG   r+  ZLutrisApplication.do_shutdown3  sa    *+;;; '$++*G*G G""#68IJKK!##D)rJ   c                s   \         P                  ! RRR7      P                  4       R8H  pV'       d$   V P                  '       g   \	        V R7      V n        V P                  '       d   V P                  P                  V4       R# R# )z3Creates or destroys a tray icon for the applicationr   r  )Zdefaultr  r   N)r   Zread_settingr  r[   r   Zset_visible)rf   Zactiver   rG   r   ZLutrisApplication.set_tray_icon;  s[    &&'7IOOQU[[$)))(T:DI999II!!&) rJ   c                s^    V P                   ;'       d    V P                   P                  4       # r   )r[   r   r   r   rG   r   ZLutrisApplication.has_tray_iconC  s!    yy33TYY1133rJ   )
rY   rZ   rU   rS   rX   rW   r\   r]   r[   rV   r   )5r   Z
__module__Z__qualname__Z__firstlineno__rL   re   r   r   r   r   r   r   ZINSTALLr   r   r   Zstaticmethodr   r   r   rP   rN   rO   rQ   r  r  Zpropertyr   r  r
  r  r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r+  r   r   Z__static_attributes__Z__classdictcell__Z__classcell__)rh   rE   s   @@rG   r=   r=   D   sc    ,b ,b\W
r	7yB B
 D 9=D\l\t\t 

	P C C	Rh
 
   * 'N N
 . .> >M M   $?8? 	% 	%0%."" D(**4 4rJ   r=   )hr   r   r^   r   r_   r   r    r   r   rR   Ztypingr   r   ZgiZrequire_versionZgi.repositoryr   r   r   r   r   Z
lutris.apir	   r
   Zlutris.databaser   r   Zlutris.database.servicesr   Zlutris.exception_backstopsr   Zlutris.gamer   r   r   r   r   Zlutris.gui.dialogsr   r   r   r   Zlutris.gui.dialogs.delegatesr   r   r   Zlutris.gui.dialogs.issuer   Zlutris.gui.installerwindowr   r   r   r   Zlutris.gui.widgets.status_iconr   Zlutris.installerr    Zlutris.migrationsr!   Zlutris.monitored_commandr"   Zlutris.runnersr#   r$   r%   r&   Zlutris.servicesr'   Zlutris.startupr(   r)   Zlutris.style_managerr*   Zlutris.utilr+   r,   r-   r.   Zlutris.util.httpr/   r0   Zlutris.util.logr1   r2   Zlutris.util.savesyncr3   r4   r5   Zlutris.util.steam.appmanifestr6   r7   Zlutris.util.steam.configr8   Z	util.busyr9   Zutil.standalone_scriptsr:   Zlutriswindowr;   r   rb   r<   r   r=   rB   rJ   rG   <module>r,     s   &   	  
  (   ! 	   5%     5%   ( (  7 - : ? P P \ \ c c 6 u u ; + % 1 g g 0 6 - 8 8 / 0 I I G 7 % 5 &')zz~~6\']ad'd $@4 @4rJ   