From 7762ffdae4299805bca6cf315130e27730f8a2d7 Mon Sep 17 00:00:00 2001 From: oleting Date: Sun, 27 Dec 2020 17:51:01 +0100 Subject: [PATCH] + fix fatal error by @weckyy --- gui/gui.py | 2 +- gui/utils.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gui/gui.py b/gui/gui.py index e97c6ba..7e64157 100644 --- a/gui/gui.py +++ b/gui/gui.py @@ -145,7 +145,7 @@ class Gui: ) output_path = values['-OUTPUT FOLDER-'] nassi(file_path, output_path, gui=self, - font_filepath=str(font_filepath)) + font_filepath=font_filepath) fnames = output(values) window['-OUTPUT FILE LIST-'].update(fnames) diff --git a/gui/utils.py b/gui/utils.py index 904fca4..0aaa85d 100644 --- a/gui/utils.py +++ b/gui/utils.py @@ -4,9 +4,14 @@ import os from interpreter.NassiShneidermann import NassiShneidermanDiagram from draw.Iinstruction import * -def nassi(filepath:str, output_path: str, gui, font_filepath: str=None): +def nassi(filepath:str, output_path: str, gui, font_filepath=None): NSD = NassiShneidermanDiagram(gui.debug_mode) - if font_filepath is not None and font_filepath != "": + #if font_filepath is None: + # pass + #else: + #if font_filepath is not None or font_filepath != "": + if font_filepath != None: + print(font_filepath) NSD.set_font(font_filepath) NSD.load_from_file(filepath) NSD.convert_to_image(output_path, 500)