From 5ee3be74a6bd49d3773c2076ef61e3d6b598c1c2 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Wed, 26 Apr 2023 20:21:37 +0300 Subject: [PATCH] Updated for coding style --- slpkg/binaries/install.py | 2 +- slpkg/binaries/required.py | 2 +- slpkg/check_updates.py | 2 +- slpkg/checks.py | 2 +- slpkg/dependees.py | 6 +++--- slpkg/download_only.py | 4 ++-- slpkg/downloader.py | 2 +- slpkg/main.py | 2 +- slpkg/remove_packages.py | 8 ++++---- slpkg/search.py | 2 +- slpkg/tracking.py | 4 ++-- slpkg/update_repository.py | 8 +++----- slpkg/views/view_package.py | 2 +- slpkg/views/views.py | 12 ++++++------ 14 files changed, 28 insertions(+), 30 deletions(-) diff --git a/slpkg/binaries/install.py b/slpkg/binaries/install.py index ee05404e..4cc7fbc5 100644 --- a/slpkg/binaries/install.py +++ b/slpkg/binaries/install.py @@ -50,7 +50,7 @@ class Packages(Configs): self.binary_packages: list = [] self.option_for_reinstall: bool = self.utils.is_option( - ['-r', '--reinstall'], self.flags) + ['-r', '--reinstall'], flags) self.option_for_skip_installed: bool = self.utils.is_option( ['-k', '--skip-installed'], flags) diff --git a/slpkg/binaries/required.py b/slpkg/binaries/required.py index 076dc456..cfc81857 100644 --- a/slpkg/binaries/required.py +++ b/slpkg/binaries/required.py @@ -24,7 +24,7 @@ class Required: self.repos.slint_repo_name ] - self.repo = self.data[name][11] + self.repo: str = data[name][11] def resolve(self) -> list: """ Resolve the dependencies. """ diff --git a/slpkg/check_updates.py b/slpkg/check_updates.py index a60c5fc5..05a8f772 100644 --- a/slpkg/check_updates.py +++ b/slpkg/check_updates.py @@ -28,7 +28,7 @@ class CheckUpdates(Configs): self.compare: dict = {} self.option_for_binaries: bool = self.utils.is_option( - ['-B', '--bin-repo='], self.flags) + ['-B', '--bin-repo='], flags) def check(self) -> dict: if self.option_for_binaries: diff --git a/slpkg/checks.py b/slpkg/checks.py index ee117225..7e884585 100644 --- a/slpkg/checks.py +++ b/slpkg/checks.py @@ -28,7 +28,7 @@ class Check(Configs): self.session = Session self.option_for_binaries: bool = self.utils.is_option( - ['-B', '--bin-repo='], self.flags) + ['-B', '--bin-repo='], flags) if self.option_for_binaries: self.repo_table = BinariesTable diff --git a/slpkg/dependees.py b/slpkg/dependees.py index df011c83..2703424a 100644 --- a/slpkg/dependees.py +++ b/slpkg/dependees.py @@ -27,13 +27,13 @@ class Dependees(Configs): self.var: str = self.ascii.vertical_and_right self.option_for_full_reverse: bool = self.utils.is_option( - ['-E', '--full-reverse'], self.flags) + ['-E', '--full-reverse'], flags) self.option_for_pkg_version: bool = self.utils.is_option( - ['-p', '--pkg-version'], self.flags) + ['-p', '--pkg-version'], flags) self.option_for_binaries: bool = self.utils.is_option( - ['-B', '--bin-repo='], self.flags) + ['-B', '--bin-repo='], flags) def find(self) -> None: """ Collecting the dependees. """ diff --git a/slpkg/download_only.py b/slpkg/download_only.py index 13b2c131..1dc5a56f 100644 --- a/slpkg/download_only.py +++ b/slpkg/download_only.py @@ -27,10 +27,10 @@ class Download(Configs): self.session = Session self.option_for_directory: bool = self.utils.is_option( - ['-z', '--directory='], self.flags) + ['-z', '--directory='], flags) self.option_for_binaries: bool = self.utils.is_option( - ['-B', '--bin-repo='], self.flags) + ['-B', '--bin-repo='], flags) def packages(self, data: dict, packages: list) -> None: """ Download the package only. """ diff --git a/slpkg/downloader.py b/slpkg/downloader.py index 5d36bfe9..8b35335f 100644 --- a/slpkg/downloader.py +++ b/slpkg/downloader.py @@ -25,7 +25,7 @@ class Downloader(Configs): self.utils = Utilities() self.option_for_parallel: bool = self.utils.is_option( - ['-P', '--parallel'], self.flags) + ['-P', '--parallel'], flags) def download(self) -> None: """ Starting the processing for downloading. """ diff --git a/slpkg/main.py b/slpkg/main.py index a76ea85b..a6408fd3 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -52,7 +52,7 @@ class Argparse(Configs): self.binary_repo: str = '' - if len(self.args) == 0 or '' in self.args: + if len(args) == 0 or '' in args: self.usage.help_short(1) self.data: dict = {} diff --git a/slpkg/remove_packages.py b/slpkg/remove_packages.py index a5fee0cc..d44ee529 100644 --- a/slpkg/remove_packages.py +++ b/slpkg/remove_packages.py @@ -25,7 +25,7 @@ class RemovePackages(Configs): self.session = Session self.utils = Utilities() self.progress = ProgressBar() - self.view = ViewMessage(self.flags) + self.view = ViewMessage(flags) self.process_message: str = '' self.installed_packages: list = [] @@ -34,13 +34,13 @@ class RemovePackages(Configs): self.stdout = None self.option_resolve_off: bool = self.utils.is_option( - ['-o', '--resolve-off'], self.flags) + ['-o', '--resolve-off'], flags) self.option_for_no_silent: bool = self.utils.is_option( - ['-n', '--no-silent'], self.flags) + ['-n', '--no-silent'], flags) self.option_for_yes: bool = self.utils.is_option( - ['-y', '--yes'], self.flags) + ['-y', '--yes'], flags) def remove(self) -> None: """ Removes package with dependencies. """ diff --git a/slpkg/search.py b/slpkg/search.py index 26bd0a24..93843315 100644 --- a/slpkg/search.py +++ b/slpkg/search.py @@ -19,7 +19,7 @@ class SearchPackage(Configs): self.repos = Repositories() self.option_for_binaries: bool = self.utils.is_option( - ['-B', '--bin-repo='], self.flags) + ['-B', '--bin-repo='], flags) def package(self, data: dict, packages: list, repo: str) -> None: """ Searching and print the matched packages. """ diff --git a/slpkg/tracking.py b/slpkg/tracking.py index 7a95a261..cef244f2 100644 --- a/slpkg/tracking.py +++ b/slpkg/tracking.py @@ -22,10 +22,10 @@ class Tracking(Configs): self.vl: str = self.ascii.vertical_line self.option_for_pkg_version: bool = self.utils.is_option( - ['-p', '--pkg-version'], self.flags) + ['-p', '--pkg-version'], flags) self.option_for_binaries: bool = self.utils.is_option( - ['-B', '--bin-repo='], self.flags) + ['-B', '--bin-repo='], flags) def packages(self, data: dict, packages: list) -> None: """ Prints the packages dependencies. """ diff --git a/slpkg/update_repository.py b/slpkg/update_repository.py index 9a024cfb..93bf3ca7 100644 --- a/slpkg/update_repository.py +++ b/slpkg/update_repository.py @@ -36,17 +36,15 @@ class UpdateRepository(Configs): self.utils = Utilities() self.data = InstallData() - self.check_updates = CheckUpdates( - self.flags, self.repo - ) + self.check_updates = CheckUpdates(flags, repo) self.repos_for_update: dict = {} self.option_for_generate: bool = self.utils.is_option( - ['-G', '--generate-only'], self.flags) + ['-G', '--generate-only'], flags) self.option_for_binaries: bool = self.utils.is_option( - ['-B', '--bin-repo='], self.flags) + ['-B', '--bin-repo='], flags) def update_the_repositories(self) -> None: if not any(list(self.repos_for_update.values())) or self.repo == '*': diff --git a/slpkg/views/view_package.py b/slpkg/views/view_package.py index 22a672e5..a68f8f8e 100644 --- a/slpkg/views/view_package.py +++ b/slpkg/views/view_package.py @@ -35,7 +35,7 @@ class ViewPackage(Configs): self.repo_tar_suffix: str = '' self.option_for_pkg_version: bool = self.utils.is_option( - ['-p', '--pkg-version'], self.flags) + ['-p', '--pkg-version'], flags) def slackbuild(self, data: dict, slackbuilds: list) -> None: """ View the packages from the repository. """ diff --git a/slpkg/views/views.py b/slpkg/views/views.py index 0af1d03e..d97a5bd7 100644 --- a/slpkg/views/views.py +++ b/slpkg/views/views.py @@ -28,25 +28,25 @@ class ViewMessage(Configs): self.utils = Utilities() self.dialogbox = DialogBox() self.ascii = Ascii() - self.upgrade = Upgrade(self.flags, self.data) + self.upgrade = Upgrade(flags, data) self.repos = Repositories() self.download_only: Path = self.tmp_slpkg self.installed_packages: list = [] self.option_for_resolve_off: bool = self.utils.is_option( - ['-o', '--resolve-off'], self.flags) + ['-o', '--resolve-off'], flags) self.option_for_reinstall: bool = self.utils.is_option( - ['-r', '--reinstall'], self.flags) + ['-r', '--reinstall'], flags) self.option_for_yes: bool = self.utils.is_option( - ['-y', '--yes'], self.flags) + ['-y', '--yes'], flags) self.option_for_binaries: bool = self.utils.is_option( - ['-B', '--bin-repo='], self.flags) + ['-B', '--bin-repo='], flags) - self.repo: str = self.utils.repository_name(self.data) + self.repo: str = self.utils.repository_name(data) def view_packages(self, package: str, mode: str) -> None: """ Printing the main packages. """