changeset 5030:6f9dae4d39d9

error controller: pep8 styling
author Ronny Pfannschmidt <opensource@ronnypfannschmidt.de>
date Mon, 02 Feb 2015 19:28:17 +0100
parents d20ea885f6cb
children f38c74fbbd2e
files kallithea/controllers/error.py
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/error.py	Fri Apr 17 22:23:51 2015 +0200
+++ b/kallithea/controllers/error.py	Mon Feb 02 19:28:17 2015 +0100
@@ -32,7 +32,7 @@
 
 from pylons import tmpl_context as c, request, config
 from pylons.i18n.translation import _
-from pylons.middleware import  media_path
+from pylons.middleware import media_path
 
 from kallithea.lib.base import BaseController, render
 
@@ -50,7 +50,7 @@
     """
 
     def __before__(self):
-        #disable all base actions since we don't need them here
+        # disable all base actions since we don't need them here
         pass
 
     def document(self):
@@ -60,12 +60,13 @@
         log.debug('### %s ###' % (resp and resp.status or 'no response'))
 
         e = request.environ
-        c.serv_p = r'%(protocol)s://%(host)s/' \
-                                    % {'protocol': e.get('wsgi.url_scheme'),
-                                       'host': e.get('HTTP_HOST'), }
-
-        c.error_message = resp and cgi.escape(request.GET.get('code', str(resp.status)))
-        c.error_explanation = resp and self.get_error_explanation(resp.status_int)
+        c.serv_p = r'%(protocol)s://%(host)s/' % {
+            'protocol': e.get('wsgi.url_scheme'),
+            'host': e.get('HTTP_HOST'), }
+        if resp:
+            c.error_message = cgi.escape(request.GET.get('code',
+                                                         str(resp.status)))
+            c.error_explanation = self.get_error_explanation(resp.status_int)
 
         return render('/errors/error_document.html')