From e5db4fecada4ee19d408e9bf3106f84dc30a0f21 Mon Sep 17 00:00:00 2001 From: Francesco Frassinelli Date: Wed, 6 Mar 2024 15:25:05 +0100 Subject: [PATCH] Show warning when score < 90 --- src/webapp.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/webapp.py b/src/webapp.py index 5be032b..c73025c 100755 --- a/src/webapp.py +++ b/src/webapp.py @@ -17,6 +17,7 @@ put_progressbar, put_success, put_table, + put_warning, set_progressbar, use_scope, ) @@ -92,7 +93,7 @@ def get_species_data(species): specie_ids = [] for index, specie in enumerate(species): result = response[str(index)]["result"][0] - specie_ids.append((result["id"], "%d %%" % result["score"])) + specie_ids.append((result["id"], result["score"])) data = { "extend": json.dumps( { @@ -156,6 +157,16 @@ def generate_table(text): "Mer enn %d ligner: tabellen er for stor til å vises." % PREVIEW_SIZE, ] put_success(*message) + worse_score = min(row["Score"] for row in table) + if worse_score < 90: + put_warning( + ( + "Linjer med lav Score har blitt oppdaget. " + "Kontroller verdien i Score-kolonnen. " + "Verdiene går fra 0 til 100, der 100 er en perfekt match. " + "Det anbefales å sjekke linjer med poengsum under 90." + ) + ) if table_preview: put_table( table,