summaryrefslogtreecommitdiffstats
path: root/parsers/logbooks.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2024-07-20 16:22:07 +0200
committerPhilip Sargent <philip.sargent@gmail.com>2024-07-20 16:22:07 +0200
commitc25a4b47de7635af8cbd92d8195daf0f5c7ed209 (patch)
treefaa1603eed266a2d1425fa7b069db683c58e3bfe /parsers/logbooks.py
parent78bc7323e9b1c34f74f2c1c59d1333820cedb4f1 (diff)
downloadtroggle-c25a4b47de7635af8cbd92d8195daf0f5c7ed209.tar.gz
troggle-c25a4b47de7635af8cbd92d8195daf0f5c7ed209.tar.bz2
troggle-c25a4b47de7635af8cbd92d8195daf0f5c7ed209.zip
fix expofiles photos not appearing
Diffstat (limited to 'parsers/logbooks.py')
-rw-r--r--parsers/logbooks.py10
1 files 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):