Coverage for lutris.runners.winesteam : 52%

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 """ 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'])
# 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. """ return self.game_path and os.path.exists(self.steam_path)
def steam_path(self):
def launch_args(self):
if not self.game_path:
"""Return the list of appids of all user's games""" if config: 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])
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(): steam.kill() time.sleep(2) if steam.is_running(): logger.error("Failed to shutdown Steam for Windows :(") return False
if not self.check_depends(): return {'error': 'RUNNER_NOT_INSTALLED', 'runner': self.depends} if not self.is_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"] 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}
|