From 772293e06f4ce2a42b274f0930471d4b1aadd4d2 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 7 Dec 2023 15:34:49 +0100 Subject: [PATCH] =?UTF-8?q?Qq=20corrections=20cosm=C3=A9tiques=20du=20HTML?= =?UTF-8?q?=20+=20config=20mypy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .mypy.ini | 2 ++ app/scodoc/TrivialFormulator.py | 22 +++++++++++----------- app/views/users.py | 1 - 3 files changed, 13 insertions(+), 12 deletions(-) create mode 100644 .mypy.ini diff --git a/.mypy.ini b/.mypy.ini new file mode 100644 index 00000000..5c64e4f6 --- /dev/null +++ b/.mypy.ini @@ -0,0 +1,2 @@ +[mypy-flask_login.*] +ignore_missing_imports = True diff --git a/app/scodoc/TrivialFormulator.py b/app/scodoc/TrivialFormulator.py index 6921d45a..de061800 100644 --- a/app/scodoc/TrivialFormulator.py +++ b/app/scodoc/TrivialFormulator.py @@ -429,7 +429,7 @@ class TF(object): buttons_markup = "" if self.submitbutton: buttons_markup += ( - '' + '' % ( self.formid, self.formid, @@ -471,9 +471,9 @@ class TF(object): R.append( f"""""" + }"/>""" ) - R.append(f"""""") + R.append(f"""""") if self.top_buttons: R.append(buttons_markup + "

") R.append(self.before_table.format(title=self.title)) @@ -524,7 +524,7 @@ class TF(object): else: checked = "" lab.append( - '' + '' % ("tf-checked", field, checked) ) if title_bubble: @@ -663,12 +663,12 @@ class TF(object): if descr.get("type", "") == "list": for v in values[field]: lem.append( - '' + '' % (field, v, attribs) ) else: lem.append( - '' + '' % (field, wid, values[field], attribs) ) elif (input_type == "separator") or (input_type == "table_separator"): @@ -746,7 +746,7 @@ var {field}_as = new bsn.AutoSuggest('{field}', {field}_opts); break; i = i + 1; while (i < elem.form.elements.length) { - if ((elem.form.elements[i].type == "text") + if ((elem.form.elements[i].type == "text") && (!(elem.form.elements[i].disabled)) && ($(elem.form.elements[i]).is(':visible'))) { @@ -760,7 +760,7 @@ var {field}_as = new bsn.AutoSuggest('{field}', {field}_opts); elem.blur(); } return false; - } + } else return true; } @@ -771,7 +771,7 @@ var {field}_as = new bsn.AutoSuggest('{field}', {field}_opts); # => only one form with text_suggest field on a page. R.append( """""" @@ -839,7 +839,7 @@ var {field}_as = new bsn.AutoSuggest('{field}', {field}_opts); bool_val = 0 R.append(labels[bool_val]) if bool_val: - R.append('' % field) + R.append(f'') else: labels = descr.get("labels", descr["allowed_values"]) for i in range(len(labels)): @@ -858,7 +858,7 @@ var {field}_as = new bsn.AutoSuggest('{field}', {field}_opts); elif input_type == "file": R.append("'%s'" % self.values[field]) else: - raise ValueError("unkown input_type for form (%s)!" % input_type) + raise ValueError(f"unkown input_type for form ({input_type})!") explanation = descr.get("explanation", "") if explanation: diff --git a/app/views/users.py b/app/views/users.py index ddf60155..80bc4e54 100644 --- a/app/views/users.py +++ b/app/views/users.py @@ -222,7 +222,6 @@ def create_user_form(user_name=None, edit=0, all_roles=True): all_roles = int(all_roles) H = [ html_sco_header.sco_header( - bodyOnLoad="init_tf_form('')", javascripts=["js/user_form.js"], ) ]