From f0562049b6e681f60bd4465c0d8610675d6aaaa8 Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Wed, 30 Dec 2020 17:18:04 +0100 Subject: [PATCH] Remove Python 3.9 method in crawler --- PFERD/ilias/crawler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PFERD/ilias/crawler.py b/PFERD/ilias/crawler.py index 86bf045..93b626e 100644 --- a/PFERD/ilias/crawler.py +++ b/PFERD/ilias/crawler.py @@ -281,7 +281,10 @@ class IliasCrawler: result += [IliasCrawlerEntry(element_path, abs_url, element_type, None)] continue - rest_of_name = meeting_name.removeprefix(date_portion_str) + rest_of_name = meeting_name + if rest_of_name.startswith(date_portion_str): + rest_of_name = rest_of_name[len(date_portion_str):] + new_name = datetime.datetime.strftime(date_portion, "%Y-%m-%d, %H:%M") \ + rest_of_name new_path = Path(folder_path, _sanitize_path_name(new_name))