From 781fc6fe8308ce9643e62a54877333d7859c7938 Mon Sep 17 00:00:00 2001 From: oleting Date: Sat, 26 Dec 2020 14:42:27 +0100 Subject: [PATCH] + fix global logging --- gui/gui.py | 2 +- gui/utils.py | 4 ++-- interpreter/NassiShneidermann.py | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/gui/gui.py b/gui/gui.py index bad2295..214e54a 100644 --- a/gui/gui.py +++ b/gui/gui.py @@ -125,7 +125,7 @@ class gui: values["-JAVA FOLDER-"], ) output_path = values['-OUTPUT FOLDER-'] - nassi(file_path, output_path) + nassi(file_path, output_path, gui=self) fnames = output(values) window['-OUTPUT FILE LIST-'].update(fnames) diff --git a/gui/utils.py b/gui/utils.py index 14e9c8c..291a230 100644 --- a/gui/utils.py +++ b/gui/utils.py @@ -4,8 +4,8 @@ from interpreter.NassiShneidermann import NassiShneidermanDiagram from draw.Iinstruction import * -def nassi(filepath:str, output_path: str): - NSD = NassiShneidermanDiagram(False) +def nassi(filepath:str, output_path: str, gui): + NSD = NassiShneidermanDiagram(gui=gui) NSD.load_from_file(filepath) NSD.convert_to_image(output_path + "/Nassi-Shneider-Diagramm", 500) diff --git a/interpreter/NassiShneidermann.py b/interpreter/NassiShneidermann.py index d77cb15..a352f40 100644 --- a/interpreter/NassiShneidermann.py +++ b/interpreter/NassiShneidermann.py @@ -4,12 +4,11 @@ import logging from draw.Iinstruction import Iinstruction from interpreter import interpret_source as itp from draw import code_to_image as cti -from gui.gui import gui class NassiShneidermanDiagram: - def __init__(self, debug: bool=False) -> None: + def __init__(self, gui): self.instructions: dict[str, Iinstruction] = {} self.init_logging(gui.debug_mode)