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


Python StackInABox.into_hold方法代码示例

本文整理汇总了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,
开发者ID:TestInABox,项目名称:stackInAWSGI,代码行数:70,代码来源:app.py


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