本文整理汇总了Python中stackinabox.stack.StackInABox.into_hold方法的典型用法代码示例。如果您正苦于以下问题:Python StackInABox.into_hold方法的具体用法?Python StackInABox.into_hold怎么用?Python StackInABox.into_hold使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stackinabox.stack.StackInABox
的用法示例。
在下文中一共展示了StackInABox.into_hold方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: App
# 需要导入模块: from stackinabox.stack import StackInABox [as 别名]
# 或者: from stackinabox.stack.StackInABox import into_hold [as 别名]
#.........这里部分代码省略.........
else:
# if it's not an iterable - e.g a single object - then
# just check the variable itself
__check_service(services)
self.RegisterWithStackInABox(services)
else:
logger.debug(
"No services registered on initialization"
)
def RegisterWithStackInABox(self, service):
"""
Add a :obj:`StackInABoxService` to the StackInABox instance
:param :obj:`StackInABoxService` service: the service to register with
StackInABox
"""
self.stack_service.register_service(service)
def ResetStackInABox(self, session_uuid):
"""
Reset StackInABox to its default state
"""
self.stack_service.reset_session(session_uuid)
def StackInABoxHoldOnto(self, name, obj):
"""
Add something into the StackInABox KV store
:param text_type name: name of the value for the KV store
:param any obj: a value to associate in the KV store
"""
self.stackinabox.into_hold(name, obj)
def StackInABoxHoldOut(self, name):
"""
Retrieve a value from the KV store
:param text_type name: name of the value for the KV store
:returns: the value if the KV store associated with the given name
"""
return self.stackinabox.from_hold(name)
def StackInABoxUriUpdate(self, uri):
"""
Update StackInABox to use a new URI value.
"""
self.stackinabox.base_url = uri
self.admin_service.base_uri = uri
def CallStackInABox(self, request, response):
"""
Call into StackInABox with the given request and response objects.
:param :obj:`Request` request: the :obj:`Request` object to use for
as input
:param :obj:`Response` response: the :obj:`Response` object to use
for the output
"""
# Parse the URL and determine where it's going
# /stackinabox/<session>/<service>/<normal user path>
# /admin for StackInAWSGI administrative functionality
result = self.stackinabox.call(
request.method,
request,