Coverage for lutris.runners.winesteam : 37%

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
# -*- coding:Utf-8 -*-
# Redefine wine installer tasks
return bool(system.get_pid('Steam.exe'))
""" Shutdown Steam in a clean way. TODO: Detect wine binary """ pid = system.get_pid('Steam.exe') if not pid: return False cwd = system.get_cwd(pid) cmdline = system.get_command_line(pid) steam_exe = os.path.join(cwd, cmdline) logger.debug("Shutting winesteam: %s", steam_exe) system.execute(['wine', steam_exe, '-shutdown'])
system.kill_pid(system.get_pid('Steam.exe'))
# pylint: disable=C0103 """ Runs Steam for Windows games """
#installer_url = "http://cdn.steampowered.com/download/SteamInstall.msi"
{'option': 'appid', 'type': 'string', 'label': 'appid'}, {'option': 'args', 'type': 'string', 'label': 'arguments'}, {'option': 'prefix', 'type': 'directory_chooser', 'label': 'Prefix'} ]
if installer_path: self.msi_exec(installer_path, quiet=True) Gdk.threads_enter() dlg = DirectoryDialog('Where is Steam.exe installed?') self.game_path = dlg.folder Gdk.threads_leave() config = LutrisConfig(runner='winesteam') config.runner_config = {'system': {'game_path': self.game_path}} config.save(config_type='runner')
""" Checks if wine is installed and if the steam executable is on the harddrive. """ if not self.check_depends() or not self.game_path: return False return self.game_path and os.path.exists(self.steam_path)
def steam_path(self): return os.path.join(self.game_path, "Steam.exe")
def launch_args(self): return [self.get_wine_path(), '"%s"' % self.steam_path, '-no-dwrite']
if not self.game_path: return return read_config(self.game_path)
"""Return the list of appids of all user's games""" config = self.get_steam_config() if config: apps = config['apps'] return apps.keys()
steam_config = self.get_steam_config() return get_path_from_config(steam_config, appid)
subprocess.Popen(self.launch_args + ["steam://install/%s" % appid])
subprocess.Popen(self.launch_args + ["steam://validate/%s" % appid])
from lutris.runners import steam if steam.is_running(): steam.shutdown() logger.info("Waiting for Steam to shutdown...") time.sleep(2) if steam.is_running(): logger.info("Steam does not shutdown, killing it...") steam.kill() time.sleep(2) if steam.is_running(): logger.error("Failed to shutdown Steam for Windows :(") return False return True
if not self.check_depends(): return {'error': 'RUNNER_NOT_INSTALLED', 'runner': self.depends} if not self.is_installed(): return {'error': 'RUNNER_NOT_INSTALLED', 'runner': self.__class__.__name__}
appid = self.settings['game'].get('appid', '') args = self.settings['game'].get('args', '') logger.debug("Checking Steam installation") self.prepare_launch() command = ["WINEDEBUG=fixme-all"] prefix = self.settings['game'].get('prefix', "") if os.path.exists(prefix): command.append("WINEPREFIX=\"%s\" " % prefix) command += self.launch_args if appid: command += ['-applaunch', appid] if args: command += [args] return {'command': command}
shutdown() |