Example #1
0
    def handleResponse(self, response):
        if self.content_is_gzip:
            c_f = StringIO(response)
            response = gzip.GzipFile(fileobj=c_f).read()

        self.cachetemp['response'] = response
        self.factory.cache[self.factory.url] = self.cachetemp
        HTTPPageGetter.handleResponse(self, response)
Example #2
0
    def handleResponse(self, response):
        if self.content_is_gzip:
            c_f = StringIO(response)
            response = gzip.GzipFile(fileobj=c_f).read()

        self.cachetemp['response'] = response
        self.factory.cache[self.factory.url] = self.cachetemp
        HTTPPageGetter.handleResponse(self, response)
Example #3
0
    def handleHeader(self, key, value):
        key = key.lower()

        if key == 'date' or key == 'last-modified':
            self.cachetemp[key] = value

        if key == 'content-encoding' and value == 'gzip':
            self.content_is_gzip = True

        HTTPPageGetter.handleHeader(self, key, value)
Example #4
0
    def handleHeader(self, key, value):
        key = key.lower()

        if key == 'date' or key == 'last-modified':
            self.cachetemp[key] = value

        if key == 'content-encoding' and value == 'gzip':
            self.content_is_gzip = True
            
        HTTPPageGetter.handleHeader(self, key, value)
Example #5
0
    def lineReceived(self, line):
        if self.firstLine:
            return HTTPPageGetter.lineReceived(self, line)
        if not self.inBody:
            if line: # still a header line
                return HTTPPageGetter.lineReceived(self, line)
            self.inBody = True
            # json from couch uses \n delims.
            self.delimiter = '\n'
            self.factory.deferred.callback(self.transport.loseConnection)
            return

        self.handleChange(json.loads(line))
Example #6
0
	def dataReceived(self, data):
		try:
			self.detectedDelimiter
		except AttributeError:
			if data.find("\r\n") >= 0:
				self.detectedDelimiter = 1
			else:
				self.detectedDelimiter = 1
				self.delimiter = "\n"
		return HTTPPageGetter.dataReceived(self, data)
Example #7
0
 def handleStatus(self, version, status, message):
     HTTPPageGetter.handleStatus(self, version, status, message)
Example #8
0
 def handleStatus(self, version, status, message):
     HTTPPageGetter.handleStatus(self, version, status, message)
Example #9
0
 def connectionMade(self):
     log.debug(u'Stream Connected')
     self.__buffer = ''
     self.factory.stream_connected()
     HTTPPageGetter.connectionMade(self)
Example #10
0
 def connectionMade(self):
     log.debug(u'Stream Connected')
     self.__buffer = ''
     self.factory.stream_connected()
     HTTPPageGetter.connectionMade(self)
Example #11
0
 def connectionMade(self):
     HTTPPageGetter.connectionMade(self)
     ClientMixin.connectionMade(self)
Example #12
0
 def connectionMade(self):
     HTTPPageGetter.connectionMade(self)
     ClientMixin.connectionMade(self)
Example #13
0
 def handleHeader(self, key, value):
     """
     hook method and save headers in their right order
     """
     HTTPPageGetter.handleHeader(self, key, value)
     self.factory.orderedHeaders.append(Header(key.decode("utf-8"), value.decode("utf-8")))