changeset 6338:fa1d80d31b48

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.
author Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
date Tue, 13 Sep 2016 17:55:12 +0200
parents f7cc6f446f5c
children 8845ece50d51
files kallithea/controllers/error.py
diffstat 1 files changed, 0 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- 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]"""