From f9214bfd4d730ed6251cdb047b7ff79de2a5f440 Mon Sep 17 00:00:00 2001 From: Ferry Boender Date: Sun, 2 Oct 2016 10:25:52 +0200 Subject: [PATCH] Code quality improvements --- src/formrender.py | 14 +++++++++----- src/scriptform.py | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/formrender.py b/src/formrender.py index b3f9fd6..53e1e52 100644 --- a/src/formrender.py +++ b/src/formrender.py @@ -180,9 +180,12 @@ class FormRender(object): checked = '' if o_value == value: checked = 'checked' - radio_elems.append(tpl_option.format(name=name, value=value, - checked=checked, label=o_label, classes=classes, - style=style)) + radio_elems.append(tpl_option.format(name=name, + value=value, + checked=checked, + label=o_label, + classes=classes, + style=style)) return u''.join(radio_elems) def r_field_checkbox(self, name, checked, classes='', style=""): @@ -204,8 +207,9 @@ class FormRender(object): if o_value == value: selected = 'selected' select_elems.append(tpl_option.format(value=o_value, - selected=selected, label=o_label, - style=style)) + selected=selected, + label=o_label, + style=style)) tpl = self.field_tpl['select'] return tpl.format(name=name, select_elems=''.join(select_elems), diff --git a/src/scriptform.py b/src/scriptform.py index 02f0649..c91fe65 100755 --- a/src/scriptform.py +++ b/src/scriptform.py @@ -203,7 +203,7 @@ def main(): # pragma: no cover # Generate a password for use in the `users` section import getpass plain_pw = getpass.getpass() - if not plain_pw == getpass.getpass('Repeat password: '): + if plain_pw != getpass.getpass('Repeat password: '): sys.stderr.write("Passwords do not match.\n") sys.exit(1) sys.stdout.write(hashlib.sha256(plain_pw).hexdigest() + '\n')