From 1c770c24b6ab74aaa964c29086d64822c9f798df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sondre=20Gr=C3=B8n=C3=A5s?= <44143748+sondregronas@users.noreply.github.com> Date: Fri, 8 Nov 2024 17:26:07 +0100 Subject: [PATCH 1/2] ci(revert): changes to localhost url --- .github/workflows/web_scraper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/web_scraper.py b/.github/workflows/web_scraper.py index 1abebe3..b87fe42 100644 --- a/.github/workflows/web_scraper.py +++ b/.github/workflows/web_scraper.py @@ -15,7 +15,7 @@ links = ["/"] # A list of links we need to visit and download (including files that are related to the website) visited = [] # A list of links we have visited media_links = [] -url = "http://localhost:5000" # The URL of the website we are scraping +url = "http://127.0.0.1:5000" # The URL of the website we are scraping cname = "https://piggy.iktim.no" # The CNAME of the website we will push the demo to os.chdir(os.path.dirname(os.path.abspath(__file__))) From f66ff748c672f3b0d3e61a0824f647ca9947240f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sondre=20Gr=C3=B8n=C3=A5s?= <44143748+sondregronas@users.noreply.github.com> Date: Sat, 9 Nov 2024 14:03:05 +0100 Subject: [PATCH 2/2] fix: log and ignore broken translations --- piggy/piggybank.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/piggy/piggybank.py b/piggy/piggybank.py index 93551e6..3e9f217 100644 --- a/piggy/piggybank.py +++ b/piggy/piggybank.py @@ -137,8 +137,13 @@ def generate_piggymap(path: Path, max_levels: int = 5, _current_level: int = 0): for lang in os.listdir(f"{path}/translations") if os.path.isdir(f"{path}/translations") else []: if not os.path.exists(f"{path}/translations/{lang}/{item}"): continue - translation_sections = mdfile_to_sections(Path(f"{path}/translations/{lang}/{item}")) - translation_meta[lang] = translation_sections["meta"] + try: + translation_sections = mdfile_to_sections(Path(f"{path}/translations/{lang}/{item}")) + translation_meta[lang] = translation_sections["meta"] + except Exception: + # TODO: Handle / visualize this error better + print(f"Error: Could not render translation for {lang}/{item}") + continue assignment_key = normalize_path_to_str(i, replace_spaces=True, normalize_url=True, remove_ext=True) piggymap[assignment_key] = {