# HG changeset patch # User Paul Boddie # Date 1238801565 -7200 # Node ID be6bc84b47040a024c32e9dfe54b109ae7834931 # Parent 69086565e2da89ed2e531c981aa9447f5b6cc5ec Replaced the getPageDate function with the getPageRevision function in order to provide datetime and comment information to the action. diff -r 69086565e2da -r be6bc84b4704 EventAggregatorSupport.py --- a/EventAggregatorSupport.py Fri Apr 03 01:30:01 2009 +0200 +++ b/EventAggregatorSupport.py Sat Apr 04 01:32:45 2009 +0200 @@ -88,17 +88,18 @@ mapping.sort() return mapping -def getPageDate(page): +def getPageRevision(page): - # From MoinMoin.xmlrpc... + # From Page.edit_info... - if hasattr(page, "edit_info"): - edit_info = page.edit_info() + if hasattr(page, "editlog_entry"): + line = page.editlog_entry() else: - edit_info = page.last_edit(page.request) # MoinMoin 1.5.x and 1.6.x + line = page._last_edited(page.request) # MoinMoin 1.5.x and 1.6.x - mtime = wikiutil.version2timestamp(long(edit_info['timestamp'])) # must be long for py 2.2.x - return time.gmtime(mtime) + timestamp = line.ed_time_usecs + mtime = wikiutil.version2timestamp(long(timestamp)) # must be long for py 2.2.x + return {"timestamp" : time.gmtime(mtime), "comment" : line.comment} def getHTTPTimeString(tmtuple): return "%s, %02d %s %04d %02d:%02d:%02d GMT" % ( @@ -465,9 +466,12 @@ # Get the created and last modified times. - event_details["created"] = getPageDate(event_page_initial) - event_details["last-modified"] = getPageDate(event_page) + initial_revision = getPageRevision(event_page_initial) + event_details["created"] = initial_revision["timestamp"] + latest_revision = getPageRevision(event_page) + event_details["last-modified"] = latest_revision["timestamp"] event_details["sequence"] = len(revisions) - 1 + event_details["last-comment"] = latest_revision["comment"] if latest is None or latest < event_details["last-modified"]: latest = event_details["last-modified"] diff -r 69086565e2da -r be6bc84b4704 actions/EventAggregatorSummary.py --- a/actions/EventAggregatorSummary.py Fri Apr 03 01:30:01 2009 +0200 +++ b/actions/EventAggregatorSummary.py Sat Apr 04 01:32:45 2009 +0200 @@ -236,6 +236,7 @@ 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"])) for topic in event_details.get("topics") or event_details.get("categories") or []: request.write('%s\r\n' % topic)