+ fix output view
This commit is contained in:
@@ -101,7 +101,7 @@ class Gui:
|
|||||||
nassi(input_path=file_path, output_path=output_path, outputname=output_name, gui=self,
|
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)
|
||||||
|
|
||||||
fnames = output(values['-OUTPUT FOLDER-'])
|
fnames = output(values['-OUTPUT FOLDER-'], output_name)
|
||||||
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')
|
||||||
window['-OUTPUT FILE LIST-'].update(fnames)
|
window['-OUTPUT FILE LIST-'].update(fnames)
|
||||||
@@ -165,6 +165,11 @@ class Gui:
|
|||||||
logging.debug(('event = ' + str(event) +
|
logging.debug(('event = ' + str(event) +
|
||||||
' value = ' + str(values['-OUTPUT FILE LIST-'])))
|
' value = ' + str(values['-OUTPUT FILE LIST-'])))
|
||||||
try:
|
try:
|
||||||
|
if output_name:
|
||||||
|
filename = os.path.join(
|
||||||
|
(values["-OUTPUT FOLDER-"]+ '/' + output_name), values["-OUTPUT FILE LIST-"][0]
|
||||||
|
)
|
||||||
|
else:
|
||||||
filename = os.path.join(
|
filename = os.path.join(
|
||||||
values["-OUTPUT FOLDER-"], values["-OUTPUT FILE LIST-"][0]
|
values["-OUTPUT FOLDER-"], values["-OUTPUT FILE LIST-"][0]
|
||||||
)
|
)
|
||||||
@@ -175,7 +180,7 @@ class Gui:
|
|||||||
title='FileNotFoundError',)
|
title='FileNotFoundError',)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
sg.popup_cancel(str(e), title='Error')
|
sg.popup_cancel(str(e), title='Error')
|
||||||
logging.error('Try to open a .png. {e}')
|
logging.error(f'Try to open a .png. {e}')
|
||||||
except:
|
except:
|
||||||
logging.error('Try to open a .png. Unknown error.')
|
logging.error('Try to open a .png. Unknown error.')
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -30,9 +30,12 @@ def nassi(input_path: str, output_path: str, outputname: str, types, remove_tags
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
def output(output_path):
|
def output(output_path, output_name=None):
|
||||||
|
|
||||||
if output_path == '':
|
if output_path == '':
|
||||||
raise NoPathError
|
raise NoPathError
|
||||||
|
if output_name:
|
||||||
|
output_path = output_path + '/' + output_name
|
||||||
try:
|
try:
|
||||||
file_list = os.listdir(output_path)
|
file_list = os.listdir(output_path)
|
||||||
except:
|
except:
|
||||||
|
|||||||
Reference in New Issue
Block a user