Updated for installed

This commit is contained in:
Dimitris Zlatanidis 2023-04-26 18:14:09 +03:00
parent 2b39b88986
commit c5b62a936b

View file

@ -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: