From 88434db29aa09c7175cece250bb39d4df75e4035 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 10 Jun 2024 15:31:15 +0200 Subject: [PATCH] lint fix --- rwx/__main__.py | 1 - rwx/cmd/__init__.py | 5 ++--- rwx/cmd/squashfs/__init__.py | 1 + rwx/deb/__init__.py | 1 + rwx/grub/__init__.py | 1 + rwx/log/__init__.py | 2 ++ rwx/prj/sphinx.py | 1 + 7 files changed, 8 insertions(+), 4 deletions(-) diff --git a/rwx/__main__.py b/rwx/__main__.py index 0f15b2e..a857803 100755 --- a/rwx/__main__.py +++ b/rwx/__main__.py @@ -4,7 +4,6 @@ import os import fs - if __name__ == "__main__": file_path = os.path.realpath(__file__) root_path = os.path.dirname(file_path) diff --git a/rwx/cmd/__init__.py b/rwx/cmd/__init__.py index 6ecb47c..de764fa 100644 --- a/rwx/cmd/__init__.py +++ b/rwx/cmd/__init__.py @@ -10,6 +10,5 @@ def need(command: str) -> None: package = "squashfs-tools" case _: package = None - if package: - if package not in packages: - packages.append(package) + if package and package not in packages: + packages.append(package) diff --git a/rwx/cmd/squashfs/__init__.py b/rwx/cmd/squashfs/__init__.py index 4f793ca..343461e 100644 --- a/rwx/cmd/squashfs/__init__.py +++ b/rwx/cmd/squashfs/__init__.py @@ -1,4 +1,5 @@ import ps + import rwx.cmd rwx.cmd.need("mksquashfs") diff --git a/rwx/deb/__init__.py b/rwx/deb/__init__.py index bfb8a2f..e9c6a9e 100644 --- a/rwx/deb/__init__.py +++ b/rwx/deb/__init__.py @@ -1,4 +1,5 @@ import cmd + import ps cmd.need("debootstrap") diff --git a/rwx/grub/__init__.py b/rwx/grub/__init__.py index 7690a49..57e313c 100644 --- a/rwx/grub/__init__.py +++ b/rwx/grub/__init__.py @@ -1,4 +1,5 @@ import cmd + import ps cmd.need("grub-mkimage") diff --git a/rwx/log/__init__.py b/rwx/log/__init__.py index a567492..3502ab5 100644 --- a/rwx/log/__init__.py +++ b/rwx/log/__init__.py @@ -1,5 +1,7 @@ import logging import sys + + def get_file_logger(name: str) -> logging.Logger: formatter = logging.Formatter( "%(name)s: %(asctime)s | %(levelname)s | %(filename)s:%(lineno)s | %(process)d >>> %(message)s", diff --git a/rwx/prj/sphinx.py b/rwx/prj/sphinx.py index a71bc35..ccb8d0f 100644 --- a/rwx/prj/sphinx.py +++ b/rwx/prj/sphinx.py @@ -1,4 +1,5 @@ from os import path + from sphinx.cmd.build import build_main from rwx.fs import wipe