From 0f299a56ed43ba0856df184816e05983b66812e3 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Wed, 29 Mar 2023 23:41:20 +0300 Subject: [PATCH] Updated for coding style --- slpkg/binaries/queries.py | 4 ++-- slpkg/binaries/required.py | 2 +- slpkg/main.py | 2 +- slpkg/repo_info.py | 8 ++++---- slpkg/search.py | 2 +- slpkg/upgrade.py | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/slpkg/binaries/queries.py b/slpkg/binaries/queries.py index 3b5a52d4..031beb92 100644 --- a/slpkg/binaries/queries.py +++ b/slpkg/binaries/queries.py @@ -24,7 +24,7 @@ class BinQueries(Configs): if self.name in self.black.packages(): self.name: str = '' - def all_package_names(self) -> list: + def all_package_names_by_repo(self) -> list: """ Returns all the names of the binaries packages. """ pkgs: tuple = self.session.query( BinariesTable.name).where( @@ -32,7 +32,7 @@ class BinQueries(Configs): return [pkg[0] for pkg in pkgs] - def all_binaries_packages(self) -> list: + def all_binaries_packages_by_repo(self) -> list: """ Returns all the binaries packages. """ pkgs: tuple = self.session.query( BinariesTable.package).where( diff --git a/slpkg/binaries/required.py b/slpkg/binaries/required.py index 6e2af441..32964516 100644 --- a/slpkg/binaries/required.py +++ b/slpkg/binaries/required.py @@ -11,7 +11,7 @@ class Required: def __init__(self, name: str, repo: str): self.name: str = name self.repo: str = repo - self.repo_package_names: list = BinQueries(name, self.repo).all_package_names() + self.repo_package_names: list = BinQueries(name, self.repo).all_package_names_by_repo() def resolve(self) -> list: """ Resolve the dependencies. """ diff --git a/slpkg/main.py b/slpkg/main.py index e8bcede9..182539d0 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -402,7 +402,7 @@ class Argparse(Configs): repo_packages: list = SBoQueries('').sbos() if self.utils.is_option(self.flag_binaries, self.flags): - repo_packages: list = BinQueries('', self.binary_repo).all_package_names() + repo_packages: list = BinQueries('', self.binary_repo).all_package_names_by_repo() installed: list = self.utils.installed_packages diff --git a/slpkg/repo_info.py b/slpkg/repo_info.py index 34f1cdab..c78cf17c 100644 --- a/slpkg/repo_info.py +++ b/slpkg/repo_info.py @@ -53,10 +53,10 @@ class RepoInfo(Configs): packages: dict = { self.repos.sbo_repo_name: len(SBoQueries('').sbos()), self.repos.ponce_repo_name: len(SBoQueries('').sbos()), - self.repos.alien_repo_name: len(BinQueries('', repo).all_package_names()), - self.repos.gnome_repo_name: len(BinQueries('', repo).all_package_names()), - self.repos.conraid_repo_name: len(BinQueries('', repo).all_package_names()), - self.repos.slackonly_repo_name: len(BinQueries('', repo).all_package_names()) + self.repos.alien_repo_name: len(BinQueries('', repo).all_package_names_by_repo()), + self.repos.gnome_repo_name: len(BinQueries('', repo).all_package_names_by_repo()), + self.repos.conraid_repo_name: len(BinQueries('', repo).all_package_names_by_repo()), + self.repos.slackonly_repo_name: len(BinQueries('', repo).all_package_names_by_repo()) } if value[0]: diff --git a/slpkg/search.py b/slpkg/search.py index 84e0fabf..27f84fe8 100644 --- a/slpkg/search.py +++ b/slpkg/search.py @@ -55,7 +55,7 @@ class SearchPackage(Configs): print(f'{repository}{self.cyan}{pr[0]}{self.endc}-{self.yellow}{version}{self.endc}' f'{self.green}{desc}{self.endc}') else: - pkg_repo: list = BinQueries('', repo).all_package_names() + pkg_repo: list = BinQueries('', repo).all_package_names_by_repo() for pkg in packages: for pr in pkg_repo: diff --git a/slpkg/upgrade.py b/slpkg/upgrade.py index 4d46584c..3b390356 100644 --- a/slpkg/upgrade.py +++ b/slpkg/upgrade.py @@ -25,7 +25,7 @@ class Upgrade(Configs): def packages(self) -> Generator[str, None, None]: """ Compares version of packages and returns the maximum. """ if self.utils.is_option(self.flag_bin_repository, self.flags): - repo_packages: list = BinQueries('', self.repo).all_package_names() + repo_packages: list = BinQueries('', self.repo).all_package_names_by_repo() else: repo_packages: list = SBoQueries('').sbos()