mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +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. """
|
""" Return all installed packages from /val/log/packages folder. """
|
||||||
var_log_packages = Path(self.configs.log_packages)
|
var_log_packages = Path(self.configs.log_packages)
|
||||||
|
|
||||||
for file in var_log_packages.glob(pattern):
|
try:
|
||||||
package_name = self.split_installed_pkg(file.name)[0]
|
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():
|
if package_name not in self.black.packages():
|
||||||
yield file.name
|
yield file.name
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
|
||||||
def all_installed_names(self, pattern: str) -> Generator:
|
def all_installed_names(self, pattern: str) -> Generator:
|
||||||
""" Return all installed packages names from /val/log/packages folder. """
|
""" Return all installed packages names from /val/log/packages folder. """
|
||||||
var_log_packages = Path(self.configs.log_packages)
|
var_log_packages = Path(self.configs.log_packages)
|
||||||
|
|
||||||
for file in var_log_packages.glob(pattern):
|
try:
|
||||||
package_name = self.split_installed_pkg(file.name)[0]
|
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():
|
if package_name not in self.black.packages():
|
||||||
yield self.split_installed_pkg(file.name)[0]
|
yield self.split_installed_pkg(file.name)[0]
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def remove_file_if_exists(path: str, file: str) -> None:
|
def remove_file_if_exists(path: str, file: str) -> None:
|
||||||
|
|
Loading…
Add table
Reference in a new issue