mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-31 10:26:39 +01:00
Fixed ValueError for glob
This commit is contained in:
parent
7ddd72adaa
commit
e1e40b2968
1 changed files with 14 additions and 8 deletions
|
@ -43,21 +43,27 @@ class Utilities:
|
|||
""" Return all installed packages from /val/log/packages folder. """
|
||||
var_log_packages = Path(self.configs.log_packages)
|
||||
|
||||
for file in var_log_packages.glob(pattern):
|
||||
package_name = self.split_installed_pkg(file.name)[0]
|
||||
try:
|
||||
for file in var_log_packages.glob(pattern):
|
||||
package_name = self.split_installed_pkg(file.name)[0]
|
||||
|
||||
if package_name not in self.black.packages():
|
||||
yield file.name
|
||||
if package_name not in self.black.packages():
|
||||
yield file.name
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
def all_installed_names(self, pattern: str) -> Generator:
|
||||
""" Return all installed packages names from /val/log/packages folder. """
|
||||
var_log_packages = Path(self.configs.log_packages)
|
||||
|
||||
for file in var_log_packages.glob(pattern):
|
||||
package_name = self.split_installed_pkg(file.name)[0]
|
||||
try:
|
||||
for file in var_log_packages.glob(pattern):
|
||||
package_name = self.split_installed_pkg(file.name)[0]
|
||||
|
||||
if package_name not in self.black.packages():
|
||||
yield self.split_installed_pkg(file.name)[0]
|
||||
if package_name not in self.black.packages():
|
||||
yield self.split_installed_pkg(file.name)[0]
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def remove_file_if_exists(path: str, file: str) -> None:
|
||||
|
|
Loading…
Reference in a new issue