def orig__call__(self, request): contents = htmltext('') if self.mime_type == 'text/html': file_name = request.get_path()[1:] # drop leading '/' contents += header(get_title_from_path(file_name)) contents += htmltext(StaticFile.__call__(self, request)) contents += footer() return contents
def __call__(self, request): r = TemplateIO(html=0) file_name = request.get_path()[1:] # drop leading '/' r += header(get_title_from_path(file_name)) body = StaticFile.__call__(self, request) if isinstance(body, Stream): for hunk in body: r += hunk else: r += body r += footer() return r.getvalue()