本文整理匯總了Python中twisted.web.client.HTTPClientFactory.buildProtocol方法的典型用法代碼示例。如果您正苦於以下問題:Python HTTPClientFactory.buildProtocol方法的具體用法?Python HTTPClientFactory.buildProtocol怎麽用?Python HTTPClientFactory.buildProtocol使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類twisted.web.client.HTTPClientFactory
的用法示例。
在下文中一共展示了HTTPClientFactory.buildProtocol方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _gotConn
# 需要導入模塊: from twisted.web.client import HTTPClientFactory [as 別名]
# 或者: from twisted.web.client.HTTPClientFactory import buildProtocol [as 別名]
def _gotConn(self, conn, url):
factory = HTTPClientFactory(url, **kwargs)
print "!!", transport
adr = None
p = factory.buildProtocol(adr)
p.makeConnection(transport)
def nest(x):
print "!!"
self._returnConn(transport)
de.callback(x)
factory.deferred.callback(nest)
示例2: buildProtocol
# 需要導入模塊: from twisted.web.client import HTTPClientFactory [as 別名]
# 或者: from twisted.web.client.HTTPClientFactory import buildProtocol [as 別名]
def buildProtocol(self, addr):
self.p = HTTPClientFactory.buildProtocol(self, addr)
return self.p
開發者ID:alg810,項目名稱:open-duckbox-project-sh4-pingulux-git,代碼行數:5,代碼來源:EVOMC_ShoutcastStreamInterface.py