summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolderpunk <solderpunk@sdf.org>2020-03-17 21:05:30 +0100
committerSolderpunk <solderpunk@sdf.org>2020-03-17 21:05:30 +0100
commit352de60a163a04a0c7e6015b7b7a9180ef43b408 (patch)
treefd26db94b9a5f4767ec7be29bcbae23a7bbd2ce9
parenta033b7364017c28ce930c50ffbff09656fa1ebb4 (diff)
Advise user of feed title and URL when run interactively.
-rw-r--r--gemfeed.py7
1 files changed, 6 insertions, 1 deletions
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)