# HG changeset patch # User Thomas De Schampheleire # Date 1473782112 -7200 # Node ID fa1d80d31b48b1a3fe1ba68655cf08f72cefd524 # Parent f7cc6f446f5c81ce32065b45a93aaccfb8e7f914 error: remove unused Pylons-specific img/style methods The img and style methods in the error controller are standard Pylons boilerplate. They are used from the Pylons default error document template. The purpose of these methods is to serve images and stylesheets from the Pylons module, rather than having to copy these files into a particular application installation. Since Kallithea uses a custom error template with our own styles and images, these methods are not actually used. diff -r f7cc6f446f5c -r fa1d80d31b48 kallithea/controllers/error.py --- a/kallithea/controllers/error.py Wed Nov 23 01:37:12 2016 +0100 +++ b/kallithea/controllers/error.py Tue Sep 13 17:55:12 2016 +0200 @@ -28,7 +28,6 @@ import os import cgi import logging -import paste.fileapp from pylons import tmpl_context as c, request, config from pylons.i18n.translation import _ @@ -73,21 +72,6 @@ return render('/errors/error_document.html') - def img(self, id): - """Serve Pylons' stock images""" - return self._serve_file(os.path.join(media_path, 'img', id)) - - def style(self, id): - """Serve Pylons' stock stylesheets""" - return self._serve_file(os.path.join(media_path, 'style', id)) - - def _serve_file(self, path): - """Call Paste's FileApp (a WSGI application) to serve the file - at the specified path - """ - fapp = paste.fileapp.FileApp(path) - return fapp(request.environ, self.start_response) - def get_error_explanation(self, code): """ get the error explanations of int codes [400, 401, 403, 404, 500]"""