From 352de60a163a04a0c7e6015b7b7a9180ef43b408 Mon Sep 17 00:00:00 2001 From: Solderpunk Date: Tue, 17 Mar 2020 21:05:30 +0100 Subject: Advise user of feed title and URL when run interactively. --- gemfeed.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gemfeed.py b/gemfeed.py index b5b1d52..404cccd 100644 --- a/gemfeed.py +++ b/gemfeed.py @@ -102,6 +102,11 @@ def build_feed(directory, base_url, output="atom.xml", n=10, title="", if not title: title = get_feed_title(directory) + # Let user know feed title and URL + feed_url = urljoin(base_url, output) + if verbose: + print('Generating feed "{}", which should be served from {}'.format(title, feed_url)) + # Setup feed feed = FeedGenerator() feed.id(base_url) @@ -115,8 +120,8 @@ def build_feed(directory, base_url, output="atom.xml", n=10, title="", author_details["email"] = email if author_details: feed.author(author_details) + feed.link(href=feed_url, rel='self') feed.link(href=base_url, rel='alternate') - feed.link(href=urljoin(base_url, output), rel='self') # Add one entry per .gmi file files = find_files(directory, n) -- cgit v1.2.3-54-g00ecf