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:
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;")
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"
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):