auf 'Soeichern und Beenden' ohne eingetragenen Namen reagieren
This commit is contained in:
parent
365e02e066
commit
681f9b1163
|
|
@ -91,14 +91,15 @@ def send_button_clicked():
|
||||||
name.set("")
|
name.set("")
|
||||||
showinfo(title = "Information", message = "Deine Nachricht wurde gespeichert")
|
showinfo(title = "Information", message = "Deine Nachricht wurde gespeichert")
|
||||||
|
|
||||||
#
|
|
||||||
# TODO: Checken, on name leer ist und entsprechend im Output reagieren
|
|
||||||
def save_and_quit_button_clicked():
|
def save_and_quit_button_clicked():
|
||||||
with open(journal_filename_path, "a") as journal_of_the_day:
|
with open(journal_filename_path, "a") as journal_of_the_day:
|
||||||
journal_of_the_day.write(name.get() + "\n")
|
journal_of_the_day.write(name.get() + "\n")
|
||||||
journal_of_the_day.write(message_text.get(1.0, "end-1c") + "\n")
|
journal_of_the_day.write(message_text.get(1.0, "end-1c") + "\n")
|
||||||
journal_of_the_day.write("-----------------\n")
|
journal_of_the_day.write("-----------------\n")
|
||||||
journal_of_the_day.write("Speichern und Beenden von: " + name.get() + " um " + datetime.now().strftime("%Y-%m-%d %H:%M:%S") + "\n")
|
if not name.get():
|
||||||
|
journal_of_the_day.write("Speichern und Beenden von: " + "<noname>" + " um " + datetime.now().strftime("%Y-%m-%d %H:%M:%S") + "\n")
|
||||||
|
else:
|
||||||
|
journal_of_the_day.write("Speichern und Beenden von: " + name.get() + " um " + datetime.now().strftime("%Y-%m-%d %H:%M:%S") + "\n")
|
||||||
journal.quit()
|
journal.quit()
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user