From 5112761af5b451bb369f1b89c35049bc6c67c387 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 16 Feb 2024 21:31:38 +0100 Subject: [PATCH] lint --- cmd/debootstrap/__init__.py | 4 ++-- cmd/squashfs/__init__.py | 4 ++-- fs/__init__.py | 2 +- grub/__init__.py | 5 ++++- project/__init__.py | 2 +- ps/__init__.py | 6 +++--- txt/__init__.py | 2 +- 7 files changed, 14 insertions(+), 11 deletions(-) diff --git a/cmd/debootstrap/__init__.py b/cmd/debootstrap/__init__.py index f716a3e..a2ac674 100644 --- a/cmd/debootstrap/__init__.py +++ b/cmd/debootstrap/__init__.py @@ -1,5 +1,5 @@ -from ... import cmd -from ... import ps +import cmd +import ps cmd.need('debootstrap') diff --git a/cmd/squashfs/__init__.py b/cmd/squashfs/__init__.py index 8f4b788..2d878e9 100644 --- a/cmd/squashfs/__init__.py +++ b/cmd/squashfs/__init__.py @@ -1,5 +1,5 @@ -from ... import cmd -from ... import ps +import cmd +import ps cmd.need('mksquashfs') diff --git a/fs/__init__.py b/fs/__init__.py index 73dd8f0..c222320 100644 --- a/fs/__init__.py +++ b/fs/__init__.py @@ -2,7 +2,7 @@ import os import shutil import subprocess -from .. import ps +import ps CHARSET = 'UTF-8' diff --git a/grub/__init__.py b/grub/__init__.py index 3cd293d..1d5cf4a 100644 --- a/grub/__init__.py +++ b/grub/__init__.py @@ -1,4 +1,7 @@ -from .. import ps +import cmd +import ps + +cmd.need('grub-mkimage') COMPRESSION = 'xz' ENV_BYTES = 1024 diff --git a/project/__init__.py b/project/__init__.py index b03f2c4..4fadc71 100644 --- a/project/__init__.py +++ b/project/__init__.py @@ -10,4 +10,4 @@ class Project: def from_root_file(file_path: str): project_file = os.path.realpath(file_path) project_root = os.path.dirname(project_file) - return Project(real_file) + return Project(project_root) diff --git a/ps/__init__.py b/ps/__init__.py index ddbfb72..c656369 100644 --- a/ps/__init__.py +++ b/ps/__init__.py @@ -1,6 +1,6 @@ import subprocess -from .. import txt +import txt def get_tuples_args(tuples) -> list[str]: @@ -17,12 +17,12 @@ def run(*tuples) -> subprocess.CompletedProcess: return subprocess.run(get_tuples_args(tuples), capture_output=False) -def run_line(*tuples, charset:str=txt.CHARSET) -> str: +def run_line(*tuples, charset:str = txt.CHARSET) -> str: lines = run_lines(*get_tuples_args(tuples), charset=charset) return lines[0] -def run_lines(*tuples, charset:str=txt.CHARSET) -> list[str]: +def run_lines(*tuples, charset:str = txt.CHARSET) -> list[str]: process = subprocess.run(get_tuples_args(tuples), capture_output=True) string = process.stdout.decode(charset) return string.rstrip().splitlines() diff --git a/txt/__init__.py b/txt/__init__.py index 81903f4..edb0624 100644 --- a/txt/__init__.py +++ b/txt/__init__.py @@ -1 +1 @@ -CHARSET='UTF-8' +CHARSET = 'UTF-8'