From c5b62a936b85ed4d067ca159e6513eb2e1304dce Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Wed, 26 Apr 2023 18:14:09 +0300 Subject: [PATCH] Updated for installed --- slpkg/utilities.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/slpkg/utilities.py b/slpkg/utilities.py index e31de5fc..0583f0ee 100644 --- a/slpkg/utilities.py +++ b/slpkg/utilities.py @@ -40,20 +40,11 @@ class Utilities(Configs): def all_installed(self) -> dict: """ Return all installed packages from /val/log/packages folder. """ - var_log_packages: Path = Path(self.log_packages) + for file in self.log_packages.glob(self.file_pattern): + name: str = self.split_binary_pkg(file.name)[0] - try: - for file in var_log_packages.glob(self.file_pattern): - name = self.split_binary_pkg(file.name)[0] - - if not name.startswith('.') and not self.blacklist_pattern(name): - yield name, file.name - - except ValueError as err: - logger = logging.getLogger(__name__) - logger.info('%s: %s: %s', self.__class__.__name__, - Utilities.all_installed.__name__, - err) + if not name.startswith('.') and not self.blacklist_pattern(name): + yield name, file.name @staticmethod def remove_file_if_exists(path: Path, file: str) -> None: