From 8f3f93fc343fd37156a4487b6b09080ef8a7aa39 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Mon, 1 Aug 2022 21:11:41 +0200 Subject: [PATCH] Test, improve duplicate file log. #20 --- src/rich_codex/codex_search.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rich_codex/codex_search.py b/src/rich_codex/codex_search.py index 4f7c9dc..2afeaad 100644 --- a/src/rich_codex/codex_search.py +++ b/src/rich_codex/codex_search.py @@ -395,7 +395,9 @@ def check_duplicate_paths(self): img_paths_src[img_path] = [ri.source] for img_path, src in img_paths_src.items(): if len(src) > 1: - log.warning(f"Duplicate output file path: '{img_path}' found in '{', '.join(src)}'") + img_path_rel = Path(img_path).relative_to(Path.cwd()) + src_paths = "', '".join(set(str(s.relative_to(Path.cwd())) for s in src)) + log.warning(f"Duplicate output file path '{img_path_rel}' found in '{src_paths}'") def save_all_images(self): """Save the images that we have collected."""