本文整理汇总了Python中stubo.cache.Cache.set_stubo_setting方法的典型用法代码示例。如果您正苦于以下问题:Python Cache.set_stubo_setting方法的具体用法?Python Cache.set_stubo_setting怎么用?Python Cache.set_stubo_setting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stubo.cache.Cache
的用法示例。
在下文中一共展示了Cache.set_stubo_setting方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _import_module
# 需要导入模块: from stubo.cache import Cache [as 别名]
# 或者: from stubo.cache.Cache import set_stubo_setting [as 别名]
def _import_module(self):
cache = Cache('localhost')
_ = cache.set_stubo_setting("tracking_level", "full", True)
self.http_client.fetch(self.get_url('/stubo/api/exec/cmds?cmdfile=/static/cmds/formatted_date/response.commands'),
self.stop)
response = self.wait()
self.assertEqual(response.code, 200)
示例2: put_setting
# 需要导入模块: from stubo.cache import Cache [as 别名]
# 或者: from stubo.cache.Cache import set_stubo_setting [as 别名]
def put_setting(handler, setting, value, host):
response = {
'version' : version
}
all_hosts = True if host == 'all' else False
if all_hosts:
host = get_hostname(handler.request)
cache = Cache(host)
new_setting = cache.set_stubo_setting(setting, value, all_hosts)
response['data'] = {
'host' : host,
'all' : all_hosts,
'new' : 'true' if new_setting else 'false', setting : value
}
return response