Switch for generator

This commit is contained in:
Dimitris Zlatanidis 2023-01-20 18:12:46 +02:00
parent 16da4eec5a
commit 3afe3145b2

View file

@ -25,7 +25,7 @@ class Utilities:
def is_installed(self, name: str) -> str:
""" Returns the installed package name. """
installed = self.all_installed()
installed = list(self.all_installed())
for package in installed:
pkg = self.split_installed_pkg(package)[0]
@ -37,15 +37,12 @@ class Utilities:
def all_installed(self) -> list:
""" Return all installed SBo packages from /val/log/packages folder. """
installed = []
pattern = f'*{self.configs.sbo_repo_tag}'
var_log_packages = Path(self.configs.log_packages)
for file in var_log_packages.glob(pattern):
if self.split_installed_pkg(file.name) not in self.black.get():
installed.append(file.name)
return installed
yield file.name
@staticmethod
def untar_archive(path: str, archive: str, ext_path: str):