+
    Kif  c                   s    ^ RI t ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIH	t	H
t
 ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt  ! R R]4      tR# )i    N)gettext)PathCallable)GameConfigErrorMissingExecutableError)MonitoredCommand)NonInstallableRunnerError)Runner)flatpak)system)split_argumentsc                   s|  a  ] tR t^t o Rt]! R4      t]! R4      .tRt]! R4      t	Rt
RRR	R
/.tRRR]P                  ! 4        R2/tRRRRR]! R4      R]! R4      /RRRRR]! R4      R]! R4      RR
/RRRRR]! R4      R]! R4      RR
/RRRRR]! R4      R]! R4      RR
/RR RRR]! R!4      R]! R"4      /RR#RRR]! R$4      R]! R%4      RR
/RR&RR'R]! R(4      R)R
R]! R*4      RR
/RR+RRR]! R,4      R]! R-4      RR
/.tR<V 3R. lR/ lltV 3R0 lR1 ltR=R3 ltR4 tV 3R5 lR6 lt]R7 4       tR=R8 ltR9 tR: tR;tV tR2# )>r	   z"
Runner for Flatpak applications.
zRuns Flatpak applicationsZLinuxapplicationZFlatpakFZoptionZdisable_runtimeZdefaultTr
   zvar/lib/flatpak/app/userz/.local/share/flatpak/app/appidZtypeZstringZlabelzApplication IDZhelpz@The application's unique three-part identifier (tld.domain.app).archZArchitecturez`The architecture to run. See flatpak --supported-arches for architectures supported by the host.ZadvancedbranchZBranchzThe branch to use.install_typezInstall typezCan be system or user.argsZArgsz*Arguments to be passed to the application.fcommandZCommandzIThe command to run instead of the one listed in the application metadata.Zworking_dirZ	directoryzWorking directoryZwarn_if_non_writable_parentz[The directory to run the command in. Note that this must be a directory inside the sandbox.Zenv_varszEnvironment variablesztSet an environment variable in the application. This overrides to the Context section from the application metadata.c                s&   < V ^8  d   QhRS[ RS[ /# )   flatpak_allowedreturn)ZboolZformat__classdict__   ";/usr/lib/python3.14/site-packages/lutris/runners/flatpak.py__annotate__flatpak.__annotate__V   s     ' 'D 'D '    c                s,    \         P                  ! 4       # N)_flatpakis_installed)selfr      &&r   r    Zflatpak.is_installedV   s    $$&&r   c                s    < V ^8  d   QhRS[ /# )r   r   )Zstrr   r   r   r   r   Y   s       r   c                s    \         P                  ! 4       p\        P                  ! V4      '       g   \	        \        R 4      4      hV# )z*The Flatpak executable could not be found.)r   get_executabler
   Zpath_existsr   _)r!   Zexes   & r   r#   Zflatpak.get_executableY   s7    %%'!!#&&(+W)XYY
r   Nc                s*    \        \        R 4      4      h)znFlatpak installation is not handled by Lutris.
Install Flatpak with the package provided by your distribution.)r   r$   )r!   Zinstall_ui_delegateZversionZcallbacks   &&&&r   installZflatpak.install_   s    'R
 	
r   c                s    R # )F )r!   s   &r   can_uninstallZflatpak.can_uninstallg   s    r   c                s6   < V ^8  d   QhRS[ . R3,          RR/# )r   uninstall_callbackNr   r   r   r   r   r   r   j   s(     G GHRX,> G4 Gr   c                s    \        R 4      h)z(Flatpak can't be uninstalled from Lutris)ZRuntimeError)r!   r(   r"   r   	uninstallZflatpak.uninstallj   s    EFFr   c                s   a  \         P                  ! R 4      '       d   R# V 3R lR 4       w  rr4p\        P                  P	                  S P
                  T;'       g    R,          W#WE4      # )zflatpak-spawn/c              3   s\   <"   T F!  pSP                   P                  VR 4      x  K#  	  R# 5i) N)game_configget).0Zkeyr!      & r   	<genexpr>Z$flatpak.game_path.<locals>.<genexpr>q   s+      =
5lcD  b))5ls   ),r   )r   r   r   r   r   )shutilZwhichosZpathZjoininstall_locations)r!   r   r   r   r   r   s   f     r   	game_pathZflatpak.game_pathm   sX    <<((=
5l=
946 ww||D22<3I3I6JK_gppr   c                s    V P                  4       '       g   R # \        V P                  4       RV 2.V V P                  4       RV 2R7      pVP	                  4        R# )Fz!uninstall --app --noninteractive zUninstalling Flatpak App: )ZrunnerZenvZtitleN)r    r   r#   Zget_envZstart)r!   Zapp_idr4   Zkwargscommands   &&&, r   remove_game_dataZflatpak.remove_game_datav   sX      """  "&Gx$PQ.vh7	
 	r   c                s    V P                   P                  R R4      pV P                   P                  RR4      pV P                   P                  RR4      p\        P                  ! WV4      # )r   r+   r   r   )r,   r-   r   Zget_bare_run_command)r!   r   r   r   s   &   r   get_commandZflatpak.get_command   s]    ##FB/!!%%h3##''
B7,,TVDDr   c                s$  a V P                   P                  R R4      oV P                   P                  RR4      pS'       g   \        \        R4      4      hSP	                  R4      ^8  d   \        \        R4      4      h\
        ;QJ d    V3R lR 4       F  '       g   K   RM	  RM! V3R lR 4       4      '       d   \        \        R	4      4      hV P                  4       S.,           pV'       d   VP                  \        V4      4       R
V/# )r   r+   r   zNo application specified.Z.zXApplication ID is not specified in correct format.Must be something like: tld.domain.appc              3   s,   <"   T F	  qS9   x  K  	  R # 5ir   r&   )r.   Zxr   r/   r   r0   Zflatpak.play.<locals>.<genexpr>   s     /;aEz;s   TFz;Application ID field must not contain options or arguments.r5   )z--r*   )	r,   r-   r   r$   ZcountZanyr7   Zextendr   )r!   r   r5   r   s   &  @r   playZflatpak.play   s      $$Wb1##FB/!!$?"@AA;;sa!lm  3/;/333/;///!!$a"bcc""$w.NN?4017##r   r&   )T)NN)Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__r$   ZdescriptionZ	platformsZentry_point_optionZ
human_nameZrunnable_aloneZsystem_options_overrider   Zhomer3   Zgame_optionsr    r#   r%   r'   r)   Zpropertyr4   r6   r7   r8   Z__static_attributes__Z__classdictcell__)r   s   @r   r	   r	      s     /0K7I&9JN (*;YMN!#96diik]RlCmn gHQ'(AXY		
 fHQ~&Ar 	
 
8VXw(VQOcMdfprvwnHQ~&A./	
 fHQvYABC		
 jHQy\Aab	
 mKQ*+)4Ast	
 jHQ./AW 		
[7Lr' ' 
G G q q	E$ $r   r	   )r2   r1   r    r$   Zpathlibr   Ztypingr   Zlutris.exceptionsr   r   Zlutris.monitored_commandr   Zlutris.runnersr   Zlutris.runners.runnerr   Zlutris.utilr	   r   r
   Zlutris.util.stringsr   r&   r   r   <module>r9      s7    	      E 5 4 ( +  /I$f I$r   