# -*- coding: iso8859-1 -*- # # Copyright (C) 2006 CSIRO Australia # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # This software consists of voluntary contributions made by many # individuals. For exact contribution history, see the revision # history and logs. # # Author: Conrad Parker class Response (object): def __init__(self, o): self.o = o def __str__(self): content_type = self.o.content_type() content = self.o.__str__() content_length = len(content) return '''Content-Length: %d Content-Type: %s %s''' % (content_length, content_type, content)