From a8ac91bdcdb35c79388400ad7dc73e1f243c3f87 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 19 May 2024 20:59:17 +0300 Subject: [PATCH] Update docstrings --- slpkg/utilities.py | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/slpkg/utilities.py b/slpkg/utilities.py index b91b85ed..6dd58b6f 100644 --- a/slpkg/utilities.py +++ b/slpkg/utilities.py @@ -18,10 +18,7 @@ from slpkg.error_messages import Errors class Utilities(Configs): - - """ - List of utilities. - """ + """List of utilities.""" def __init__(self): super(Configs, self).__init__() @@ -187,9 +184,8 @@ class Utilities(Configs): return [] def count_file_size(self, name: str) -> int: - """ - Read the contents files from the package file list and count - the total installation file size in bytes. + """Read the contents files from the package file list + the count the total installation file size in bytes. Args: name: The name of the package. @@ -208,8 +204,8 @@ class Utilities(Configs): @staticmethod def convert_file_sizes(byte_size: float) -> str: - """ - Convert bytes to kb, mb and gb. + """Convert bytes to kb, mb and gb. + Args: byte_size: The file size in bytes. Returns: @@ -278,8 +274,8 @@ class Utilities(Configs): return packages def read_json_file(self, file: Path) -> dict: - """ - Read JSON data from the file. + """Read JSON data from the file. + Args: file: Path file for reading. Returns: @@ -295,8 +291,8 @@ class Utilities(Configs): return json_data def ignore_packages(self, packages: list) -> list: - """ - Matching packages using regular expression. + """Matching packages using regular expression. + Args: packages: The packages to apply the pattern. Returns: @@ -310,7 +306,7 @@ class Utilities(Configs): return matching_packages def convert_dict_keys_to_lower(self, d: dict) -> dict: - """ Converts dictionary keys to lower. + """Converts dictionary keys to lower. Args: d (dict): Dictionary data.