+ warn message

This commit is contained in:
oleting
2020-12-27 17:18:38 +01:00
parent 86353a8d84
commit e9972626df
2 changed files with 14 additions and 9 deletions

View File

@@ -1,9 +1,12 @@
from gui.utils import nassi, output from gui.utils import nassi, output
from interpreter.interpret_source import JavaSyntaxError, ScopeNotFoundException from interpreter.interpret_source import JavaSyntaxError, ScopeNotFoundException
from _thread import start_new_thread as thread
import PySimpleGUI as sg import PySimpleGUI as sg
import os.path import os.path
import random import random
import logging import logging
import time
class Gui: class Gui:
@@ -22,8 +25,6 @@ class Gui:
def init_gui(self, theme: str): def init_gui(self, theme: str):
self.get_debug_mode(self.debug_mode) self.get_debug_mode(self.debug_mode)
sg.theme(theme) sg.theme(theme)
logging.debug(('Theme = ' + theme)) logging.debug(('Theme = ' + theme))
@@ -96,6 +97,8 @@ class Gui:
font_filepath = None font_filepath = None
sg.popup('The Interpreter is WIP and cannot interpret classes or function definitions as those do not exist in Nass-Shneidermann Diagrams. A fix is in the making.', auto_close=True, auto_close_duration=5)
while True: while True:
event, values = window.read() event, values = window.read()
if event == 'Exit' or event == sg.WIN_CLOSED: if event == 'Exit' or event == sg.WIN_CLOSED:
@@ -141,12 +144,13 @@ class Gui:
values["-JAVA FOLDER-"], values["-JAVA FOLDER-"],
) )
output_path = values['-OUTPUT FOLDER-'] output_path = values['-OUTPUT FOLDER-']
nassi(file_path, output_path, gui=self, font_filepath=str(font_filepath)) nassi(file_path, output_path, gui=self,
font_filepath=str(font_filepath))
fnames = output(values) fnames = output(values)
window['-OUTPUT FILE LIST-'].update(fnames) window['-OUTPUT FILE LIST-'].update(fnames)
sg.popup_notify('Succsessful created!',
title='Created') sg.popup_annoying('Successful created!', title='Created', auto_close_duration=2, auto_close=True, text_color='green')
except JavaSyntaxError as JsE: except JavaSyntaxError as JsE:
logging.error( logging.error(

View File

@@ -1,5 +1,6 @@
import os import os
from interpreter.NassiShneidermann import NassiShneidermanDiagram from interpreter.NassiShneidermann import NassiShneidermanDiagram
from draw.Iinstruction import * from draw.Iinstruction import *