Skip to content

Commit

Permalink
Merge pull request #428 from kahst/single-file-analysis-header-locali…
Browse files Browse the repository at this point in the history
…sation

Fix Single Analysis File Header
  • Loading branch information
max-mauermann authored Aug 28, 2024
2 parents 504430e + 2cb7511 commit 39be608
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 39be608

Please sign in to comment.