~ small fix
This commit is contained in:
Binary file not shown.
Binary file not shown.
19
gui/gui.py
19
gui/gui.py
@@ -99,9 +99,12 @@ class Gui:
|
|||||||
'You didn\'t set a name for the image, it will be named randomly.')
|
'You didn\'t set a name for the image, it will be named randomly.')
|
||||||
output_name = secrets.token_hex(16)
|
output_name = secrets.token_hex(16)
|
||||||
|
|
||||||
path = nassi(input_path=file_path, output_path=output_path, outputname=output_name, gui=self,
|
path, file_is_empty = nassi(input_path=file_path, output_path=output_path, outputname=output_name, gui=self,
|
||||||
font_filepath=font_filepath, behaviour=exists_choice, types=types, remove_tags=modifier, comments=comments)
|
font_filepath=font_filepath, behaviour=exists_choice, types=types, remove_tags=modifier, comments=comments)
|
||||||
if path:
|
|
||||||
|
if file_is_empty:
|
||||||
|
sg.popup_annoying('Our interpreter did not find anything. --> blame Kons or yourself!', title='Empty')
|
||||||
|
elif path:
|
||||||
fnames = output(path)
|
fnames = output(path)
|
||||||
sg.popup_annoying('Successfully created!', title='Created',
|
sg.popup_annoying('Successfully created!', title='Created',
|
||||||
auto_close_duration=2, auto_close=True, text_color='green')
|
auto_close_duration=2, auto_close=True, text_color='green')
|
||||||
@@ -163,10 +166,14 @@ class Gui:
|
|||||||
|
|
||||||
# handle event select output folder
|
# handle event select output folder
|
||||||
if event == '-OUTPUT FOLDER-':
|
if event == '-OUTPUT FOLDER-':
|
||||||
logging.debug(('event = ' + str(event) +
|
try:
|
||||||
' value = ' + str(values['-OUTPUT FOLDER-'])))
|
logging.debug(('event = ' + str(event) +
|
||||||
fnames = output(values['-OUTPUT FOLDER-'])
|
' value = ' + str(values['-OUTPUT FOLDER-'])))
|
||||||
window['-OUTPUT FILE LIST-'].update(fnames)
|
fnames = output(values['-OUTPUT FOLDER-'])
|
||||||
|
window['-OUTPUT FILE LIST-'].update(fnames)
|
||||||
|
except Exception as e:
|
||||||
|
logging.error(str(e))
|
||||||
|
sg.popup_error(str(e))
|
||||||
elif event == '-OUTPUT FILE LIST-':
|
elif event == '-OUTPUT FILE LIST-':
|
||||||
logging.debug(('event = ' + str(event) +
|
logging.debug(('event = ' + str(event) +
|
||||||
' value = ' + str(values['-OUTPUT FILE LIST-'])))
|
' value = ' + str(values['-OUTPUT FILE LIST-'])))
|
||||||
|
|||||||
@@ -23,13 +23,14 @@ def nassi(input_path: str, output_path: str, outputname: str, types, remove_tags
|
|||||||
|
|
||||||
custom_tags = {"comments" : comments, "ignore" : remove_tags, "types" : types}
|
custom_tags = {"comments" : comments, "ignore" : remove_tags, "types" : types}
|
||||||
|
|
||||||
NSD.load_from_file(input_path, custom_tags)
|
is_empty = NSD.load_from_file(input_path, custom_tags)
|
||||||
|
|
||||||
cancel = NSD.convert_to_image(output_directory, on_conflict=behaviour)
|
cancel = NSD.convert_to_image(output_directory, on_conflict=behaviour)
|
||||||
|
|
||||||
if not cancel:
|
if not cancel:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return output_directory
|
return output_directory, is_empty
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -85,3 +85,8 @@ class NassiShneidermanDiagram:
|
|||||||
itp = JavaInterpreter(filepath)
|
itp = JavaInterpreter(filepath)
|
||||||
itp.reset_tags(itp_custom_tags)
|
itp.reset_tags(itp_custom_tags)
|
||||||
self.function_scopes = itp.load_instruction_scopes()
|
self.function_scopes = itp.load_instruction_scopes()
|
||||||
|
|
||||||
|
if not self.function_scopes:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
Reference in New Issue
Block a user