temboz - Check-in [467]
Not logged in
[Honeypot]  [Browse]  [Help]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline]  [Wiki
  [Patchset]  [Tagging/Branching
Check-in Number: 467
Date: 2010-Mar-13 12:47:49 (local)
2010-Mar-13 20:47:49 (UTC)
User:majid
Branch:
Comment: normalization fix - feeds with PubSubHubbub links could not be added
Tickets:
Inspections:
Files:
temboz/update.py      1.77 -> 1.78     9 inserted, 0 deleted

temboz/update.py 1.77 -> 1.78
--- /tmp/T0tNa4fX	Mon Sep  6 17:52:23 2010
+++ /tmp/T1uNa4fX	Mon Sep  6 17:52:23 2010
@@ -77,6 +77,15 @@
     # see:
     # http://sourceforge.net/tracker/index.php?func=detail&aid=1379172&group_id=112328&atid=661937
     if not f.feed or ('link' not in f.feed or 'title' not in f.feed):
+      # some feeds have multiple links, one for self and one for PuSH
+      if f.feed and 'link' not in f.feed and 'links' in f.feed:
+        try:
+          for l in f.feed['links']:
+            if l['rel'] == 'self':
+              f.feed['link'] = l['href']
+        except KeyError:
+          pass
+    if not f.feed or ('link' not in f.feed or 'title' not in f.feed):
       # try autodiscovery
       try:
         feed_xml = AutoDiscoveryHandler().feed_url(feed_xml)