[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] svn2feed.py: Place author information in feed metadata

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: 2006-08-24 17:09:56 CEST

Bhuvaneswaran Arumugam wrote:
> Hello,
>
> Please find attached the patch. The patch is created on top of my
> earlier patch[1] and it is not yet committed.
> [1] http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=118656

Patch looks good. Couple of minor nits.

>
> Place item author information in feed metadata.
>
> [[
> * contrib/hook-scripts/svn2feed.py
> (global): Remove the TODO item.
> (Svn2Feed._get_item_dict): Remove the date information from desc to
> avoid redundancy. Strip the newline and store the author information
> in data structure.
> (Svn2RSS._make_rss_item): Pass author information to RSSItem function.
> (Svn2Atom._make_atom_item): Create a new tag for author and append it
> to the entry.

Your one-liner explanation belongs *inside* the log message delimiters,
right? :-) Also, the log message doesn't mention new
Svn2Feed._format_updated_ts() function.

> item_dict = {
> + 'author': info_lines[0].strip('\n'),
> 'title': "Revision %s" % revision,
> 'link': self.item_url and "%s?rev=%s" % (self.item_url, revision),
> - 'date': datetime.datetime.now(),
> + 'date': self._format_updated_ts(info_lines[1]),
> 'description': desc,
> }
>
> return item_dict
>
> + def _format_updated_ts(self, revision_ts):
>
> + # Get "2006-08-10 20:17:08" from
> + # "2006-07-28 20:17:18 +0530 (Fri, 28 Jul 2006)
> + date = revision_ts[0:19]
> + epoch = time.mktime(time.strptime(date, "%Y-%m-%d %H:%M:%S"))
> + return time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime(epoch))

Comment here ("Get ...") doesn't seem to match the actual code behavior.

I'll make the necessary minor tweaks and commit up.

-- 
C. Michael Pilato <cmpilato@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Received on Thu Aug 24 17:13:35 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.