Updated for self method

This commit is contained in:
Dimitris Zlatanidis 2023-01-14 22:08:01 +02:00
parent 7d156e7a2a
commit 2f2aad3c5c

View file

@ -25,16 +25,14 @@ class Utilities:
def is_installed(self, name: str) -> str:
""" Returns the installed package name. """
pattern = f'*{self.configs.sbo_repo_tag}'
installed = self.all_installed()
var_log_packages = Path(self.configs.log_packages)
packages = [file.name for file in var_log_packages.glob(pattern)]
for package in packages:
for package in installed:
pkg = self.split_installed_pkg(package)[0]
if pkg == name and pkg not in self.black.get():
if pkg == name:
return package
return ''
def all_installed(self):