Coverage for lutris.runners.steam : 49%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
read_config, get_default_acf, to_vdf)
""" Cleanly quit Steam """ logger.debug("Shutting down Steam")
""" Force quit Steam """
""" Checks if Steam is running """
""" Runs Steam for Linux games """ { "option": 'appid', 'label': "Application ID", "type": "string", } ] { "option": "steam_path", "type": "file", 'label': "Steam executable", "default_path": "steam", } ]
runner_config = self.settings.get(runner) or {} return runner_config.get('steam_path', 'steam')
""" Return location of Steam directory """ return os.path.expanduser('~/.local/share/Steam')
steam_path = self.get_game_path() data_path = get_path_from_appmanifest(steam_path, appid) steam_config = self.get_steam_config() data_path = get_path_from_config(steam_config, appid) logger.warning("Data path for SteamApp %s not found.", appid) return data_path
return read_config(self.get_game_path())
for opt in self.runner_options if opt["option"] == "steam_path"][0] if os.path.exists(steam_default_path): self.settings["runner"]["steam_path"] = steam_default_path else: super(steam, self).install()
return bool(system.find_executable(self.get_steam_path()))
acf_data = get_default_acf(appid, appid) acf_content = to_vdf(acf_data) acf_path = os.path.join(self.get_game_path(), "SteamApps", "appmanifest_%s.acf" % appid) with open(acf_path, "w") as acf_file: acf_file.write(acf_content) shutdown() time.sleep(5) else: logger.debug("Steam not running") subprocess.Popen(["steam", "steam://preload/%s" % appid])
from lutris.runners import winesteam if winesteam.is_running(): winesteam.shutdown() logger.info("Waiting for Steam to shutdown...") time.sleep(2) if winesteam.is_running(): logger.info("Steam does not shutdown, killing it...") winesteam.kill() time.sleep(2) logger.error("Failed to shutdown Steam for Windows :(") return False else: return True
appid = self.settings.get('game', {}).get('appid') return {'command': [self.get_steam_path(), '-applaunch', appid]}
shutdown() |