Updated for file pattern

This commit is contained in:
Dimitris Zlatanidis 2024-03-15 18:26:51 +02:00
parent ff2b269209
commit d246d6beee

View file

@ -3,7 +3,6 @@
import os import os
import re import re
import glob
import time import time
import shutil import shutil
import fnmatch import fnmatch
@ -30,11 +29,9 @@ class Utilities(Configs):
self.stdout = None self.stdout = None
self.prog_version = Version() self.prog_version = Version()
# self.installed_packages: dict = dict(self.all_installed())
def is_package_installed(self, name: str) -> str: def is_package_installed(self, name: str) -> str:
""" Returns the installed package binary. """ """ Returns the installed package binary. """
installed_package: Generator = Path(self.log_packages).glob(f'{name}*') installed_package: Generator = Path(self.log_packages).glob(f'{name}{self.file_pattern}')
for installed in installed_package: for installed in installed_package:
inst_name: str = self.split_package(installed.name)['name'] inst_name: str = self.split_package(installed.name)['name']
if inst_name == name: if inst_name == name: