Beispiel #1
0
	def _getFeeds(self):
		feeds = Feed.get_active_feeds()
		if not feeds or feeds.count() == 0:
			logging.debug("Got no active feeds, initializing data")
			self._init()
			return self._getFeeds()

		return feeds
Beispiel #2
0
        def _init(self):
                logging.debug("ShowFeed::_init()")
                feeds = Feed.get_active_feeds()
                if feeds:
                    for feed in feeds:
                        if time.time() - time.mktime(datetime.datetime.timetuple(feed.last_updated)) >= 3600*4:
                                logging.debug("Feed '%s' Triggered feed update" % feed.name)
                                self._updateFeeds()
                                break
                
		
		self.items = FeedItem.get_latest()
		logging.debug("Got %d feed items" % self.items.count())