From 52dcc036029b3fe07b3dff4399f5f2bc6ca99da0 Mon Sep 17 00:00:00 2001 From: manetta Date: Tue, 26 Oct 2021 08:36:48 +0200 Subject: [PATCH] switching url's: from possiblebodies.constantvzw.org/book to volumetricregimes.xyz --- command-line/update.py | 12 ++++++------ web-interface/update.py | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/command-line/update.py b/command-line/update.py index 79a0e1c..8081dbf 100644 --- a/command-line/update.py +++ b/command-line/update.py @@ -83,12 +83,12 @@ def download_media(html, images, wiki): # replace src link image_path = f'{ PUBLIC_STATIC_FOLDER_PATH }/images/{ filename }' # here the images need to link to the / of the domain, for flask :/// confusing! this breaks the whole idea to still be able to make a local copy of the file - matches = re.findall(rf'src="/book/images/.*?px-{ filename }"', html) # for debugging + matches = re.findall(rf'src="/images/.*?px-{ filename }"', html) # for debugging if matches: - html = re.sub(rf'src="/book/images/.*?px-{ filename }"', f'src="{ image_path }"', html) + html = re.sub(rf'src="/images/.*?px-{ filename }"', f'src="{ image_path }"', html) else: - matches = re.findall(rf'src="/book/images/.*?{ filename }"', html) # for debugging - html = re.sub(rf'src="/book/images/.*?{ filename }"', f'src="{ image_path }"', html) + matches = re.findall(rf'src="/images/.*?{ filename }"', html) # for debugging + html = re.sub(rf'src="/images/.*?{ filename }"', f'src="{ image_path }"', html) # print(f'{filename}: {matches}\n------') # for debugging: each image should have the correct match! return html @@ -148,7 +148,7 @@ def clean_up(html): html = string (HTML) """ html = re.sub(r'\[.*edit.*\]', '', html) # remove the [edit] - html = re.sub(r'href="/book/index.php\?title=', 'href="#', html) # remove the internal wiki links + html = re.sub(r'href="/index.php\?title=', 'href="#', html) # remove the internal wiki links html = re.sub(r'[(?=\d)', '', html) # remove left footnote bracket [ html = re.sub(r'(?<=\d)]', '', html) # remove right footnote bracket ] return html @@ -233,7 +233,7 @@ def update_material_now(pagename, wiki): if __name__ == "__main__": - wiki = 'https://possiblebodies.constantvzw.org/book' # remove tail slash '/' + wiki = 'https://volumetricregimes.xyz' # remove tail slash '/' pagename = 'Unfolded' publication_unfolded = update_material_now(pagename, wiki) # download the latest version of the page diff --git a/web-interface/update.py b/web-interface/update.py index c0406af..672e8c4 100644 --- a/web-interface/update.py +++ b/web-interface/update.py @@ -84,12 +84,12 @@ def download_media(html, images, wiki): # replace src link image_path = f'{ PUBLIC_STATIC_FOLDER_PATH }/images/{ filename }' # here the images need to link to the / of the domain, for flask :/// confusing! this breaks the whole idea to still be able to make a local copy of the file - matches = re.findall(rf'src="/book/images/.*?px-{ filename }"', html) # for debugging + matches = re.findall(rf'src="/images/.*?px-{ filename }"', html) # for debugging if matches: - html = re.sub(rf'src="/book/images/.*?px-{ filename }"', f'src="{ image_path }"', html) + html = re.sub(rf'src="/images/.*?px-{ filename }"', f'src="{ image_path }"', html) else: - matches = re.findall(rf'src="/book/images/.*?{ filename }"', html) # for debugging - html = re.sub(rf'src="/book/images/.*?{ filename }"', f'src="{ image_path }"', html) + matches = re.findall(rf'src="/images/.*?{ filename }"', html) # for debugging + html = re.sub(rf'src="/images/.*?{ filename }"', f'src="{ image_path }"', html) # print(f'{filename}: {matches}\n------') # for debugging: each image should have the correct match! return html @@ -149,7 +149,7 @@ def clean_up(html): html = string (HTML) """ html = re.sub(r'\[.*edit.*\]', '', html) # remove the [edit] - html = re.sub(r'href="/book/index.php\?title=', 'href="#', html) # remove the internal wiki links + html = re.sub(r'href="/index.php\?title=', 'href="#', html) # remove the internal wiki links html = re.sub(r'[(?=\d)', '', html) # remove left footnote bracket [ html = re.sub(r'(?<=\d)]', '', html) # remove right footnote bracket ] return html @@ -234,7 +234,7 @@ def update_material_now(pagename, wiki): if __name__ == "__main__": - wiki = 'https://possiblebodies.constantvzw.org/book' # remove tail slash '/' + wiki = 'https://volumetricregimes.xyz' # remove tail slash '/' pagename = 'Unfolded' publication_unfolded = update_material_now(pagename, wiki) # download the latest version of the page