From ef3265ef3387e119cf3caf5d76ace3056dae2c39 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 13 Sep 2014 22:31:23 -0400 Subject: Extract variable for nicer indentation --- cherrypy/lib/cptools.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cherrypy/lib/cptools.py b/cherrypy/lib/cptools.py index 1ab70ef4..4cba8b16 100644 --- a/cherrypy/lib/cptools.py +++ b/cherrypy/lib/cptools.py @@ -380,8 +380,8 @@ Message: %(error_msg)s path = request.path_info if path.endswith('login_screen'): if self.debug: - cherrypy.log('routing %r to login_screen' % - path, 'TOOLS.SESSAUTH') + msg = 'routing %(path)r to login_screen' % locals() + cherrypy.log(msg, 'TOOLS.SESSAUTH') response.body = self.login_screen() return True elif path.endswith('do_login'): @@ -391,20 +391,21 @@ Message: %(error_msg)s cherrypy.log('do_login requires POST', 'TOOLS.SESSAUTH') raise cherrypy.HTTPError(405) if self.debug: - cherrypy.log('routing %r to do_login' % path, 'TOOLS.SESSAUTH') + msg = 'routing %(path)r to do_login' % locals() + cherrypy.log(msg, 'TOOLS.SESSAUTH') return self.do_login(**request.params) elif path.endswith('do_logout'): if request.method != 'POST': response.headers['Allow'] = "POST" raise cherrypy.HTTPError(405) if self.debug: - cherrypy.log('routing %r to do_logout' % - path, 'TOOLS.SESSAUTH') + msg = 'routing %(path)r to do_logout' % locals() + cherrypy.log(msg, 'TOOLS.SESSAUTH') return self.do_logout(**request.params) else: if self.debug: - cherrypy.log('No special path, running do_check', - 'TOOLS.SESSAUTH') + msg = 'No special path, running do_check' + cherrypy.log(msg, 'TOOLS.SESSAUTH') return self.do_check() -- cgit v1.2.1