Commits

Marcin Kasperski  committed 2cb38d9

greader2org get removes postrank_feed attribute if still present, they are no
longer of any use.

  • Participants
  • Parent commits 1f0dc83

Comments (0)

Files changed (1)

File src/mekk/feeds/greader2org/update_from_google.py

             else:
                 raise Exception("Ugly feed: %s" % feed_url)
         
-            # In case some postrank feed is still present, replacing
-            # it with normal one
+            # In case some postrank feed is still present on Google,
+            # we replace it with normal URL
             m = re_postrank.match(feed_url)
             if m:
                 feed_url = m.group(1)
         
             all_google_feeds.add(feed_url)
         
-        # Marking unsubscribed feeds as disabled
+        # Marking unsubscribed feeds as disabled, and other cleanups
         for folder in self.org.folders:
             for org_feed in folder.feeds:
-                if org_feed.feed in all_google_feeds:
-                    continue
-                if not 'disabled' in org_feed.tags:
-                    print "Marking unsubscribed feed %s as disabled" % feed.title
-                    org_feed.tags.append('disabled')
+                if org_feed.feed not in all_google_feeds:
+                    if 'disabled' not in org_feed.tags:
+                        print "Marking unsubscribed feed %s as disabled" % org_feed.title
+                        org_feed.tags.append('disabled')
+                # Drop postrank_feed attribute if still present
+                if org_feed.postrank_feed:
+                    if org_feed.feed:
+                        print "Dropping legacy postrank_feed info for %s" % org_feed.title
+                        org_feed.postrank_feed = None
+                    else:
+                        print "Feed %s has only postrank url specified, so is usess. Consider removing it"
         
         self.org.save_to()