straw-devel
[Top][All Lists]
Advanced

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

[Straw-devel] Re: link/guid behaviour, feedparser changes and tracking u


From: Jan Alonzo
Subject: [Straw-devel] Re: link/guid behaviour, feedparser changes and tracking upstream
Date: Mon, 28 Jun 2004 17:55:33 +1000
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux)

Juri Pakaste <address@hidden> writes:

> 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. 
>

Ermm... If you read the feedparser docs, it stores '<guid>' in 'link' _if_
isPermalink is present so we don't have to do that.


> 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?

See my above post.

We don't have to change anything in feedparser 3.x actually since it already
supports the stuff we support.


Cheers,


-- 
Jan Alonzo                          <address@hidden>




reply via email to

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