本文整理汇总了Python中tiddlyweb.store.Store.user_put方法的典型用法代码示例。如果您正苦于以下问题:Python Store.user_put方法的具体用法?Python Store.user_put怎么用?Python Store.user_put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tiddlyweb.store.Store
的用法示例。
在下文中一共展示了Store.user_put方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Store
# 需要导入模块: from tiddlyweb.store import Store [as 别名]
# 或者: from tiddlyweb.store.Store import user_put [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)