def deleteFeed(self, feedUrl): logging.debug('deleting feed: %s', feedUrl) fds = FeedDataSettings.get_by_id(feedUrl) if fds is not None: fds.refCount = fds.refCount - 1 logging.debug( 'deleting feed %s, refCount: %s', feedUrl, fds.refCount) if fds.refCount > 0: fds.put() else: fds.key.delete()
def addFeedToDataStore(self, feedUrl): fds = FeedDataSettings.get_by_id(feedUrl) if fds is None: fds = FeedDataSettings(url=feedUrl, id=feedUrl, article_count=0, feedDataCount=0, private_data='', new_etag='', new_modified='', refCount=1) else: fds.refCount = fds.refCount + 1 logging.debug( 'adding feed to data store %s, refCount: %s', feedUrl, fds.refCount) fds.put()
def addNewFeed(self, feedUrl): logging.debug('adding feed: %s', feedUrl) fds = FeedDataSettings.get_by_id(feedUrl) if fds is None: fds = FeedDataSettings(url=feedUrl, id=feedUrl, article_count=0, feedDataCount=0, private_data='', new_etag='', new_modified='', refCount=1) fds.put(use_cache=False, use_memcache=False) # ! logging.debug('adding feed, fds is None: %s', feedUrl) GetAndParse(feedUrl, False, fds) else: fds.refCount = fds.refCount + 1 fds.put()