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


Python Request.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from twisted.web.server import Request [as 别名]
# 或者: from twisted.web.server.Request import __init__ [as 别名]
    def __init__(self, counter, method, path, headers, content):

        channel = HTTPChannel()
        host = IPv4Address(b"TCP", b"127.0.0.1", 80)
        channel.makeConnection(StringTransport(hostAddress=host))

        Request.__init__(self, channel, False)

        # An extra attribute for identifying this fake request
        self._counter = counter

        # Attributes a Request is supposed to have but we have to set ourselves
        # because the base class mixes together too much other logic with the
        # code that sets them.
        self.prepath = []
        self.requestHeaders = headers
        self.content = BytesIO(content)

        self.requestReceived(method, path, b"HTTP/1.1")

        # requestReceived initializes the path attribute for us (but not
        # postpath).
        self.postpath = list(map(unquote, self.path[1:].split(b'/')))

        # Our own notifyFinish / finish state because the inherited
        # implementation wants to write confusing stuff to the transport when
        # the request gets finished.
        self._finished = False
        self._finishedChannel = EventChannel()

        # Our own state for the response body so we don't have to dig it out of
        # the transport.
        self._responseBody = b""
开发者ID:alex-docker,项目名称:flocker,代码行数:35,代码来源:testtools.py

示例2: __init__

# 需要导入模块: from twisted.web.server import Request [as 别名]
# 或者: from twisted.web.server.Request import __init__ [as 别名]
    def __init__(self, *args, **kwargs):

        Request.__init__(self, *args, **kwargs)

        self.is_hydrus_client = True
        self.hydrus_args = None
        self.hydrus_response_context = None
        self.hydrus_request_data_usage = 0
开发者ID:sttollgrin,项目名称:hydrus,代码行数:10,代码来源:HydrusServer.py

示例3: __init__

# 需要导入模块: from twisted.web.server import Request [as 别名]
# 或者: from twisted.web.server.Request import __init__ [as 别名]
    def __init__(self, site, *args, **kw):
        Request.__init__(self, *args, **kw)
        self.site = site
        self.authenticated_entity = None
        self.start_time = 0

        global _next_request_seq
        self.request_seq = _next_request_seq
        _next_request_seq += 1
开发者ID:rubo77,项目名称:synapse,代码行数:11,代码来源:site.py

示例4: __init__

# 需要导入模块: from twisted.web.server import Request [as 别名]
# 或者: from twisted.web.server.Request import __init__ [as 别名]
    def __init__(self, site, channel, *args, **kw):
        Request.__init__(self, channel, *args, **kw)
        self.site = site
        self._channel = channel     # this is used by the tests
        self.authenticated_entity = None
        self.start_time = 0

        # we can't yet create the logcontext, as we don't know the method.
        self.logcontext = None

        global _next_request_seq
        self.request_seq = _next_request_seq
        _next_request_seq += 1

        # whether an asynchronous request handler has called processing()
        self._is_processing = False

        # the time when the asynchronous request handler completed its processing
        self._processing_finished_time = None

        # what time we finished sending the response to the client (or the connection
        # dropped)
        self.finish_time = None
开发者ID:DoubleMalt,项目名称:synapse,代码行数:25,代码来源:site.py

示例5: __init__

# 需要导入模块: from twisted.web.server import Request [as 别名]
# 或者: from twisted.web.server.Request import __init__ [as 别名]
	def __init__(self, *args, **kwargs):
		Request.__init__(self, *args, **kwargs)
		self._authenticated_callbacks = []
		self.__fix_twisted()
		self.notify_on_authenticated(self.__store_ip_in_session)
		self.notify_on_authenticated(self.__add_sso_session)
开发者ID:spaceone,项目名称:univention-management-console,代码行数:8,代码来源:request.py

示例6: __init__

# 需要导入模块: from twisted.web.server import Request [as 别名]
# 或者: from twisted.web.server.Request import __init__ [as 别名]
 def __init__(self, site, *args, **kw):
     Request.__init__(self, *args, **kw)
     self.site = site
     self.authenticated_entity = None
     self.start_time = 0
开发者ID:0-T-0,项目名称:synapse,代码行数:7,代码来源:site.py

示例7: __init__

# 需要导入模块: from twisted.web.server import Request [as 别名]
# 或者: from twisted.web.server.Request import __init__ [as 别名]
 def __init__(self, *args, **kw):
     Request.__init__(self,*args, **kw)
开发者ID:89sos98,项目名称:firefly,代码行数:4,代码来源:delayrequest.py

示例8: __init__

# 需要导入模块: from twisted.web.server import Request [as 别名]
# 或者: from twisted.web.server.Request import __init__ [as 别名]
 def __init__(self, *args, **kw):
     Request.__init__(self, *args, **kw)
     self.context = Context(self)
开发者ID:clownpie,项目名称:http2osc,代码行数:5,代码来源:bootstrap.py

示例9: __init__

# 需要导入模块: from twisted.web.server import Request [as 别名]
# 或者: from twisted.web.server.Request import __init__ [as 别名]
 def __init__(self, channel, queued):
     return Request.__init__(self, channel, queued)
开发者ID:notoriousno,项目名称:shiji,代码行数:4,代码来源:foundation.py


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