# HG changeset patch # User Paul Boddie # Date 1242574391 -7200 # Node ID f87374e888a2b1aa15e8bd729c69d61a48260142 # Parent 5582d8b9d3ed697ebc79744a94a885e7a7eaf404 Added support for selecting the source of descriptions for the RSS feed, choosing between an explicit field in each event page, or the last comment made when such pages are edited. Exposed the descriptions and format settings in the EventAggregatorSummary interface. Updated release information. diff -r 5582d8b9d3ed -r f87374e888a2 EventAggregatorSupport.py --- a/EventAggregatorSupport.py Sun Apr 05 00:08:07 2009 +0200 +++ b/EventAggregatorSupport.py Sun May 17 17:33:11 2009 +0200 @@ -16,7 +16,7 @@ import time import re -__version__ = "0.2" +__version__ = "0.3" # Date labels. @@ -181,7 +181,7 @@ # Labels which may well be quoted. - elif term in ("title", "summary"): + elif term in ("title", "summary", "description"): desc = getSimpleWikiText(desc) if desc is not None: diff -r 5582d8b9d3ed -r f87374e888a2 README.txt --- a/README.txt Sun Apr 05 00:08:07 2009 +0200 +++ b/README.txt Sun May 17 17:33:11 2009 +0200 @@ -139,6 +139,13 @@ Copyright and licence information can be found in the docs directory - see docs/COPYING.txt and docs/LICENCE.txt for more information. +New in EventAggregator 0.3 (Changes since EventAggregator 0.2) +-------------------------------------------------------------- + + * Added a parameter to the EventAggregatorSummary action to select the + source of event descriptions for the RSS feed. + * Updated the documentation to cover the RSS support. + New in EventAggregator 0.2 (Changes since EventAggregator 0.1) -------------------------------------------------------------- diff -r 5582d8b9d3ed -r f87374e888a2 actions/EventAggregatorSummary.py --- a/actions/EventAggregatorSummary.py Sun Apr 05 00:08:07 2009 +0200 +++ b/actions/EventAggregatorSummary.py Sun May 17 17:33:11 2009 +0200 @@ -45,7 +45,15 @@ month_label = _(EventAggregatorSupport.getMonthLabel(month)) month_list.append('' % (month, month_label)) - year_label = [] + descriptions_list = [ + '' % ("page", _("page")), + '' % ("comment", _("comment")) + ] + + format_list = [ + '' % ("iCalendar", _("iCalendar")), + '' % ("RSS", _("RSS 2.0")) + ] d = { "buttons_html" : buttons_html, @@ -56,6 +64,10 @@ "start_year_default" : "", "end_label" : _("End year and month"), "end_year_default" : "", + "descriptions_label" : _("Use descriptions from..."), + "descriptions_list" : "\n".join(descriptions_list), + "format_label" : _("Summary format"), + "format_list" : "\n".join(format_list), } return ''' @@ -87,6 +99,22 @@ + + + + + + + + + + + + %(buttons_html)s @@ -140,6 +168,7 @@ category_names = request.form.get("category", []) format = request.form.get("format", ["iCalendar"])[0] + descriptions = request.form.get("descriptions", ["page"])[0] # Otherwise, produce an iCalendar resource. @@ -239,7 +268,16 @@ request.write('\r\n') request.write('%s\r\n' % wikiutil.escape(event_summary)) request.write('%s\r\n' % link) - request.write('%s\r\n' % wikiutil.escape(event_details["last-comment"])) + + # Write a description according to the preferred source of + # descriptions. + + if descriptions == "page": + description = event_details.get("description", "") + else: + description = event_details["last-comment"] + + request.write('%s\r\n' % wikiutil.escape(description)) for topic in event_details.get("topics") or event_details.get("categories") or []: request.write('%s\r\n' % topic) diff -r 5582d8b9d3ed -r f87374e888a2 setup.py --- a/setup.py Sun Apr 05 00:08:07 2009 +0200 +++ b/setup.py Sun May 17 17:33:11 2009 +0200 @@ -8,6 +8,6 @@ author = "Paul Boddie", author_email = "paul@boddie.org.uk", url = "http://moinmo.in/MacroMarket/EventAggregator", - version = "0.2", + version = "0.3", py_modules = ["EventAggregatorSupport"] )