straw-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Straw-devel] link/guid behaviour, feedparser changes and tracking upstr


From: Juri Pakaste
Subject: [Straw-devel] link/guid behaviour, feedparser changes and tracking upstream
Date: Sun, 27 Jun 2004 15:34:51 +0300

I had to change feedparser and SummaryParser a bit to get us what I see
as the correct behaviour with links and guids.

First of all, our version of feedparser now saves the guidislink
attribute (in RSS, it's the isPermalink attribute of the guid element.)
That'll mean we can't use an externally installed feedparser library,
but so be it. It's not the first time I've had to make that change; this
time, I preceded it with a comment starting with "straw:". That's
probably a good idea in other places too where we have to make changes
to source code that tries to track an upstream source, it'll make it
possible for us to grep for local changes. 

Second, I changed the logic in SummaryParser. I replaced this:
         if item.guidislink:
             # guid == link
             if entry.has_key('link'):
                 item.link = entry.link
         else:
             if entry.has_key('id'):
                 item.guid = entry.id

With this:
       item.link = entry.get('link', None)
       item.guid = entry.get('id', None)

I couldn't quite make sense of the logic of the original, but it looks
broken to me (surely it should save the link attribute, especially when
guidislink == False?) Jan, was here something I was missing?

-- 
[ Juri Pakaste | address@hidden | http://www.iki.fi/juri/ ]

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]