示例#1
0
文件: mblrdr.py 项目: smonev/mblrdr
    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()
示例#2
0
文件: mblrdr.py 项目: smonev/mblrdr
    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()
示例#3
0
文件: mblrdr.py 项目: smonev/mblrdr
    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()