Renamed method

This commit is contained in:
Dimitris Zlatanidis 2023-03-03 08:05:20 +02:00
parent d79ccd6c81
commit 49317a628d
6 changed files with 12 additions and 12 deletions

View file

@ -43,7 +43,7 @@ class Check(Configs, Utilities):
found, not_found = [], []
for sbo in slackbuilds:
package: str = self.is_installed(sbo, file_pattern)
package: str = self.is_package_installed(sbo, file_pattern)
if package:
pkg: str = self.split_installed_pkg(package)[0]
found.append(pkg)

View file

@ -328,7 +328,7 @@ class Argparse(Configs):
if pkg == package:
repo_ver: str = SBoQueries(package).version()
inst_pkg: str = self.utils.is_installed(package, self.file_pattern)
inst_pkg: str = self.utils.is_package_installed(package, self.file_pattern)
inst_ver: str = self.utils.split_installed_pkg(inst_pkg)[1]
choices += [(package, f'{inst_ver} -> {repo_ver}', True)]

View file

@ -90,7 +90,7 @@ class Slackbuilds(Configs):
# Checks if the package was installed and skipped.
if (self.utils.is_option(self.flag_skip_installed, self.flags) and
self.utils.is_installed(dep, self.file_pattern)):
self.utils.is_package_installed(dep, self.file_pattern)):
continue
self.dependencies.append(dep)
@ -125,7 +125,7 @@ class Slackbuilds(Configs):
def is_for_skipped(self, sbo) -> Literal[True]:
""" Condition to check if slackbuild is for skipped. """
return (not self.utils.is_installed(sbo, self.file_pattern) or
return (not self.utils.is_package_installed(sbo, self.file_pattern) or
self.utils.is_package_upgradeable(sbo, self.file_pattern) or
self.mode == 'build' or self.utils.is_option(self.flag_reinstall, self.flags))
@ -175,7 +175,7 @@ class Slackbuilds(Configs):
if not self.utils.is_option(self.flag_resolve_off, self.flags):
self.logging_installed_dependencies(sbo)
else:
package: str = self.utils.is_installed(sbo, self.file_pattern)
package: str = self.utils.is_package_installed(sbo, self.file_pattern)
version: str = self.utils.split_installed_pkg(package)[1]
self.view_message.view_skipping_packages(sbo, version)
@ -218,7 +218,7 @@ class Slackbuilds(Configs):
execute: str = self.installpkg
if (self.utils.is_option(self.flag_reinstall, self.flags) and
self.utils.is_installed(pkg, self.file_pattern)):
self.utils.is_package_installed(pkg, self.file_pattern)):
execute: str = self.reinstall
message: str = f'{self.cyan}Installing{self.endc}'
@ -346,7 +346,7 @@ class Slackbuilds(Configs):
if self.mode == 'upgrade' and self.utils.is_package_upgradeable(package, self.file_pattern):
status: bool = True
if self.mode == 'install' and not self.utils.is_installed(package, self.file_pattern):
if self.mode == 'install' and not self.utils.is_package_installed(package, self.file_pattern):
status: bool = True
if self.mode == 'install' and self.utils.is_package_upgradeable(package, self.file_pattern):

View file

@ -25,7 +25,7 @@ class Utilities:
self.cyan: str = self.color['cyan']
self.endc: str = self.color['endc']
def is_installed(self, name: str, pattern: str) -> str:
def is_package_installed(self, name: str, pattern: str) -> str:
""" Returns the installed package name. """
installed: list = list(self.all_installed(pattern))
@ -94,7 +94,7 @@ class Utilities:
def is_package_upgradeable(self, package: str, file_pattern: str) -> Any:
""" Checks if the package is installed and if it is upgradeable, returns true. """
installed = self.is_installed(package, file_pattern)
installed = self.is_package_installed(package, file_pattern)
if installed:
installed_version = self.split_installed_pkg(installed)[1]
repository_version = SBoQueries(package).version()

View file

@ -153,7 +153,7 @@ class ViewMessage(Configs):
""" View and creates list with packages for remove. """
installed = self.utils.all_installed(self.file_pattern)
if self.utils.is_installed(name, self.file_pattern):
if self.utils.is_package_installed(name, self.file_pattern):
for package in installed:
pkg: str = self.utils.split_installed_pkg(package)[0]
if pkg == name:
@ -189,7 +189,7 @@ class ViewMessage(Configs):
install = upgrade = remove = 0
for sbo in slackbuilds:
installed: str = self.utils.is_installed(sbo, self.file_pattern)
installed: str = self.utils.is_package_installed(sbo, self.file_pattern)
if not installed:
install += 1

View file

@ -13,7 +13,7 @@ class TestUtilities(unittest.TestCase):
self.package = 'fish-3.6.0-x86_64-1_SBo'
def test_ins_installed(self):
self.assertEqual(self.package, self.utils.is_installed('fish', self.file_pattern))
self.assertEqual(self.package, self.utils.is_package_installed('fish', self.file_pattern))
def test_split_name(self):
self.assertEqual('fish', self.utils.split_installed_pkg(self.package)[0])