Ejemplo n.º 1
0
	def __str__(self):
		headers = ( k + ': ' + str(v) for k, v in self.headers.items() )
		txt = "%s %s %s\n\t{%s}" % (self.command, self.path, self.request_version, ', '.join(headers))
		if self.body:
			plain = decompress(self.body, self.content_encoding)
			txt += "\n" + str_(plain)
		return txt
Ejemplo n.º 2
0
 def __str__(self):
     headers = (k + ': ' + str(v) for k, v in self.headers.items())
     txt = "%s\n\t{%s}" % (self.requestline, ', '.join(headers))
     if hasattr(self, 'body') and self.body:
         plain = decompress(self.body, self.content_encoding)
         txt += "\n" + str_(plain)
     return txt
Ejemplo n.º 3
0
	def __str__(self):
		headers = ( k + ': ' + str(v) for k, v in self.headers.items() )
		txt = "%s\n\t{%s}" % (self.requestline, ', '.join(headers))
		if hasattr(self, 'body') and self.body:
			plain = decompress(self.body, self.content_encoding)
			txt += "\n" + str_(plain)
		return txt
Ejemplo n.º 4
0
Archivo: dummy.py Proyecto: nomada2/KSP
 def __str__(self):
     t = "[DUMMY] %d %s (%d) %s" % (self.status, self.reason, self.length,
                                    self.headers)
     if self.body:
         if self.content_type is None \
           or self.content_type.startswith('text/') \
           or self.content_type.startswith('application/xml-') \
           or self.content_type == 'application/json':
             t += "\n" + str_(self.body)
         elif len(self.body) < 2048:
             t += "\n[HEX] " + str(binascii.hexlify(self.body), 'ascii')
     return t
Ejemplo n.º 5
0
Archivo: dummy.py Proyecto: pwr/KSP
 def __str__(self):
     t = "[DUMMY] %d %s (%d) %s" % (self.status, self.reason, self.length, self.headers)
     if self.body:
         if (
             self.content_type is None
             or self.content_type.startswith("text/")
             or self.content_type.startswith("application/xml-")
             or self.content_type == "application/json"
         ):
             t += "\n" + str_(self.body)
         elif len(self.body) < 2048:
             t += "\n[HEX] " + str(binascii.hexlify(self.body), "ascii")
     return t
Ejemplo n.º 6
0
Archivo: dummy.py Proyecto: intari/KSP
	def __str__(self):
		t = "[DUMMY] %d %s (%d) %s" % (self.status, self.reason, self.length, self.headers)
		if self.body:
			t += "\n" + str_(self.body)
		return t
Ejemplo n.º 7
0
Archivo: dummy.py Proyecto: akleiw/KSP
	def __str__(self):
		t = "[DUMMY] %d %s (%d) %s" % (self.status, self.reason, self.length, self.headers)
		if self.body and (self.content_type is None or self.content_type.startswith('text/') or self.content_type.startswith('application/xml-')):
			t += "\n" + str_(self.body)
		return t