From 2ad223fa834645974806ddc663fe98a69849342f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 14 Sep 2024 00:07:34 +0200 Subject: [PATCH 1/3] grub/extra --- rwx/grub/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rwx/grub/__init__.py b/rwx/grub/__init__.py index accec9f..21b2bf5 100644 --- a/rwx/grub/__init__.py +++ b/rwx/grub/__init__.py @@ -35,6 +35,6 @@ def make_image( if pubkey_path: args.append(("--pubkey", pubkey_path)) args.extend(modules) - if modules := MODULES.get(image_format): - args.extend(modules) + if extra_modules := MODULES.get(image_format): + args.extend(extra_modules) ps.run(*args) From 68cbe3cd88db3d39652a831e277c12a1bdb342e7 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 14 Sep 2024 00:13:59 +0200 Subject: [PATCH 2/3] mypy/ps --- rwx/ps/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rwx/ps/__init__.py b/rwx/ps/__init__.py index e18e250..0bbab9c 100644 --- a/rwx/ps/__init__.py +++ b/rwx/ps/__init__.py @@ -9,10 +9,11 @@ def get_tuples_args(*items: str | tuple[str, ...]) -> list[str]: """Turn arguments tuples into an arguments list.""" args: list[str] = [] for item in items: - if type(item) is tuple: - args.extend(item) - else: - args.append(item) + match item: + case str(): + args.append(item) + case tuple(): + args.extend(item) return args From d4d60982415d69ab5e4759c6cd62e5db27866d02 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 14 Sep 2024 00:17:17 +0200 Subject: [PATCH 3/3] mypy/grub --- rwx/grub/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rwx/grub/__init__.py b/rwx/grub/__init__.py index 21b2bf5..7c0cccc 100644 --- a/rwx/grub/__init__.py +++ b/rwx/grub/__init__.py @@ -25,8 +25,8 @@ def make_image( pubkey_path: str | None = None, ) -> None: """Make a binary bootable image.""" - args = [ - ("grub-mkimage",), + args: list[str | tuple[str, ...]] = [ + "grub-mkimage", ("--compress", COMPRESSION), ("--format", image_format), ("--output", image_path),