From 58b32dea0db0bb5baf14962001f833c56bb4a462 Mon Sep 17 00:00:00 2001 From: wirthual Date: Tue, 18 Jun 2024 04:11:43 +0200 Subject: [PATCH] format --- .../lebensmittelwarnung.py | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/deutschland/lebensmittelwarnung/lebensmittelwarnung.py b/src/deutschland/lebensmittelwarnung/lebensmittelwarnung.py index 43286dc..84cf9fd 100644 --- a/src/deutschland/lebensmittelwarnung/lebensmittelwarnung.py +++ b/src/deutschland/lebensmittelwarnung/lebensmittelwarnung.py @@ -18,7 +18,7 @@ class WarningFeedUrl: "kosmetischemittel", "bedarfsgegenstaende", "mittelzumtaetowieren", - "babyundkinderprodukte" + "babyundkinderprodukte", ] VALID_REGION_SELECTORS = [ @@ -41,25 +41,22 @@ class WarningFeedUrl: "thueringen", ] - SOURCE_STRING = ( - "https://www.lebensmittelwarnung.de/___LMW-Redaktion/RSSNewsfeed/Functions/RssFeeds/rssnewsfeed_Alle_DE.xml?nn=314268{0}{1}" - ) + SOURCE_STRING = "https://www.lebensmittelwarnung.de/___LMW-Redaktion/RSSNewsfeed/Functions/RssFeeds/rssnewsfeed_Alle_DE.xml?nn=314268{0}{1}" def __init__(self, content: str, region: str): if ( content in self.VALID_CONTENT_SELECTORS and region in self.VALID_REGION_SELECTORS ): - if content=="alle": - content="" + if content == "alle": + content = "" else: - content=f"&type={content}" + content = f"&type={content}" - if region=="alle_bundeslaender": - region="" + if region == "alle_bundeslaender": + region = "" else: - region=f"&state={region}" - + region = f"&state={region}" self.url = self.SOURCE_STRING.format(content, region) else: @@ -132,8 +129,9 @@ def __parse(self, warning_raw: PageElement) -> str: self.dict["guid"] = guid self.dict["pubDate"] = warning_raw.find("pubDate").text self.dict["description"] = warning_raw.find("description").text - self.dict["link"]=guid + self.dict["link"] = guid self.dict["title"] = warning_raw.find("title").text + def get_warning(self) -> dict: return self.dict