Double-confirmation for database delete.
This commit is contained in:
@ -181,17 +181,19 @@ class Toplevel1:
|
||||
# Next two lines commented out in Windows version - the connection commands work on macOS
|
||||
#conn = sqlite3.connect('checkouts.db') # Re-establish connection to the database
|
||||
#conn.close # Close out the current database
|
||||
os.remove("checkouts.db") # Delete the current database
|
||||
shutil.copy("emptybase.db", "checkouts.db") # Copy over an empty database
|
||||
shutil.rmtree('item')
|
||||
shutil.rmtree('patron')
|
||||
os.makedirs('item')
|
||||
os.makedirs('patron')
|
||||
# Next two lines commented out in Windows version - the connection commands work on macOS
|
||||
#conn = sqlite3.connect('checkouts.db') # Restablish connection to the database
|
||||
#c = conn.cursor()
|
||||
else:
|
||||
messagebox.showinfo('PECOS - Database Retained','Database retained. No changes made.')
|
||||
self.ConfirmClear = tk.messagebox.askquestion ('PECOS - Confim','Final answer: Are you sure you wish to clear the database?')
|
||||
if self.ConfirmClear == 'yes':
|
||||
os.remove("checkouts.db") # Delete the current database
|
||||
shutil.copy("emptybase.db", "checkouts.db") # Copy over an empty database
|
||||
shutil.rmtree('item')
|
||||
shutil.rmtree('patron')
|
||||
os.makedirs('item')
|
||||
os.makedirs('patron')
|
||||
# Next two lines commented out in Windows version - the connection commands work on macOS
|
||||
#conn = sqlite3.connect('checkouts.db') # Restablish connection to the database
|
||||
#c = conn.cursor()
|
||||
else:
|
||||
messagebox.showinfo('PECOS - Database Retained','Database retained. No changes made.')
|
||||
|
||||
# --- EXPORT DATABASE TO HTML ---
|
||||
def ExportDatabase():
|
||||
|
Reference in New Issue
Block a user