diff --git a/slpkg/checks.py b/slpkg/checks.py index 5a12ede8..a4125c4e 100644 --- a/slpkg/checks.py +++ b/slpkg/checks.py @@ -74,6 +74,6 @@ class Check: def database(self): """ Checking for empty table """ db = f'{self.configs.db_path}/{self.configs.database}' - if not SBoQueries('').names() or not os.path.isfile(db): + if not SBoQueries('').sbos() or not os.path.isfile(db): raise SystemExit('\nYou need to update the package lists first.\n' 'Please run slpkg update.\n') diff --git a/slpkg/dependees.py b/slpkg/dependees.py index 1156f52f..0c90b120 100644 --- a/slpkg/dependees.py +++ b/slpkg/dependees.py @@ -30,7 +30,7 @@ class Dependees: dependees = {} for package in self.packages: found = [] # Reset list every package - sbos = SBoQueries('').names() + sbos = SBoQueries('').sbos() for sbo in sbos: requires = SBoQueries(sbo).requires() diff --git a/slpkg/queries.py b/slpkg/queries.py index 4ae220e8..5552597b 100644 --- a/slpkg/queries.py +++ b/slpkg/queries.py @@ -20,10 +20,10 @@ class SBoQueries: if self.name in self.black.get(): self.name = '' - def names(self) -> list: + def sbos(self) -> list: """ Returns all the slackbuilds. """ - names = self.session.query(SBoTable.name).all() - return [name[0] for name in names] + sbos = self.session.query(SBoTable.name).all() + return [sbo[0] for sbo in sbos] def slackbuild(self) -> str: """ Returns a slackbuild. """ diff --git a/slpkg/search.py b/slpkg/search.py index 4effad2d..6155f651 100644 --- a/slpkg/search.py +++ b/slpkg/search.py @@ -19,7 +19,7 @@ class SearchPackage: endc = color['endc'] matching = 0 - names = SBoQueries('').names() + names = SBoQueries('').sbos() print(f'The list below shows the repo ' f'packages that contains \'{", ".join([p for p in packages])}\' files:\n') diff --git a/slpkg/upgrade.py b/slpkg/upgrade.py index ec5e7101..d2681caa 100644 --- a/slpkg/upgrade.py +++ b/slpkg/upgrade.py @@ -19,7 +19,7 @@ class Upgrade: def packages(self): """ Compares version of packages and returns the maximum. """ - repo_packages = SBoQueries('').names() + repo_packages = SBoQueries('').sbos() black = Blacklist().get() for pkg in os.listdir(self.configs.log_packages): diff --git a/tests/test_queries.py b/tests/test_queries.py index bfb1bf93..59bcae44 100644 --- a/tests/test_queries.py +++ b/tests/test_queries.py @@ -35,7 +35,7 @@ class TestSBoQueries(unittest.TestCase): self.query.description()) def test_names(self): - self.assertIn('slpkg', self.query.names()) + self.assertIn('slpkg', self.query.sbos()) if __name__ == '__main__':