Fix ArchivedArticles' update function.
authorNeal H. Walfield <neal@walfield.org>
Sun, 27 Nov 2011 19:34:35 +0000 (20:34 +0100)
committerNeal H. Walfield <neal@walfield.org>
Sun, 27 Nov 2011 19:34:35 +0000 (20:34 +0100)
 - Use the dispatcher so that the update daemon does the update.
 - Call postFeedUpdateFunc on completion.

src/rss_sqlite.py

index 503c9d3..09f8462 100644 (file)
@@ -887,7 +887,8 @@ class ArchivedArticles(Feed):
         self.db.execute("INSERT INTO feed (id, title, contentLink, date, updated, link, read) VALUES (?, ?, ?, ?, ?, ?, ?);", values)
         self.db.commit()
 
-    def updateFeed(self, configdir, url, etag, modified, expiryTime=24, proxy=None, imageCache=False, priority=0, postFeedUpdateFunc=None, *postFeedUpdateFuncArgs):
+    # Feed.UpdateFeed calls this function.
+    def _updateFeed(self, configdir, url, etag, modified, expiryTime=24, proxy=None, imageCache=False, priority=0, postFeedUpdateFunc=None, *postFeedUpdateFuncArgs):
         currentTime = 0
         rows = self.db.execute("SELECT id, link FROM feed WHERE updated=0;")
         for row in rows:
@@ -917,7 +918,10 @@ class ArchivedArticles(Feed):
             except:
                 logger.error("Error updating Archived Article: %s %s"
                              % (link,traceback.format_exc(),))
-        return (currentTime, None, None)
+
+        if postFeedUpdateFunc is not None:
+            postFeedUpdateFunc (self.key, currentTime, None, None, None,
+                                *postFeedUpdateFuncArgs)
     
     def purgeReadArticles(self):
         rows = self.db.execute("SELECT id FROM feed WHERE read=1;")