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)
def make_app(self, filename): return fileapp.FileApp(filename)
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)
def make_unknown(parser, environ, filename): return fileapp.FileApp(filename)
def _serve_file(self, path): fapp = fileapp.FileApp(path) return fapp(request.environ, self.start_response)
def build(range, status=206): app = fileapp.FileApp(tempfile) return TestApp(app).get("/",headers={'Range': range}, status=status)
"""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')))
"""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')))