This commit is contained in:
oleting
2020-12-28 17:44:30 +01:00
parent 978d4bf9d2
commit 53dc4fb233
3 changed files with 5 additions and 27 deletions

2
.vscode/launch.json vendored
View File

@@ -8,7 +8,7 @@
"name": "Python: Aktuelle Datei", "name": "Python: Aktuelle Datei",
"type": "python", "type": "python",
"request": "launch", "request": "launch",
"program": "debug.py", "program": "run.py",
"console": "integratedTerminal" "console": "integratedTerminal"
} }
] ]

View File

@@ -49,7 +49,7 @@ class Gui:
sg.HSeparator(), sg.HSeparator(),
], ],
[ [
sg.Text('Optional: choose custom font and name.'), sg.Text('Optional: choose custom font.'),
], ],
[ [
sg.Text('TTF File'), sg.Text('TTF File'),
@@ -137,24 +137,8 @@ class Gui:
if file_there((output_path + '/' + output_name)) is True: if file_there((output_path + '/' + output_name)) is True:
proceed = sg.popup_yes_no( proceed = sg.popup_yes_no(
'File already exists! Continue?', title='File alreday exists!') 'File already exists! Continue?', title='File alreday exists!')
if proceed == 'Yes':
nassi(filepath=file_path, output_path=output_path, outputname=output_name, gui=self,
font_filepath=font_filepath)
nassi(input_path=file_path, output_path=output_path, outputname=output_name, gui=self,
fnames = output(values)
sg.popup_annoying('Successfully created!', title='Created',
auto_close_duration=2, auto_close=True, text_color='green')
window['-OUTPUT FILE LIST-'].update(fnames)
elif proceed == 'No':
logging.warning('Cancelled. No image created')
else:
logging.warning(
'You did not make a decision! Try again!')
sg.popup_annoying('You did not make a decision! Try again!', title='FAIL',
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) font_filepath=font_filepath)
fnames = output(values) fnames = output(values)

View File

@@ -33,10 +33,4 @@ def output(values):
def file_there(file): def file_there(file):
try: return os.path.exists(str(file))
open((file + '.png'))
return True
except FileNotFoundError:
return False
except:
raise