예제 #1
0
파일: qx_utils.py 프로젝트: dchud/sentinel
 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
예제 #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
예제 #3
0
파일: qx_utils.py 프로젝트: dchud/sentinel
 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()
예제 #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()