Skip to content

Commit

Permalink
ulwgl_run.py: fix long strings to not exceed the 100th column
Browse files Browse the repository at this point in the history
  • Loading branch information
loathingKernel committed Feb 19, 2024
1 parent 65b661f commit 3d8942a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
4 changes: 2 additions & 2 deletions ulwgl_dl_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ def _get_from_steamcompat(
# Notify the user that they're not using the latest
if proton_dir and proton.name != proton_dir:
print(
"ULWGL-Proton is outdated.\nFor latest release, please download "
+ files[1][1],
"ULWGL-Proton is outdated.\n"
"For latest release, please download " + files[1][1],
file=sys.stderr
)

Expand Down
30 changes: 18 additions & 12 deletions ulwgl_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
def parse_args() -> Union[Namespace, Tuple[str, List[str]]]: # noqa: D103
opt_args: Set[str] = {"--help", "-h", "--config"}
exe: str = Path(__file__).name
usage: str = f"""
example usage:
WINEPREFIX= GAMEID= PROTONPATH= {exe} /home/foo/example.exe
WINEPREFIX= GAMEID= PROTONPATH= {exe} /home/foo/example.exe -opengl
WINEPREFIX= GAMEID= PROTONPATH= {exe} ""
WINEPREFIX= GAMEID= PROTONPATH= PROTON_VERB= {exe} /home/foo/example.exe
WINEPREFIX= GAMEID= PROTONPATH= STORE= {exe} /home/foo/example.exe
{exe} --config /home/foo/example.toml
"""
usage: str = (
"example usage:\n"
f" WINEPREFIX= GAMEID= PROTONPATH= {exe} /home/foo/example.exe\n"
f" WINEPREFIX= GAMEID= PROTONPATH= {exe} /home/foo/example.exe -opengl\n"
f" WINEPREFIX= GAMEID= PROTONPATH= {exe} \"\"\n"
f" WINEPREFIX= GAMEID= PROTONPATH= PROTON_VERB= {exe} /home/foo/example.exe\n"
f" WINEPREFIX= GAMEID= PROTONPATH= STORE= {exe} /home/foo/example.exe\n"
f" {exe} --config /home/foo/example.toml\n"
)
parser: ArgumentParser = argparse.ArgumentParser(
description="Unified Linux Wine Game Launcher",
epilog=usage,
Expand All @@ -34,7 +34,8 @@ def parse_args() -> Union[Namespace, Tuple[str, List[str]]]: # noqa: D103
parser.add_argument("--config", help="path to TOML file")

if not sys.argv[1:]:
err: str = "Please see project README.md for more info and examples.\nhttps://github.com/Open-Wine-Components/ULWGL-launcher"
err: str = ("Please see project README.md for more info and examples.\n"
"https://github.com/Open-Wine-Components/ULWGL-launcher")
parser.print_help(sys.stderr)
raise SystemExit(err)

Expand Down Expand Up @@ -98,7 +99,8 @@ def check_env(
# Check for empty keys
for key, val in toml[table].items():
if not val and isinstance(val, str):
err: str = f"Value is empty for '{key}' in TOML.\nPlease specify a value or remove the following entry:\n{key} = {val}"
err: str = (f"Value is empty for '{key}' in TOML.\n"
f"Please specify a value or remove the following entry:\n{key} = {val}")
raise ValueError(err)

return toml
Expand Down Expand Up @@ -128,7 +130,11 @@ def check_env(

# If download fails/doesn't exist in the system, raise an error
if not os.environ["PROTONPATH"]:
err: str = "Download failed.\nProton could not be found in cache or compatibilitytools.d\nPlease set $PROTONPATH or visit https://github.com/Open-Wine-Components/ULWGL-Proton/releases"
err: str = (
"Download failed.\n"
"Proton could not be found in cache or compatibilitytools.d\n"
"Please set $PROTONPATH or visit https://github.com/Open-Wine-Components/ULWGL-Proton/releases"
)
raise FileNotFoundError(err)

return env
Expand Down

0 comments on commit 3d8942a

Please sign in to comment.