Updated docstrings

This commit is contained in:
Dimitris Zlatanidis 2024-05-19 22:48:19 +03:00
parent 975bca6883
commit 759db50047

View file

@ -8,10 +8,7 @@ from slpkg.repositories import Repositories
class SearchPackage(Configs): # pylint: disable=[R0902]
"""
Search packages from the repositories.
"""
"""Search packages from the repositories."""
def __init__(self, flags: list, packages: list, data: dict, repository: str):
super(Configs, self).__init__()
@ -33,8 +30,7 @@ class SearchPackage(Configs): # pylint: disable=[R0902]
('-p', '--pkg-version'), flags)
def search(self) -> None:
""" Choose between all and one repository.
"""
"""Choose between all and one repository."""
if self.repository == '*':
self.search_to_all_repositories()
else:
@ -45,15 +41,14 @@ class SearchPackage(Configs): # pylint: disable=[R0902]
self.summary_of_searching()
def search_to_all_repositories(self) -> None:
""" Search package name to all enabled repositories.
"""
"""Search package name to all enabled repositories. """
all_data: dict = self.data
for name, repo in all_data.items():
self.repo_data: dict = repo
self.search_for_the_packages(name)
def search_for_the_packages(self, repo: str) -> None:
""" Search for packages and save in a dictionary.
"""Search for packages and save in a dictionary.
Args:
repo (str): repository name.
@ -71,8 +66,7 @@ class SearchPackage(Configs): # pylint: disable=[R0902]
}
def summary_of_searching(self) -> None:
""" Prints the result.
"""
"""Prints the result."""
try:
repo_length: int = max(len(repo['repository']) for repo in self.data_dict.values())
except ValueError:
@ -100,7 +94,7 @@ class SearchPackage(Configs): # pylint: disable=[R0902]
print('\nDoes not match any package.\n')
def is_not_case_sensitive(self, package: str, name: str) -> bool:
""" Check for case sensitive.
"""Check for case sensitive.
Args:
package (str): Package file.