This commit is contained in:
weckyy702
2020-12-27 20:26:28 +01:00
2 changed files with 15 additions and 5 deletions

View File

@@ -53,7 +53,7 @@ class Gui:
], ],
[ [
sg.Text('Output name'), sg.Text('Output name'),
sg.In(size=(25, 1)), sg.In(size=(25, 1), enable_events=True),
], ],
] ]
@@ -109,6 +109,7 @@ class Gui:
auto_close=True, auto_close_duration=5) auto_close=True, auto_close_duration=5)
while True: while True:
logging.info('test')
event, values = window.read() event, values = window.read()
if event == 'Exit' or event == sg.WIN_CLOSED: if event == 'Exit' or event == sg.WIN_CLOSED:
logging.debug(('Exit GUI')) logging.debug(('Exit GUI'))
@@ -159,7 +160,7 @@ class Gui:
output_path = values['-OUTPUT FOLDER-'] output_path = values['-OUTPUT FOLDER-']
if file_there((output_path + '/' + output_name)) is False: if file_there((output_path + '/' + output_name)) is True:
proceed = sg.popup_yes_no( proceed = sg.popup_yes_no(
'File already exist! Continue?', title='File alreday exist!') 'File already exist! Continue?', title='File alreday exist!')
print(proceed) print(proceed)
@@ -172,12 +173,21 @@ class Gui:
auto_close_duration=2, auto_close=True, text_color='green') auto_close_duration=2, auto_close=True, text_color='green')
window['-OUTPUT FILE LIST-'].update(fnames) window['-OUTPUT FILE LIST-'].update(fnames)
elif proceed == 'No': elif proceed == 'No':
logging.error('test')
pass pass
else: else:
logging.warning( logging.warning(
'You did not made a decision! Try again!') 'You did not made a decision! Try again!')
sg.popup_annoying('You did not made a decision! Try again!', title='FAIL', sg.popup_annoying('You did not made a decision! Try again!', title='FAIL',
auto_close_duration=2, auto_close=True, text_color='orange') auto_close_duration=2, auto_close=True, text_color='orange')
else:
nassi(filepath=file_path, output_path=output_path, outputname=output_name, gui=self,
font_filepath=font_filepath)
fnames = output(values)
sg.popup_annoying('Successful created!', title='Created',
auto_close_duration=2, auto_close=True, text_color='green')
window['-OUTPUT FILE LIST-'].update(fnames)
except JavaSyntaxError as JsE: except JavaSyntaxError as JsE:
logging.error( logging.error(

View File

@@ -33,8 +33,8 @@ def output(values):
def file_there(file): def file_there(file):
try: try:
open((file + '.png')) open((file + '.png'))
return False
except FileNotFoundError:
return True return True
except: except FileNotFoundError:
return False return False
except:
raise