From b335495aadc9f5116a88d0359087ae33c9524aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Gl=C3=BCpker?= Date: Wed, 1 May 2024 10:20:30 +0200 Subject: Fix dataclass usage --- rss.py | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) (limited to 'rss.py') diff --git a/rss.py b/rss.py index ccf0cb5..dc16628 100755 --- a/rss.py +++ b/rss.py @@ -1,8 +1,9 @@ #!/usr/bin/env python3 -from dataclasses import dataclass from datetime import datetime +from rss_types import RSSFeed + def _format_date(dt): """convert a datetime into an RFC 822 formatted date @@ -50,39 +51,12 @@ def _format_date(dt): ) -@dataclass -class RSSItem: - title: str - url: str - content: str - date: str - enclosures: list[str] - guid: str - - -@dataclass -class RSSFeed: - title: str - url: str - description: str - content: list[RSSItem] - - def escape(str): str = str.replace("&", "&") return str def buildRSS(feed_data: RSSFeed): - """ - feed_data = { - title, url, description, - content = [{ - title, url, content, date, [enclosures], guid - }] - } - """ - feed = f""" -- cgit v1.2.3