From 97e7cea20334dcbf697dea51cc83c60dd93ac08a Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 21 Apr 2024 23:59:33 +0300 Subject: [PATCH] Fix for code style --- slpkg/utilities.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/slpkg/utilities.py b/slpkg/utilities.py index f94b8aa9..de660393 100644 --- a/slpkg/utilities.py +++ b/slpkg/utilities.py @@ -1,5 +1,8 @@ #!/usr/bin/python3 # -*- coding: utf-8 -*- + +# mypy: disable-error-code="no-redef" + from __future__ import annotations import os @@ -89,7 +92,7 @@ class Utilities(Configs): @staticmethod def finished_time(elapsed_time: float) -> None: """ Printing the elapsed time. """ - print(f'\nFinished:', time.strftime(f'%H:%M:%S', time.gmtime(elapsed_time))) + print('\nFinished:', time.strftime('%H:%M:%S', time.gmtime(elapsed_time))) @staticmethod def is_option(options: tuple, flags: list) -> bool: @@ -97,6 +100,7 @@ class Utilities(Configs): for option in options: if option in flags: return True + return False def read_packages_from_file(self, file: Path) -> Generator: """ Reads name packages from file and split these to list. """ @@ -119,6 +123,7 @@ class Utilities(Configs): return text_file.readlines() except FileNotFoundError: self.errors.raise_error_message(f"No such file or directory: '{file}'", exit_status=20) + return [] def count_file_size(self, name: str) -> int: """