+ fix
This commit is contained in:
14
gui/gui.py
14
gui/gui.py
@@ -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(
|
||||||
|
|||||||
@@ -35,8 +35,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
|
||||||
|
|||||||
Reference in New Issue
Block a user