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


Python Request.finish方法代码示例

本文整理汇总了Python中twisted.web.server.Request.finish方法的典型用法代码示例。如果您正苦于以下问题:Python Request.finish方法的具体用法?Python Request.finish怎么用?Python Request.finish使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在twisted.web.server.Request的用法示例。


在下文中一共展示了Request.finish方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: finish

# 需要导入模块: from twisted.web.server import Request [as 别名]
# 或者: from twisted.web.server.Request import finish [as 别名]
    def finish(self):
        """Called when all response data has been written to this Request.

        Overrides twisted.web.server.Request.finish to record the finish time and do
        logging.
        """
        self.finish_time = time.time()
        Request.finish(self)
        if not self._is_processing:
            with PreserveLoggingContext(self.logcontext):
                self._finished_processing()
开发者ID:DoubleMalt,项目名称:synapse,代码行数:13,代码来源:site.py

示例2: finish

# 需要导入模块: from twisted.web.server import Request [as 别名]
# 或者: from twisted.web.server.Request import finish [as 别名]
 def finish(self):
     """
     Event received when the request is finished,
     for WebsocketTransport only.
     Pass that event to the transport, for processing extensions.
     """
     if self.transport.__class__ == WebsocketTransport:
         self.transport.finish()
     if not self._disconnected:
         ## FIXME: use notifyFinished?
         Request.finish(self)
开发者ID:aprilmay,项目名称:txWebSocket,代码行数:13,代码来源:websocket.py

示例3: finish

# 需要导入模块: from twisted.web.server import Request [as 别名]
# 或者: from twisted.web.server.Request import finish [as 别名]
 def finish( self ):
     
     Request.finish( self )
     
     host = self.getHost()
     
     status_text = '200'
     
     if self.hydrus_response_context is not None:
         
         status_text = HydrusData.ToUnicode( self.hydrus_response_context.GetStatusCode() )
         
     
     message = str( host.port ) + ' ' + HydrusData.ToUnicode( self.method ) + ' ' + HydrusData.ToUnicode( self.path ) + ' ' + status_text + ' in ' + HydrusData.ConvertTimeDeltaToPrettyString( time.clock() - self.start_time )
     
     HydrusData.Print( message )
开发者ID:pokeball99,项目名称:hydrus,代码行数:18,代码来源:HydrusServer.py

示例4: finish

# 需要导入模块: from twisted.web.server import Request [as 别名]
# 或者: from twisted.web.server.Request import finish [as 别名]
    def finish(self):
        rv = Request.finish(self)

        # Some requests, like those for static files, don't have store
        store = getattr(self, 'store', None)
        if store:
            # Roll back and then commit, so that no transaction
            # is left open between requests.
            store.rollback()
            store.commit()

            # Some use cases involve setting store.request in
            # getRequestStore, so remove request.store here to
            # avoid a circular reference GC.
            del self.store

        return rv
开发者ID:khangpn,项目名称:warp,代码行数:19,代码来源:site.py

示例5: finish

# 需要导入模块: from twisted.web.server import Request [as 别名]
# 或者: from twisted.web.server.Request import finish [as 别名]
 def finish(self):
     rv = Request.finish(self)
     store.rollback()
     store.commit()
     return rv
开发者ID:foamdino,项目名称:warp,代码行数:7,代码来源:site.py


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