本文整理汇总了Python中twisted.web.http.Request.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Request.__init__方法的具体用法?Python Request.__init__怎么用?Python Request.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.web.http.Request
的用法示例。
在下文中一共展示了Request.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from twisted.web.http import Request [as 别名]
# 或者: from twisted.web.http.Request import __init__ [as 别名]
def __init__(self, channel, queued, reactor=reactor):
Request.__init__(self, channel, queued)
self.reactor = reactor
self.urlMonitor = URLMonitor.getInstance()
self.cookieCleaner = CookieCleaner.getInstance()
self.dnsCache = DnsCache.getInstance()
self.plugins = ProxyPlugins.getInstance()
示例2: __init__
# 需要导入模块: from twisted.web.http import Request [as 别名]
# 或者: from twisted.web.http.Request import __init__ [as 别名]
def __init__(self, channel, queued, reactor = reactor):
Request.__init__(self, channel, queued)
logging.debug('Client request initiated...')
self.reactor = reactor
self.url_monitor = URLMonitor.get_instance()
self.cookie_cleaner = CookieCleaner.get_instance()
self.dns_cache = DNSCache.get_instance()
示例3: __init__
# 需要导入模块: from twisted.web.http import Request [as 别名]
# 或者: from twisted.web.http.Request import __init__ [as 别名]
def __init__(self, channel, queued, reactor=reactor):
Request.__init__(self, channel, queued)
self.reactor = reactor
self.peers = {}
self.protocol = None
self.host = None
self.port = None
self.rest = None
self.configs = reactor.configs
self.log = Logger()
示例4: __init__
# 需要导入模块: from twisted.web.http import Request [as 别名]
# 或者: from twisted.web.http.Request import __init__ [as 别名]
def __init__(self, channel, queued, reactor=reactor):
Request.__init__(self, channel, queued)
self.reactor = reactor
self.urlMonitor = URLMonitor.getInstance()
self.hsts = URLMonitor.getInstance().hsts
self.cookieCleaner = CookieCleaner.getInstance()
self.dnsCache = DnsCache.getInstance()
#self.uniqueId = random.randint(0, 10000)
#Use are own DNS server instead of reactor.resolve()
self.customResolver = dns.resolver.Resolver()
self.customResolver.nameservers = ['127.0.0.1']
示例5: __init__
# 需要导入模块: from twisted.web.http import Request [as 别名]
# 或者: from twisted.web.http.Request import __init__ [as 别名]
def __init__(self, channel, path):
"""
@param channel: the channel we're connected to.
@param path: URI path
"""
Request.__init__(self, channel, queued=False)
# Unlike http.Request, which waits until it's received the whole request to set uri, args,
# and path, we must do this ASAP
self.uri = path
x = self.uri.split('?', 1)
if len(x) == 1:
self.path = self.uri
self.args = {}
else:
self.path, argstring = x
self.args = parse_qs(argstring, 1)
示例6: __init__
# 需要导入模块: from twisted.web.http import Request [as 别名]
# 或者: from twisted.web.http.Request import __init__ [as 别名]
def __init__(self, channel, queued):
Request.__init__(self, channel, queued)
示例7: __init__
# 需要导入模块: from twisted.web.http import Request [as 别名]
# 或者: from twisted.web.http.Request import __init__ [as 别名]
def __init__(self, channel, queued, reactor=reactor):
Request.__init__(self, channel, queued)
self.reactor = reactor
self.channel = channel
self.urlMonitor = URLMonitor.getInstance()
self.cookieCleaner = CookieCleaner.getInstance()
示例8: __init__
# 需要导入模块: from twisted.web.http import Request [as 别名]
# 或者: from twisted.web.http.Request import __init__ [as 别名]
def __init__(self, channel, queued, reactor=reactor):
Request.__init__(self, channel, queued)
self.reactor = reactor
self.urlMonitor = URLMonitor.getInstance()
self.dnsCache = DnsCache.getInstance()
示例9: __init__
# 需要导入模块: from twisted.web.http import Request [as 别名]
# 或者: from twisted.web.http.Request import __init__ [as 别名]
def __init__(self, channel, queued, reactor=reactor):
Request.__init__(self, channel, queued)
self.reactor = reactor
self.PersistentData = PersistentData.getInstance()
示例10: __init__
# 需要导入模块: from twisted.web.http import Request [as 别名]
# 或者: from twisted.web.http.Request import __init__ [as 别名]
def __init__(self, *a, **kw):
self.yay = kw.pop('yay')
Request.__init__(self, *a, **kw)
示例11: __init__
# 需要导入模块: from twisted.web.http import Request [as 别名]
# 或者: from twisted.web.http.Request import __init__ [as 别名]
def __init__(self, channel, queued=_QUEUED_SENTINEL, reactor=reactor):
Request.__init__(self, channel, queued)
self.reactor = reactor
示例12: __init__
# 需要导入模块: from twisted.web.http import Request [as 别名]
# 或者: from twisted.web.http.Request import __init__ [as 别名]
def __init__(self, channel, queued, reactor=reactor):
Request.__init__(self, channel, queued)
self.reactor = reactor
self.endpointFactory = channel.createEndpoint
示例13: __init__
# 需要导入模块: from twisted.web.http import Request [as 别名]
# 或者: from twisted.web.http.Request import __init__ [as 别名]
def __init__(self, *args, **kwargs):
Request.__init__(self, *args, **kwargs)
self.reply_channel = Channel.new_name("!http.response")
self.channel.factory.reply_protocols[self.reply_channel] = self
示例14: __init__
# 需要导入模块: from twisted.web.http import Request [as 别名]
# 或者: from twisted.web.http.Request import __init__ [as 别名]
def __init__(self, *a, **kw):
self.task = kw.pop('task')
Request.__init__(self, *a, **kw)
示例15: __init__
# 需要导入模块: from twisted.web.http import Request [as 别名]
# 或者: from twisted.web.http.Request import __init__ [as 别名]
def __init__(self, *args, **kwargs):
self.key = KEYFILE
self.cert = CERTFILE
self.opener = urllib2.build_opener(HTTPSClientCertHandler(self.key, self.cert))
Request.__init__(self, *args, **kwargs)