mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-11-17 07:48:18 +01:00
Updated for names
This commit is contained in:
parent
312819af9a
commit
91bff1e76e
3 changed files with 21 additions and 21 deletions
|
@ -26,7 +26,7 @@ class Check(Configs):
|
|||
|
||||
self.is_binary: bool = self.utils.is_binary_repo(repository)
|
||||
|
||||
def exists_in_the_database(self, packages: list) -> None:
|
||||
def package_exists_in_the_database(self, packages: list) -> None:
|
||||
not_packages: list = []
|
||||
|
||||
for pkg in packages:
|
||||
|
@ -55,7 +55,7 @@ class Check(Configs):
|
|||
self.errors.raise_error_message(f"Package '{sbo}' unsupported by arch",
|
||||
exit_status=1)
|
||||
|
||||
def is_installed(self, packages: list) -> None:
|
||||
def is_package_installed(self, packages: list) -> None:
|
||||
""" Checking for installed packages. """
|
||||
not_found: list = []
|
||||
|
||||
|
@ -67,7 +67,7 @@ class Check(Configs):
|
|||
self.errors.raise_error_message(f'Not found \'{", ".join(not_found)}\' installed packages',
|
||||
exit_status=1)
|
||||
|
||||
def is_empty_database(self) -> None:
|
||||
def is_database_empty(self) -> None:
|
||||
""" Checking for empty table and database file. """
|
||||
count: int = 0
|
||||
sbo_table: dict = {
|
||||
|
|
|
@ -524,7 +524,7 @@ class Argparse(Configs):
|
|||
command = Argparse.upgrade.__name__
|
||||
|
||||
if len(self.args) == 1:
|
||||
self.check.is_empty_database()
|
||||
self.check.is_database_empty()
|
||||
|
||||
upgrade = Upgrade(self.repository, self.data)
|
||||
packages: list = list(upgrade.packages())
|
||||
|
@ -590,13 +590,13 @@ class Argparse(Configs):
|
|||
|
||||
if len(self.args) >= 2:
|
||||
|
||||
self.check.is_empty_database()
|
||||
self.check.is_database_empty()
|
||||
packages: list = self.is_file_list_packages()
|
||||
|
||||
if self.utils.is_option(self.flag_searches, self.flags):
|
||||
packages: list = self.choose_packages(packages, command)
|
||||
|
||||
self.check.exists_in_the_database(packages)
|
||||
self.check.package_exists_in_the_database(packages)
|
||||
self.check.is_package_unsupported(packages)
|
||||
|
||||
if self.repository in list(self.repos.repositories.keys())[:2]:
|
||||
|
@ -613,19 +613,19 @@ class Argparse(Configs):
|
|||
|
||||
if len(self.args) >= 2:
|
||||
|
||||
self.check.is_empty_database()
|
||||
self.check.is_database_empty()
|
||||
packages: list = self.is_file_list_packages()
|
||||
|
||||
if self.utils.is_option(self.flag_searches, self.flags):
|
||||
packages: list = self.choose_packages(packages, command)
|
||||
|
||||
if self.is_binary:
|
||||
self.check.exists_in_the_database(packages)
|
||||
self.check.package_exists_in_the_database(packages)
|
||||
|
||||
install = Packages(self.repository, self.data, packages, self.flags, mode=command)
|
||||
install.execute()
|
||||
else:
|
||||
self.check.exists_in_the_database(packages)
|
||||
self.check.package_exists_in_the_database(packages)
|
||||
self.check.is_package_unsupported(packages)
|
||||
|
||||
install = Slackbuilds(self.repository, self.data, packages, self.flags, mode=command)
|
||||
|
@ -638,13 +638,13 @@ class Argparse(Configs):
|
|||
|
||||
if len(self.args) >= 2:
|
||||
|
||||
self.check.is_empty_database()
|
||||
self.check.is_database_empty()
|
||||
packages: list = self.is_file_list_packages()
|
||||
|
||||
if self.utils.is_option(self.flag_searches, self.flags):
|
||||
packages: list = self.choose_packages(packages, command)
|
||||
|
||||
self.check.exists_in_the_database(packages)
|
||||
self.check.package_exists_in_the_database(packages)
|
||||
download = Download(self.directory, self.flags, self.data, self.repository)
|
||||
download.packages(packages)
|
||||
raise SystemExit()
|
||||
|
@ -660,7 +660,7 @@ class Argparse(Configs):
|
|||
if self.utils.is_option(self.flag_searches, self.flags):
|
||||
packages: list = self.choose_packages(packages, command)
|
||||
|
||||
self.check.is_installed(packages)
|
||||
self.check.is_package_installed(packages)
|
||||
|
||||
remove = RemovePackages(packages, self.flags)
|
||||
remove.remove()
|
||||
|
@ -672,7 +672,7 @@ class Argparse(Configs):
|
|||
|
||||
if len(self.args) >= 2:
|
||||
|
||||
self.check.is_empty_database()
|
||||
self.check.is_database_empty()
|
||||
packages: list = self.is_file_list_packages()
|
||||
|
||||
if self.utils.is_option(self.flag_searches, self.flags):
|
||||
|
@ -688,13 +688,13 @@ class Argparse(Configs):
|
|||
|
||||
if len(self.args) >= 2:
|
||||
|
||||
self.check.is_empty_database()
|
||||
self.check.is_database_empty()
|
||||
packages: list = self.is_file_list_packages()
|
||||
|
||||
if self.utils.is_option(self.flag_searches, self.flags):
|
||||
packages: list = self.choose_packages(packages, command)
|
||||
|
||||
self.check.exists_in_the_database(packages)
|
||||
self.check.package_exists_in_the_database(packages)
|
||||
|
||||
view = ViewPackage(self.flags, self.repository)
|
||||
|
||||
|
@ -710,7 +710,7 @@ class Argparse(Configs):
|
|||
|
||||
if len(self.args) >= 2:
|
||||
|
||||
self.check.is_empty_database()
|
||||
self.check.is_database_empty()
|
||||
packages: list = self.is_file_list_packages()
|
||||
|
||||
if self.utils.is_option(self.flag_searches, self.flags):
|
||||
|
@ -726,13 +726,13 @@ class Argparse(Configs):
|
|||
|
||||
if len(self.args) >= 2:
|
||||
|
||||
self.check.is_empty_database()
|
||||
self.check.is_database_empty()
|
||||
packages: list = self.is_file_list_packages()
|
||||
|
||||
if self.utils.is_option(self.flag_searches, self.flags):
|
||||
packages: list = self.choose_packages(packages, command)
|
||||
|
||||
self.check.exists_in_the_database(packages)
|
||||
self.check.package_exists_in_the_database(packages)
|
||||
|
||||
dependees = Dependees(self.data, packages, self.flags, self.repository)
|
||||
dependees.find()
|
||||
|
@ -744,13 +744,13 @@ class Argparse(Configs):
|
|||
|
||||
if len(self.args) >= 2:
|
||||
|
||||
self.check.is_empty_database()
|
||||
self.check.is_database_empty()
|
||||
packages: list = self.is_file_list_packages()
|
||||
|
||||
if self.utils.is_option(self.flag_searches, self.flags):
|
||||
packages: list = self.choose_packages(packages, command)
|
||||
|
||||
self.check.exists_in_the_database(packages)
|
||||
self.check.package_exists_in_the_database(packages)
|
||||
|
||||
tracking = Tracking(self.flags, self.repository)
|
||||
tracking.packages(self.data, packages)
|
||||
|
|
|
@ -12,7 +12,7 @@ class TestPkgInstalled(unittest.TestCase):
|
|||
self.packages = ['audacity', 'vlc', 'dnspython']
|
||||
|
||||
def test_check_exists(self):
|
||||
self.assertIsNone(self.check.exists_in_the_database(self.packages))
|
||||
self.assertIsNone(self.check.package_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