當前位置: 首頁>>代碼示例>>Python>>正文


Python Store.user_delete方法代碼示例

本文整理匯總了Python中tiddlyweb.store.Store.user_delete方法的典型用法代碼示例。如果您正苦於以下問題:Python Store.user_delete方法的具體用法?Python Store.user_delete怎麽用?Python Store.user_delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在tiddlyweb.store.Store的用法示例。


在下文中一共展示了Store.user_delete方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: Store

# 需要導入模塊: from tiddlyweb.store import Store [as 別名]
# 或者: from tiddlyweb.store.Store import user_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.user_delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。