def launch(self, **kwargs):
        executable_path = kwargs.get("executable_path")

        if executable_path is None:
            raise GameLauncherException(
                "An 'executable_path' kwarg is required...")

        if is_linux():
            subprocess.Popen(shlex.split(executable_path))
        elif is_windows():
            subprocess.Popen(shlex.split(executable_path))
Exemplo n.º 2
0
    def launch(self, **kwargs):
        url = kwargs.get("url")
        browser = kwargs.get("browser") or WebBrowser.DEFAULT

        if url is None:
            raise GameLauncherException("An 'url' kwarg is required...")

        if is_linux():
            webbrowser.get(self.web_browsers.get(browser.name)).open_new(url)
        elif is_windows():
            webbrowser.get(self.web_browsers.get(browser.name)).open_new(url)
    def launch(self, **kwargs):
        executable_path = kwargs.get("executable_path")

        if executable_path is None:
            raise GameLauncherException(
                "An 'executable_path' kwarg is required...")

        if sys.platform in ["linux", "linux2"]:
            subprocess.Popen(shlex.split(executable_path))
        elif sys.platform == "darwin":
            subprocess.Popen(shlex.split(executable_path))
        elif sys.platform == "win32":
            subprocess.Popen(shlex.split(executable_path))
Exemplo n.º 4
0
    def launch(self, **kwargs):
        executable_path = kwargs.get("executable_path")
        current_work_directory = kwargs.get("current_work_directory")

        if executable_path is None:
            raise GameLauncherException(
                "An 'executable_path' kwarg is required...")

        if is_linux():
            subprocess.Popen(shlex.split(executable_path),
                             cwd=current_work_directory)
        elif is_macos():
            subprocess.Popen(shlex.split(executable_path),
                             cwd=current_work_directory)
        elif is_windows():
            subprocess.Popen(shlex.split(executable_path),
                             cwd=current_work_directory)
Exemplo n.º 5
0
    def launch(self, **kwargs):
        app_id = kwargs.get("app_id")
        app_args = kwargs.get("app_args")

        if app_id is None:
            raise GameLauncherException("An 'app_id' kwarg is required...")

        protocol_string = f"steam://run/{app_id}"

        if app_args is not None:
            args_list = [f"--{k}={v}" for k, v in app_args.items()]
            protocol_string += "/en/" + " ".join(args_list)

        if is_linux():
            subprocess.call(shlex.split(f"xdg-open '{protocol_string}'"))
        elif is_windows():
            webbrowser.open(f"{protocol_string}")