Merge commit '407ee23a0fd8e0f00f7c41d83ae6fa4007ca229b'
authorYves Marcoz <yves@marcoz.org>
Mon, 28 Nov 2011 05:16:40 +0000 (21:16 -0800)
committerYves Marcoz <yves@marcoz.org>
Mon, 28 Nov 2011 05:16:40 +0000 (21:16 -0800)
src/rss_sqlite.py
src/update_feeds.py

index a12068b..adebe93 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;")
index 4a7ffad..b7e2040 100644 (file)
@@ -44,6 +44,8 @@ logger = logging.getLogger(__name__)
 import debugging
 debugging.init(dot_directory=".feedingit", program_name="update_feeds")
 
+from updatedbus import update_server_object
+
 CONFIGDIR="/home/user/.feedingit/"
 #DESKTOP_FILE = "/usr/share/applications/hildon-status-menu/feedingit_status.desktop"
 
@@ -169,6 +171,14 @@ class FeedUpdate(UpdateServerObject):
 
         if not self.am_updating:
             logger.info("Nothing to do for a while.  Quitting.")
+
+            # Make any progress bar go away.
+            try:
+                update_server_object().UpdateProgress(
+                    100, 0, 0, 0, 0, 0, 0, "")
+            except Exception:
+                logger.exception("Sending final progress update")
+
             mainloop.quit()
 
     def StopUpdate(self):