mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-02-10 20:48:40 +01:00
Fix for code style
This commit is contained in:
parent
a4ecfe5555
commit
97e7cea203
1 changed files with 6 additions and 1 deletions
|
@ -1,5 +1,8 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# mypy: disable-error-code="no-redef"
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
@ -89,7 +92,7 @@ class Utilities(Configs):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def finished_time(elapsed_time: float) -> None:
|
def finished_time(elapsed_time: float) -> None:
|
||||||
""" Printing the elapsed time. """
|
""" 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
|
@staticmethod
|
||||||
def is_option(options: tuple, flags: list) -> bool:
|
def is_option(options: tuple, flags: list) -> bool:
|
||||||
|
@ -97,6 +100,7 @@ class Utilities(Configs):
|
||||||
for option in options:
|
for option in options:
|
||||||
if option in flags:
|
if option in flags:
|
||||||
return True
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def read_packages_from_file(self, file: Path) -> Generator:
|
def read_packages_from_file(self, file: Path) -> Generator:
|
||||||
""" Reads name packages from file and split these to list. """
|
""" Reads name packages from file and split these to list. """
|
||||||
|
@ -119,6 +123,7 @@ class Utilities(Configs):
|
||||||
return text_file.readlines()
|
return text_file.readlines()
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
self.errors.raise_error_message(f"No such file or directory: '{file}'", exit_status=20)
|
self.errors.raise_error_message(f"No such file or directory: '{file}'", exit_status=20)
|
||||||
|
return []
|
||||||
|
|
||||||
def count_file_size(self, name: str) -> int:
|
def count_file_size(self, name: str) -> int:
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Reference in a new issue