From c98a443a4ac41f2712bc451fca649eee6f61959a Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 10 Sep 2013 12:04:05 -0700 Subject: [PATCH] feed: Convert 'friendly-name' setting to 'name-format' In Debian bug 722009, Joey Hess wrote about the 2.x series [1]: > The current From line generated by r2e is From: Blog: Author > where > Blog is the name of the blog, or some page like a wiki's RecentChanges > Author is the author of a post > iff the blog sets that info in the feed > > In mutt the Blog part often occupies the whole displayed Subject field, > which is fixed width. So the Author cannot be seen. This is particularly > a problem with planets, where the author of a post matters a lot. > But also with some blogs that have multiple authors. > > For these sorts of blogs, I would generally prefer to use a From line > like From: Author (Blog) > This does mean that when sorting by author, all posts of a blog or > planet feed may not appear together, but that would be an acceptable > tradeoff to me. > > One way to implement this (other than just changing the format string) > would be to make OVERRIDE_FROM able to contain a format string, > so it could be configured on a per-feed basis. The new setup makes the name-formatting configurable on a per feed basis (what Joey wanted), but it's not without side effects. For feeds where some information is missing (feed-title, author, or publisher), we used to adjust the formatting on the fly. For example, you'd get output like '{author}' if the feed-title was missing, instead of getting ': {author}'. Now users bothered by this will have to manually override the format template for feeds missing crucial data. [1]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=722009 Signed-off-by: W. Trevor King --- CHANGELOG | 3 +++ r2e.1 | 6 +++--- rss2email/config.py | 8 +++++--- rss2email/feed.py | 31 ++++++++++++++++--------------- 4 files changed, 27 insertions(+), 21 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 3ab01fe..2cd8b68 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +v3.7 (unreleased) + * Convert the `friendly-name` boolean to the new `name-format` setting. This allow users to customize how the friendly name is constructed. + v3.6 (2013-09-09) * Fix missing port argument for IMAPAuthenticationError. * Fix `