From 725aa7d681764ab43b02dc3e56ecf2ee005f78ed Mon Sep 17 00:00:00 2001 From: dece Date: Tue, 13 Sep 2022 18:23:54 +0200 Subject: [PATCH] journee_mondiale: fix various issues --- edmond/plugins/journee_mondiale.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/edmond/plugins/journee_mondiale.py b/edmond/plugins/journee_mondiale.py index 5ef55f7..480d743 100644 --- a/edmond/plugins/journee_mondiale.py +++ b/edmond/plugins/journee_mondiale.py @@ -31,6 +31,7 @@ class JourneeMondialePlugin(Plugin): """ REQUIRED_CONFIGS = ["commands", "dates", "no_entry_reply"] + JMCOM_URL = "https://www.journee-mondiale.com" def __init__(self, bot): super().__init__(bot) @@ -64,11 +65,11 @@ class JourneeMondialePlugin(Plugin): ), ) days = ", ".join(today_obs) - return reply + return days def get_jmcom_days(self) -> str: """Get international days from journee-mondiale.com.""" - response = http_get(self.config["url"]) + response = http_get(JourneeMondialePlugin.JMCOM_URL) if not response: return "" @@ -77,13 +78,16 @@ class JourneeMondialePlugin(Plugin): try: items = soup.find("div", id="journeesDuJour").find_all("article") for item in items: - entries.append({ - "url": item.find("a").href, - "title": item.find("h2").string, - }) + entries.append( + { + "url": item.find("a").href, + "title": item.find("h2").string, + } + ) except (ValueError, KeyError): return "" # TODO add plus plugin support - return ", ".join(map(lambda i: i["title"], entries)) + days = ", ".join(map(lambda i: i["title"], entries)) + return days