mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-13 20:01:48 +01:00
Updated method
This commit is contained in:
parent
acce9e6e0d
commit
1844b33cf6
3 changed files with 9 additions and 14 deletions
|
@ -28,16 +28,13 @@ class Check(Configs):
|
|||
if self.ponce_repo:
|
||||
self.repo_path = self.ponce_repo_path
|
||||
|
||||
def is_package_exists(self, slackbuilds: list) -> list:
|
||||
def exists_in_the_database(self, slackbuilds: list) -> None:
|
||||
""" Checking if the slackbuild exists in the database. """
|
||||
not_packages: list = []
|
||||
|
||||
for sbo in slackbuilds:
|
||||
|
||||
if sbo in self.black.packages():
|
||||
slackbuilds.remove(sbo)
|
||||
|
||||
elif not SBoQueries(sbo).slackbuild():
|
||||
if not SBoQueries(sbo).slackbuild():
|
||||
not_packages.append(sbo)
|
||||
|
||||
else:
|
||||
|
@ -49,8 +46,6 @@ class Check(Configs):
|
|||
raise SystemExit(f"\n[{self.bred}Error{self.endc}]: Packages "
|
||||
f"'{self.cyan}{', '.join(not_packages)}{self.endc}' does not exists.\n")
|
||||
|
||||
return slackbuilds
|
||||
|
||||
def is_package_unsupported(self, slackbuilds: list) -> None:
|
||||
""" Checking for unsupported slackbuilds. """
|
||||
for sbo in slackbuilds:
|
||||
|
|
|
@ -491,7 +491,7 @@ class Argparse(Configs):
|
|||
packages: list = self.choose_packages(packages, command)
|
||||
|
||||
self.check.is_empty_database()
|
||||
packages: list = self.check.is_package_exists(packages)
|
||||
self.check.exists_in_the_database(packages)
|
||||
self.check.is_package_unsupported(packages)
|
||||
|
||||
build = Slackbuilds(packages, self.flags, self.file_pattern, mode=command)
|
||||
|
@ -510,7 +510,7 @@ class Argparse(Configs):
|
|||
packages: list = self.choose_packages(packages, command)
|
||||
|
||||
self.check.is_empty_database()
|
||||
packages: list = self.check.is_package_exists(packages)
|
||||
self.check.exists_in_the_database(packages)
|
||||
self.check.is_package_unsupported(packages)
|
||||
|
||||
install = Slackbuilds(packages, self.flags, self.file_pattern, mode=command)
|
||||
|
@ -529,7 +529,7 @@ class Argparse(Configs):
|
|||
packages: list = self.choose_packages(packages, command)
|
||||
|
||||
self.check.is_empty_database()
|
||||
packages: list = self.check.is_package_exists(packages)
|
||||
self.check.exists_in_the_database(packages)
|
||||
download = Download(self.directory, self.flags)
|
||||
download.packages(packages)
|
||||
raise SystemExit()
|
||||
|
@ -581,7 +581,7 @@ class Argparse(Configs):
|
|||
packages: list = self.choose_packages(packages, command)
|
||||
|
||||
self.check.is_empty_database()
|
||||
packages: list = self.check.is_package_exists(packages)
|
||||
self.check.exists_in_the_database(packages)
|
||||
|
||||
view = ViewPackage(self.flags)
|
||||
view.package(packages)
|
||||
|
@ -616,7 +616,7 @@ class Argparse(Configs):
|
|||
packages: list = self.choose_packages(packages, command)
|
||||
|
||||
self.check.is_empty_database()
|
||||
packages: list = self.check.is_package_exists(packages)
|
||||
self.check.exists_in_the_database(packages)
|
||||
|
||||
dependees = Dependees(packages, self.flags)
|
||||
dependees.slackbuilds()
|
||||
|
@ -634,7 +634,7 @@ class Argparse(Configs):
|
|||
packages: list = self.choose_packages(packages, command)
|
||||
|
||||
self.check.is_empty_database()
|
||||
packages: list = self.check.is_package_exists(packages)
|
||||
self.check.exists_in_the_database(packages)
|
||||
|
||||
tracking = Tracking(self.flags)
|
||||
tracking.packages(packages)
|
||||
|
|
|
@ -12,7 +12,7 @@ class TestPkgInstalled(unittest.TestCase):
|
|||
self.packages = ['fish', 'ranger', 'pycharm']
|
||||
|
||||
def test_check_exists(self):
|
||||
self.assertIsNone(self.check.is_package_exists(self.packages))
|
||||
self.assertIsNone(self.check.exists_in_the_database(self.packages))
|
||||
|
||||
def test_check_unsupported(self):
|
||||
self.assertIsNone(self.check.is_package_unsupported(self.packages))
|
||||
|
|
Loading…
Reference in a new issue