From 019bbc5e38b4e84faa1cade43fd7fdfed30ea14f Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Fri, 3 Dec 2021 17:05:24 -0500 Subject: [PATCH] fix asset error --- modules/config.py | 12 +++++++++++- modules/library.py | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/config.py b/modules/config.py index 3fa2cd5e..cd8977b1 100644 --- a/modules/config.py +++ b/modules/config.py @@ -142,7 +142,17 @@ class Config: else: message = f"Path {os.path.abspath(data[attribute])} does not exist" elif var_type == "list": return util.get_list(data[attribute], split=False) elif var_type == "list_path": - temp_list = [p for p in util.get_list(data[attribute], split=False) if os.path.exists(os.path.abspath(p))] + temp_list = [] + warning_message = "" + for p in util.get_list(data[attribute], split=False): + if os.path.exists(os.path.abspath(p)): + temp_list.append(p) + else: + if len(warning_message) > 0: + warning_message += "\n" + warning_message += f"Config Warning: Path does not exist: {os.path.abspath(p)}" + if do_print: + util.print_multiline(f"Config Warning: {warning_message}") if len(temp_list) > 0: return temp_list else: message = "No Paths exist" elif var_type == "lower_list": return util.get_list(data[attribute], lower=True) diff --git a/modules/library.py b/modules/library.py index fede7691..f5197c1c 100644 --- a/modules/library.py +++ b/modules/library.py @@ -34,7 +34,7 @@ class Library(ABC): self.name = params["name"] self.original_mapping_name = params["mapping_name"] self.metadata_path = params["metadata_path"] - self.asset_directory = params["asset_directory"] + self.asset_directory = params["asset_directory"] if params["asset_directory"] else [] self.default_dir = params["default_dir"] self.mapping_name, output = util.validate_filename(self.original_mapping_name) self.image_table_name = self.config.Cache.get_image_table_name(self.original_mapping_name) if self.config.Cache else None