From 2cb7511ed42c0075503b22a2f51ba2b966e38c94 Mon Sep 17 00:00:00 2001 From: Max Mauermann Date: Wed, 28 Aug 2024 14:34:18 +0200 Subject: [PATCH] for single file analysis the data is now returned instead of the path to the csv, so the header does not lose its localisation --- gui.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gui.py b/gui.py index 64ffcdd8..a75f7c04 100644 --- a/gui.py +++ b/gui.py @@ -114,9 +114,11 @@ def runSingleFileAnalysis( custom_classifier_file, locale, ): + import csv + validate(input_path, loc.localize("validation-no-file-selected")) - return runAnalysis( + result_filepath = runAnalysis( input_path, None, confidence, @@ -142,6 +144,13 @@ def runSingleFileAnalysis( progress=None, ) + # read the result file to return the data to be displayed. + with open(result_filepath, "r") as f: + reader = csv.reader(f) + data = list(reader) + data = [l[0:-1] for l in data[1:]] # remove last column (file path) and first row (header) + + return data def runBatchAnalysis( output_path,