Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
 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()
Exemplo n.º 4
0
 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()