예제 #1
0
def send_file(filename):
    warnings.warn("wsgilib.send_file has been moved to paste.fileapp.FileApp",
                  DeprecationWarning, 2)
    from paste import fileapp
    return fileapp.FileApp(filename)
예제 #2
0
 def make_app(self, filename):
     return fileapp.FileApp(filename)
예제 #3
0
 def __call__(self, environ, start_response):
     app = fileapp.FileApp(self._file_path,
                           allowed_methods=('GET', ),
                           cache_control='private, must-revalidate',
                           **self._headers)
     return app(environ, start_response)
예제 #4
0
def make_unknown(parser, environ, filename):
    return fileapp.FileApp(filename)
예제 #5
0
파일: error.py 프로젝트: SpComb/myottd
 def _serve_file(self, path):
     fapp = fileapp.FileApp(path)
     return fapp(request.environ, self.start_response)
예제 #6
0
 def build(range, status=206):
     app = fileapp.FileApp(tempfile)
     return TestApp(app).get("/",headers={'Range': range},
                                 status=status)
예제 #7
0
"""WSGI applications for serving Bazaar branches."""

import os

from paste import urlparser, fileapp

from ..util import convert_file_errors

static = os.path.join(
    os.path.dirname(os.path.dirname(__file__)), 'static')

# Static things can be cached for half a day, we could probably make this
# longer, except for just before rollout times.
static_app = urlparser.make_static(None, static, cache_max_age=12*60*60)

favicon_app = convert_file_errors(fileapp.FileApp(
    os.path.join(static, 'images', 'favicon.ico')))

robots_app = convert_file_errors(fileapp.FileApp(
    os.path.join(static, 'robots.txt')))
예제 #8
0
"""WSGI applications for serving Bazaar branches."""

import os

from paste import urlparser, fileapp

from loggerhead.util import convert_file_errors

static = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'static')

# Static things can be cached for half a day, we could probably make this
# longer, except for just before rollout times.
static_app = urlparser.make_static(None, static, cache_max_age=12 * 60 * 60)

favicon_app = convert_file_errors(
    fileapp.FileApp(os.path.join(static, 'images', 'favicon.ico')))

robots_app = convert_file_errors(
    fileapp.FileApp(os.path.join(static, 'robots.txt')))