From c25a4b47de7635af8cbd92d8195daf0f5c7ed209 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sat, 20 Jul 2024 16:22:07 +0200 Subject: [PATCH] fix expofiles photos not appearing --- parsers/logbooks.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/parsers/logbooks.py b/parsers/logbooks.py index 52c88b4..4bde3cc 100644 --- a/parsers/logbooks.py +++ b/parsers/logbooks.py @@ -233,17 +233,23 @@ def tidy_trip_cave(place): def tidy_trip_image_urls(text, date): y = str(date)[:4] + text = text.replace(' src="', f' src="/years/{y}/') text = text.replace(" src='", f" src='/years/{y}/") text = text.replace(f' src="/years/{y}//years/{y}/', f' src="/years/{y}/') text = text.replace(f" src='/years/{y}//years/{y}/", f" src='/years/{y}/") - text = text.replace(f' src="/years/{y}/expofiles/', f' src="/expofiles/') - text = text.replace(f" src='/years/{y}/expofiles/", f" src='/expofiles/") + text = text.replace(f' src="/years/{y}//expofiles/', f' src="/expofiles/') + text = text.replace(f" src='/years/{y}//expofiles/", f" src='/expofiles/") text = text.replace("\t", "") text = text.replace("\n\n\n", "\n\n") + + lines = text.splitlines() + for line in lines: + if "expofiles" in line: + print(f"tidy_trip_image_urls() - {y}\n {line}") return text def tidy_tid(tid, title):