From aec8cb860eedd30428906bc2a1db37f12322f7fd Mon Sep 17 00:00:00 2001 From: Ferry Boender Date: Wed, 11 Jan 2017 20:08:40 +0100 Subject: [PATCH] Code quality improvements. --- src/daemon.py | 2 +- src/scriptform.py | 5 +++-- src/webapp.py | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/daemon.py b/src/daemon.py index 37f5a84..7668fee 100644 --- a/src/daemon.py +++ b/src/daemon.py @@ -163,7 +163,7 @@ class Daemon(object): # pragma: no cover def _cleanup(self, sig=None, frame=None): """ - Remvoe pid files and call registered shutodnw callbacks. + Remove pid files and call registered shutodnw callbacks. """ self.log.info("Received signal %s", sig) if os.path.exists(self.pid_file): diff --git a/src/scriptform.py b/src/scriptform.py index c303351..954d32f 100755 --- a/src/scriptform.py +++ b/src/scriptform.py @@ -87,8 +87,9 @@ class ScriptForm(object): file_contents = file(self.config_file, 'r').read() try: config = json.loads(file_contents) - except ValueError as e: - sys.stderr.write("Error in form configuration '{}': {}\n".format(self.config_file, e)) + except ValueError as err: + sys.stderr.write("Error in form configuration '{}': {}\n".format( + self.config_file, err)) sys.exit(1) static_dir = None diff --git a/src/webapp.py b/src/webapp.py index 7892f32..def4a8d 100644 --- a/src/webapp.py +++ b/src/webapp.py @@ -195,7 +195,8 @@ class ScriptFormWebApp(RequestHandler): if auth_header is not None: # Validate the username and password auth_unpw = auth_header.split(' ', 1)[1] - username, password = base64.decodestring(auth_unpw).split(":", 1) + username, password = base64.decodestring(auth_unpw).split(":", + 1) pw_hash = hashlib.sha256(password).hexdigest() if username in form_config.users and \