Updated docstrings

This commit is contained in:
Dimitris Zlatanidis 2024-05-20 22:10:37 +03:00
parent 9a0d4d832a
commit 6283c34ec4

View file

@ -12,10 +12,7 @@ from slpkg.repositories import Repositories
class RepoInfo(Configs): # pylint: disable=[R0902] class RepoInfo(Configs): # pylint: disable=[R0902]
"""View information about repositories."""
"""
View information about repositories.
"""
def __init__(self, flags: list, repository: str): def __init__(self, flags: list, repository: str):
super(Configs, self).__init__() super(Configs, self).__init__()
@ -39,8 +36,7 @@ class RepoInfo(Configs): # pylint: disable=[R0902]
('-o', '--repository'), flags) ('-o', '--repository'), flags)
def info(self) -> None: def info(self) -> None:
""" Prints information about repositories. """Prints information about repositories."""
"""
self.load_repo_data() self.load_repo_data()
self.view_the_title() self.view_the_title()
@ -51,8 +47,7 @@ class RepoInfo(Configs): # pylint: disable=[R0902]
self.view_the_repositories_information() self.view_the_repositories_information()
def load_repo_data(self) -> None: def load_repo_data(self) -> None:
""" Loads repository data. """Loads repository data."""
"""
self.dates: dict = self.repo_information() self.dates: dict = self.repo_information()
if self.option_for_repository: if self.option_for_repository:
self.repo_data: dict = self.load_data.load(self.repository) self.repo_data: dict = self.load_data.load(self.repository)
@ -60,7 +55,7 @@ class RepoInfo(Configs): # pylint: disable=[R0902]
self.repo_data: dict = self.load_data.load('*') self.repo_data: dict = self.load_data.load('*')
def repo_information(self) -> dict: def repo_information(self) -> dict:
""" Loads repository information. """Loads repository information.
Returns: Returns:
dict: Description dict: Description
@ -72,8 +67,7 @@ class RepoInfo(Configs): # pylint: disable=[R0902]
return {} return {}
def view_the_title(self) -> None: def view_the_title(self) -> None:
""" Prints the title. """Prints the title."""
"""
title: str = 'repositories information:'.title() title: str = 'repositories information:'.title()
if self.option_for_repository: if self.option_for_repository:
title: str = 'repository information:'.title() title: str = 'repository information:'.title()
@ -83,8 +77,7 @@ class RepoInfo(Configs): # pylint: disable=[R0902]
print('=' * (self.columns - 1)) print('=' * (self.columns - 1))
def view_the_repository_information(self) -> None: def view_the_repository_information(self) -> None:
""" Prints the repository information. """Prints the repository information."""
# """
args: dict = { args: dict = {
'repo': self.repository, 'repo': self.repository,
'date': 'None', 'date': 'None',
@ -106,8 +99,7 @@ class RepoInfo(Configs): # pylint: disable=[R0902]
self.view_summary_of_all_repositories() self.view_summary_of_all_repositories()
def view_the_repositories_information(self) -> None: def view_the_repositories_information(self) -> None:
""" Prints the repositories information. """Prints the repositories information."""
"""
args: dict = {} args: dict = {}
for repo, conf in self.repos.repositories.items(): for repo, conf in self.repos.repositories.items():
args: dict = { args: dict = {
@ -146,14 +138,12 @@ class RepoInfo(Configs): # pylint: disable=[R0902]
f"{self.endc}{args['date']:<34}{self.yellow}{args['count']:>12}{self.endc}") f"{self.endc}{args['date']:<34}{self.yellow}{args['count']:>12}{self.endc}")
def view_summary_of_repository(self) -> None: def view_summary_of_repository(self) -> None:
""" Prints the repository summary. """Prints the repository summary."""
"""
print('=' * (self.columns - 1)) print('=' * (self.columns - 1))
print(f"{self.grey}Total {self.total_packages} packages available from the '{self.repository}' repository.\n") print(f"{self.grey}Total {self.total_packages} packages available from the '{self.repository}' repository.\n")
def view_summary_of_all_repositories(self) -> None: def view_summary_of_all_repositories(self) -> None:
""" Prints the total summary of repositories. """Prints the total summary of repositories."""
"""
print('=' * (self.columns - 1)) print('=' * (self.columns - 1))
print(f"{self.grey}Total of {self.enabled}/{len(self.repos.repositories)} " print(f"{self.grey}Total of {self.enabled}/{len(self.repos.repositories)} "
f"repositories are enabled with {self.total_packages} packages available.\n") f"repositories are enabled with {self.total_packages} packages available.\n")