Skip to content

Commit 613682c

Browse files
chore: ruff format
1 parent 5ca6fc9 commit 613682c

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

umu/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ def parse_args() -> Namespace | tuple[str, list[str]]: # noqa: D103
3333
version=f"umu-launcher version {__version__} ({sys.version})",
3434
help="show this version and exit",
3535
)
36-
parser.add_argument("--config", help=("path to TOML file (requires Python 3.11+)"))
36+
parser.add_argument("--config", help="path to TOML file (requires Python 3.11+)")
3737
parser.add_argument(
3838
"winetricks",
39-
help=("run winetricks verbs (requires UMU-Proton or GE-Proton)"),
39+
help="run winetricks verbs (requires UMU-Proton or GE-Proton)",
4040
nargs="?",
4141
default=None,
4242
)

umu/umu_run.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,9 @@ def build_command(
377377
)
378378

379379
nsenter: tuple[str, ...] = ()
380-
if (launch_client := layer.launch_client) and env.get("UMU_CONTAINER_NSENTER") == "1":
380+
if (launch_client := layer.launch_client) and env.get(
381+
"UMU_CONTAINER_NSENTER"
382+
) == "1":
381383
# launch_client is provided by the runtime layer (not arbitrary user input).
382384
# Resolve via PATH when needed so we execute a concrete binary.
383385
exe_path: str
@@ -392,9 +394,7 @@ def build_command(
392394

393395
attempts: int = 5
394396
for trial in range(attempts):
395-
with Popen(
396-
[exe_path, "--list"], stdout=PIPE, stderr=PIPE
397-
) as proc: # nosec B603
397+
with Popen([exe_path, "--list"], stdout=PIPE, stderr=PIPE) as proc: # nosec B603
398398
out, err = proc.communicate()
399399
bus_names = out.decode("utf-8").splitlines()
400400
pfx_bus = "com.steampowered.App" + env["STEAM_COMPAT_APP_ID"]
@@ -761,14 +761,19 @@ def resolve_runtime() -> UmuRuntime:
761761
os.environ["PROTONPATH"] = ProtonVersion.UMULatest.value
762762

763763
named_runtimes = {
764-
RUNTIME_NAMES["steamrt4"]: { ProtonVersion.UMUSteamRT4.value },
765-
RUNTIME_NAMES["steamrt4-arm64"]: { ProtonVersion.UMUSteamRT4_arm64.value },
764+
RUNTIME_NAMES["steamrt4"]: {ProtonVersion.UMUSteamRT4.value},
765+
RUNTIME_NAMES["steamrt4-arm64"]: {ProtonVersion.UMUSteamRT4_arm64.value},
766766
RUNTIME_NAMES["sniper"]: {
767-
ProtonVersion.UMUSniper.value, ProtonVersion.UMULatest.value,
768-
ProtonVersion.GEProton.value, ProtonVersion.GELatest.value,
767+
ProtonVersion.UMUSniper.value,
768+
ProtonVersion.UMULatest.value,
769+
ProtonVersion.GEProton.value,
770+
ProtonVersion.GELatest.value,
771+
},
772+
RUNTIME_NAMES["sniper-arm64"]: {ProtonVersion.UMUSniper_arm64.value},
773+
RUNTIME_NAMES["soldier"]: {
774+
ProtonVersion.UMUScout.value,
775+
ProtonVersion.UMUSoldier.value,
769776
},
770-
RUNTIME_NAMES["sniper-arm64"]: { ProtonVersion.UMUSniper_arm64.value },
771-
RUNTIME_NAMES["soldier"]: { ProtonVersion.UMUScout.value, ProtonVersion.UMUSoldier.value },
772777
}
773778

774779
for name in named_runtimes:
@@ -794,9 +799,7 @@ def resolve_runtime() -> UmuRuntime:
794799
layer = CompatLayer(toolmanifest.parent, Path())
795800
runtime = layer.required_runtime
796801
else:
797-
err: str = (
798-
f"PROTONPATH '{os.environ['PROTONPATH']}' is not valid, toolmanifest.vdf not found"
799-
)
802+
err: str = f"PROTONPATH '{os.environ['PROTONPATH']}' is not valid, toolmanifest.vdf not found"
800803
raise FileNotFoundError(err)
801804

802805
return runtime

umu/umu_runtime.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,10 @@ def _unwrapped_cmd(self, verb: str) -> list[str]:
624624
tool_path = os.path.normpath(self.tool_path)
625625
cmd = "".join([shlex.quote(tool_path), self.tool_manifest["commandline"]])
626626
# Temporary override entry point for backwards compatibility
627-
if self.layer_name == "container-runtime" and Path(tool_path).joinpath("umu").is_file():
627+
if (
628+
self.layer_name == "container-runtime"
629+
and Path(tool_path).joinpath("umu").is_file()
630+
):
628631
cmd = cmd.replace("_v2-entry-point", "umu")
629632
cmd = cmd.replace("%verb%", verb)
630633
return shlex.split(cmd)

0 commit comments

Comments
 (0)