mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-02-05 08:46:20 +01:00
Update for docstrings
This commit is contained in:
parent
f15c7f1688
commit
6dc8b7c12c
1 changed files with 20 additions and 3 deletions
|
@ -15,7 +15,7 @@ from slpkg.check_updates import CheckUpdates
|
|||
from slpkg.sbos.sbo_generate import SBoGenerate
|
||||
|
||||
|
||||
class UpdateRepositories(Configs):
|
||||
class UpdateRepositories(Configs): # pylint: disable=[R0902]
|
||||
""" Updates the local repositories and install the data
|
||||
into the database.
|
||||
"""
|
||||
|
@ -35,6 +35,8 @@ class UpdateRepositories(Configs):
|
|||
self.repos_for_update: dict = {}
|
||||
|
||||
def repositories(self) -> None:
|
||||
""" Checks and call the repositories for update.
|
||||
"""
|
||||
self.repos_for_update: dict = self.check_updates.updates()
|
||||
|
||||
if not any(list(self.repos_for_update.values())):
|
||||
|
@ -46,6 +48,8 @@ class UpdateRepositories(Configs):
|
|||
self.run_update()
|
||||
|
||||
def run_update(self) -> None:
|
||||
""" Update the repositories by category.
|
||||
"""
|
||||
for repo, update in self.repos_for_update.items():
|
||||
if update:
|
||||
self.view_downloading_message(repo)
|
||||
|
@ -55,10 +59,19 @@ class UpdateRepositories(Configs):
|
|||
self.update_binary_repos(repo)
|
||||
|
||||
def view_downloading_message(self, repo: str) -> None:
|
||||
""" Prints the syncing message.
|
||||
|
||||
Args:
|
||||
repo (str): Repository name.
|
||||
"""
|
||||
print(f"Syncing with the repository '{self.green}{repo}{self.endc}', please wait...\n")
|
||||
|
||||
def update_binary_repos(self, repo: str) -> None:
|
||||
""" Updates the binary repositories. """
|
||||
"""Updates the binary repositories.
|
||||
|
||||
Args:
|
||||
repo (str): Repository name.
|
||||
"""
|
||||
urls: dict = {}
|
||||
|
||||
self.utils.create_directory(self.repos.repositories[repo]['path'])
|
||||
|
@ -83,7 +96,11 @@ class UpdateRepositories(Configs):
|
|||
self.data.install_binary_data(repo)
|
||||
|
||||
def update_slackbuild_repos(self, repo: str) -> None:
|
||||
""" Updates the slackbuild repositories. """
|
||||
"""Updates the slackbuild repositories.
|
||||
|
||||
Args:
|
||||
repo (str): Repository name.
|
||||
"""
|
||||
self.utils.create_directory(self.repos.repositories[repo]['path'])
|
||||
self.utils.remove_file_if_exists(self.repos.repositories[repo]['path'],
|
||||
self.repos.repositories[repo]['slackbuilds_txt'])
|
||||
|
|
Loading…
Add table
Reference in a new issue