ruff/format

This commit is contained in:
Marc Beninca 2024-06-12 14:46:34 +02:00
parent 7d0ffb8a65
commit 0a035f2cd6
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
5 changed files with 35 additions and 15 deletions

View file

@ -1,2 +1,3 @@
"""Read Write eXecute.""" """Read Write eXecute."""
__version__ = "0.0.1" __version__ = "0.0.1"

View file

@ -6,10 +6,14 @@ rwx.cmd.need("mksquashfs")
def mksquashfs(input_root: str, output_file: str): def mksquashfs(input_root: str, output_file: str):
ps.run([ ps.run(
[
"mksquashfs", "mksquashfs",
input_root, input_root,
output_file, output_file,
"-comp", "zstd", "-comp",
"-Xcompression-level", str(18), "zstd",
]) "-Xcompression-level",
str(18),
]
)

View file

@ -17,8 +17,13 @@ MODULES = {
} }
def make_image(image_format: str, image_path: str, modules: list[str], def make_image(
memdisk_path: str, pubkey_path: str | None = None) -> None: image_format: str,
image_path: str,
modules: list[str],
memdisk_path: str,
pubkey_path: str | None = None,
) -> None:
args = [ args = [
("grub-mkimage",), ("grub-mkimage",),
("--compress", COMPRESSION), ("--compress", COMPRESSION),

View file

@ -16,6 +16,8 @@ def get_file_logger(name: str) -> logging.Logger:
logger.setLevel(logging.INFO) logger.setLevel(logging.INFO)
# #
return logger return logger
def get_stream_logger() -> logging.Logger: def get_stream_logger() -> logging.Logger:
out_handler = logging.StreamHandler(stream=sys.stdout) out_handler = logging.StreamHandler(stream=sys.stdout)
out_handler.setLevel(logging.INFO) out_handler.setLevel(logging.INFO)
@ -25,4 +27,6 @@ def get_stream_logger() -> logging.Logger:
logger.setLevel(logging.INFO) logger.setLevel(logging.INFO)
# #
return logger return logger
stream = get_stream_logger() stream = get_stream_logger()

View file

@ -15,12 +15,18 @@ class SphinxProject(Project):
wipe(output_root) wipe(output_root)
arguments: list[str] = [ arguments: list[str] = [
"-E", "-E",
"-j", "2", "-j",
"-b", "html", "2",
"-D", f"project={self.name}", "-b",
"-D", "master_doc={}".format("index"), "html",
"-D", "html_theme={}".format("sphinx_rtd_theme"), "-D",
"-c", self.root, f"project={self.name}",
"-D",
"master_doc={}".format("index"),
"-D",
"html_theme={}".format("sphinx_rtd_theme"),
"-c",
self.root,
# "-C", # "-C",
path.join(self.root, self.name), path.join(self.root, self.name),
path.join(output_root, self.name), path.join(output_root, self.name),