From 6dc8b7c12c0f279bafa62aa700d7ce925d823a41 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Fri, 26 Apr 2024 10:54:15 +0300 Subject: [PATCH] Update for docstrings --- slpkg/update_repositories.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/slpkg/update_repositories.py b/slpkg/update_repositories.py index 5416e6c8..f15d0e0b 100644 --- a/slpkg/update_repositories.py +++ b/slpkg/update_repositories.py @@ -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'])