Changeset - fa1d80d31b48
[Not reviewed]
default
0 1 0
Thomas De Schampheleire - 9 years ago 2016-09-13 17:55:12
thomas.de.schampheleire@gmail.com
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.
1 file changed with 0 insertions and 16 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/error.py
Show inline comments
 
@@ -28,7 +28,6 @@ Original author and date, and relevant c
 
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 @@ class ErrorController(BaseController):
 

	
 
        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]"""
0 comments (0 inline, 0 general)