Be more lenient with Flatpak options

This commit is contained in:
Mathieu Comandon 2023-10-18 16:58:50 -07:00
parent a1319a82dd
commit 6b3cacb33b

View file

@ -102,20 +102,16 @@ class flatpak(Runner):
return False
def uninstall(self):
pass
"""Flatpak can't be uninstalled from Lutris"""
@property
def game_path(self):
if shutil.which("flatpak-spawn"):
return "/"
try:
install_type, application, arch, branch = (
self.game_config[key] for key in ("install_type", "appid", "arch", "branch")
)
except KeyError as err:
raise RuntimeError("The game_path of a flatpak game cannot be generated due to a missing configuration "
"element: %s" % str(err)) from err
return os.path.join(self.install_locations[install_type], application, arch, branch)
install_type, application, arch, branch = (
self.game_config.get(key, "") for key in ("install_type", "appid", "arch", "branch")
)
return os.path.join(self.install_locations[install_type or "user"], application, arch, branch)
def remove_game_data(self, app_id=None, game_path=None, **kwargs):
if not self.is_installed():