Update docstrings

This commit is contained in:
Dimitris Zlatanidis 2024-05-19 20:59:17 +03:00
parent 340108cddb
commit a8ac91bdcd

View file

@ -18,10 +18,7 @@ from slpkg.error_messages import Errors
class Utilities(Configs): class Utilities(Configs):
"""List of utilities."""
"""
List of utilities.
"""
def __init__(self): def __init__(self):
super(Configs, self).__init__() super(Configs, self).__init__()
@ -187,9 +184,8 @@ class Utilities(Configs):
return [] return []
def count_file_size(self, name: str) -> int: def count_file_size(self, name: str) -> int:
""" """Read the contents files from the package file list
Read the contents files from the package file list and count the count the total installation file size in bytes.
the total installation file size in bytes.
Args: Args:
name: The name of the package. name: The name of the package.
@ -208,8 +204,8 @@ class Utilities(Configs):
@staticmethod @staticmethod
def convert_file_sizes(byte_size: float) -> str: def convert_file_sizes(byte_size: float) -> str:
""" """Convert bytes to kb, mb and gb.
Convert bytes to kb, mb and gb.
Args: Args:
byte_size: The file size in bytes. byte_size: The file size in bytes.
Returns: Returns:
@ -278,8 +274,8 @@ class Utilities(Configs):
return packages return packages
def read_json_file(self, file: Path) -> dict: def read_json_file(self, file: Path) -> dict:
""" """Read JSON data from the file.
Read JSON data from the file.
Args: Args:
file: Path file for reading. file: Path file for reading.
Returns: Returns:
@ -295,8 +291,8 @@ class Utilities(Configs):
return json_data return json_data
def ignore_packages(self, packages: list) -> list: def ignore_packages(self, packages: list) -> list:
""" """Matching packages using regular expression.
Matching packages using regular expression.
Args: Args:
packages: The packages to apply the pattern. packages: The packages to apply the pattern.
Returns: Returns:
@ -310,7 +306,7 @@ class Utilities(Configs):
return matching_packages return matching_packages
def convert_dict_keys_to_lower(self, d: dict) -> dict: def convert_dict_keys_to_lower(self, d: dict) -> dict:
""" Converts dictionary keys to lower. """Converts dictionary keys to lower.
Args: Args:
d (dict): Dictionary data. d (dict): Dictionary data.