From cd569c76aaa813d45d751738ff2ca5591472c94a Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Fri, 16 Dec 2022 23:20:26 +0100 Subject: [PATCH 1/3] Changed deprecated format of description_file in setup.cfg --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index d7bb3fa605..bb8de17aac 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,7 +4,7 @@ commit = True tag = True [metadata] -description-file = README.md +description_file = README.md [flake8] max-line-length = 120 From 152ebdf7377453bbcba0f59c7a40fcc2cbb3ec7f Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 17 Dec 2022 00:21:32 +0100 Subject: [PATCH 2/3] [#236] Added `author` and `tags` attributes to new feed entry event and schema objects. --- platypush/message/event/rss.py | 31 +++++++++++++++++++----- platypush/plugins/rss/__init__.py | 6 +++++ platypush/schemas/rss.py | 40 +++++++++++++++++-------------- 3 files changed, 53 insertions(+), 24 deletions(-) diff --git a/platypush/message/event/rss.py b/platypush/message/event/rss.py index e3a8657d26..0c98f49585 100644 --- a/platypush/message/event/rss.py +++ b/platypush/message/event/rss.py @@ -1,5 +1,5 @@ from datetime import datetime -from typing import Optional +from typing import Iterable, Optional from platypush.message.event import Event @@ -10,11 +10,30 @@ class NewFeedEntryEvent(Event): """ def __init__( - self, *, feed_url: str, url: str, title: Optional[str] = None, id: Optional[str] = None, - feed_title: Optional[str] = None, published: Optional[datetime] = None, summary: Optional[str] = None, - content: Optional[str] = None, **kwargs + self, + *, + feed_url: str, + url: str, + title: Optional[str] = None, + id: Optional[str] = None, + feed_title: Optional[str] = None, + published: Optional[datetime] = None, + summary: Optional[str] = None, + content: Optional[str] = None, + author: Optional[str] = None, + tags: Optional[Iterable[str]] = None, + **kwargs ): super().__init__( - feed_url=feed_url, url=url, title=title, id=id, feed_title=feed_title, - published=published, summary=summary, content=content, **kwargs + feed_url=feed_url, + url=url, + title=title, + id=id, + feed_title=feed_title, + published=published, + summary=summary, + content=content, + author=author, + tags=tags or [], + **kwargs ) diff --git a/platypush/plugins/rss/__init__.py b/platypush/plugins/rss/__init__.py index 10ef835075..ae274af13d 100644 --- a/platypush/plugins/rss/__init__.py +++ b/platypush/plugins/rss/__init__.py @@ -129,6 +129,12 @@ class RssPlugin(RunnablePlugin): 'title': entry.title, 'summary': getattr(entry, 'summary', None), 'content': self._parse_content(entry), + 'author': getattr(entry, 'author', None), + 'tags': [ + tag['term'] + for tag in getattr(entry, 'tags', []) + if tag.get('term') + ], } for entry in feed.entries if getattr(entry, 'published_parsed', None) diff --git a/platypush/schemas/rss.py b/platypush/schemas/rss.py index 0298b21628..47cc716757 100644 --- a/platypush/schemas/rss.py +++ b/platypush/schemas/rss.py @@ -5,36 +5,40 @@ from platypush.schemas import DateTime class RssFeedEntrySchema(Schema): - feed_title = fields.String(metadata=dict(description='Feed title')) + feed_title = fields.String(metadata={'description': 'Feed title'}) feed_url = fields.URL( required=True, - metadata=dict( - description='URL of the feed', - example='https://some-website/rss', - ) + metadata={ + 'description': 'URL of the feed', + 'example': 'https://some-website/rss', + }, ) id = fields.String( required=True, - metadata=dict( - description='Feed entry ID', - example='1234', - ) + metadata={ + 'description': 'Feed entry ID', + 'example': '1234', + }, ) url = fields.URL( required=True, - metadata=dict( - description='URL of the feed entry', - example='https://some-website/articles/1234', - ) + metadata={ + 'description': 'URL of the feed entry', + 'example': 'https://some-website/articles/1234', + }, ) published = DateTime( - required=True, - metadata=dict(description='Entry published time') + required=True, metadata={'description': 'Entry published time'} ) - title = fields.String(metadata=dict(description='Feed entry title')) - summary = fields.String(metadata=dict(description='Feed entry summary')) - content = fields.String(metadata=dict(description='Feed entry content')) + title = fields.String(metadata={'description': 'Feed entry title'}) + summary = fields.String(metadata={'description': 'Feed entry summary'}) + content = fields.String(metadata={'description': 'Feed entry content'}) + author = fields.String(metadata={'description': 'Feed entry author'}) + tags = fields.List( + fields.String(), + metadata={'description': 'Feed entry tags'}, + ) From 6666f5581c48968bea88e5b8ef215b4222877e80 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 17 Dec 2022 00:29:21 +0100 Subject: [PATCH 3/3] =?UTF-8?q?Bump=20version:=200.24.2=20=E2=86=92=200.24?= =?UTF-8?q?.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 +++- platypush/__init__.py | 2 +- setup.cfg | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0737db1b3..9c543f254d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,15 @@ All notable changes to this project will be documented in this file. Given the high speed of development in the first phase, changes are being reported only starting from v0.20.2. -## [Unreleased] +## [0.24.3] - 2022-12-17 ### Added - Added `[-v|--verbose]` command-line option to override the default logging configuration and enable debug logging. - Added `--version` command-line option to print the current version and exit. +- [[#236](https://git.platypush.tech/platypush/platypush/issues/236)] Added + support for `author` and `tags` attributes on feed entries. ## [0.24.2] - 2022-12-10 diff --git a/platypush/__init__.py b/platypush/__init__.py index 8318427108..bb9970e856 100644 --- a/platypush/__init__.py +++ b/platypush/__init__.py @@ -23,7 +23,7 @@ from .message.response import Response from .utils import set_thread_name, get_enabled_plugins __author__ = 'Fabio Manganiello ' -__version__ = '0.24.2' +__version__ = '0.24.3' logger = logging.getLogger('platypush') diff --git a/setup.cfg b/setup.cfg index bb8de17aac..43af879320 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.24.2 +current_version = 0.24.3 commit = True tag = True diff --git a/setup.py b/setup.py index 16bacf3a04..7a1efbc429 100755 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ backend = pkg_files('platypush/backend') setup( name="platypush", - version="0.24.2", + version="0.24.3", author="Fabio Manganiello", author_email="info@fabiomanganiello.com", description="Platypush service",