def run_once(self): """ read the actual file instead of caching the feed info, so that the modification to the feeds.list could be read without restarting the daemon """ feeds, histories = self.feed_mgr.read_feeds() log.debug("loading feeds and their last update time") if len(feeds) != 0 : observers = [ FeedObserver(url, filter=file_filter, last_update_time=last_update_time) for url, file_filter, last_update_time in feeds] log.debug("checking for updates") updated = False for observer in observers: links = observer.check_updates() if len(links) > 0: if self.ed2k_handler.handle_ed2k_links(links): notify.show_notification_msg("VeryCD Feed已更新", "%s已更新,成功添加%d新文件至%s" % (observer.url, len(links), self.ed2k_handler.name) ) histories[observer.url] = observer.current_latest_time updated = True if updated: self.feed_mgr.write_histories(histories) log.debug("finished checking") else : log.debug("no feeds found")