当前位置: 首页>>代码示例>>Python>>正文


Python Store.recipe_delete方法代码示例

本文整理汇总了Python中tiddlyweb.store.Store.recipe_delete方法的典型用法代码示例。如果您正苦于以下问题:Python Store.recipe_delete方法的具体用法?Python Store.recipe_delete怎么用?Python Store.recipe_delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tiddlyweb.store.Store的用法示例。


在下文中一共展示了Store.recipe_delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Store

# 需要导入模块: from tiddlyweb.store import Store [as 别名]
# 或者: from tiddlyweb.store.Store import recipe_delete [as 别名]
class Store(StorageInterface):

    def __init__(self, store_config=None, environ=None):
        super(Store, self).__init__(store_config, environ)
        self.config = environ.get('tiddlyweb.config')
        self.binary_store = StoreBoss('text', {'store_root': 'binarystore'},
                environ=environ).storage
        self.core_store = StoreBoss(self.config['binarystore.child'][0],
                self.config['binarystore.child'][1], environ=environ).storage

    def bag_put(self, bag):
        self.core_store.bag_put(bag)

    def bag_get(self, bag):
        return self.core_store.bag_get(bag)

    def bag_delete(self, bag):
        try:
            self.binary_store.bag_delete(bag)
        except NoBagError:
            pass
        return self.core_store.bag_delete(bag)

    def recipe_put(self, recipe):
        self.core_store.recipe_put(recipe)

    def recipe_get(self, recipe):
        return self.core_store.recipe_get(recipe)

    def recipe_delete(self, recipe):
        return self.core_store.recipe_delete(recipe)

    def user_put(self, user):
        self.core_store.user_put(user)

    def user_get(self, user):
        return self.core_store.user_get(user)

    def user_delete(self, user):
        return self.core_store.user_delete(user)

    def tiddler_delete(self, tiddler):
        self.core_store.tiddler_delete(tiddler)
        if binary_tiddler(tiddler):
            self.binary_store.tiddler_delete(tiddler)

    def tiddler_put(self, tiddler):
        if binary_tiddler(tiddler):
            try:
                self.binary_store.tiddler_put(tiddler)
            except NoBagError:
                self.binary_store.bag_put(Bag(tiddler.bag))
                self.binary_store.tiddler_put(tiddler)
            tiddler.text = ''
        self.core_store.tiddler_put(tiddler)

    def tiddler_get(self, tiddler):
        found_tiddler = self.core_store.tiddler_get(tiddler)
        if binary_tiddler(found_tiddler):
            found_tiddler.__class__ = BinaryTiddler
            found_tiddler._text = None
        return found_tiddler

    def list_recipes(self):
        return self.core_store.list_recipes()

    def list_bags(self):
        return self.core_store.list_bags()

    def list_users(self):
        return self.core_store.list_users()

    def list_bag_tiddlers(self, bag):
        return self.core_store.list_bag_tiddlers(bag)

    def list_tiddler_revisions(self, tiddler):
        return self.core_store.list_tiddler_revisions(tiddler)

    def search(self, search_query):
        return self.core_store.search(search_query)
开发者ID:cdent,项目名称:tiddlywebplugins.binarystore,代码行数:82,代码来源:binarystore.py


注:本文中的tiddlyweb.store.Store.recipe_delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。