mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-11-16 07:47:35 +01:00
Updated docstrings
This commit is contained in:
parent
975bca6883
commit
759db50047
1 changed files with 6 additions and 12 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue