diff --git a/Linux/pecos.py b/Linux/pecos.py index 6a40ad2..f37f18e 100644 --- a/Linux/pecos.py +++ b/Linux/pecos.py @@ -181,18 +181,20 @@ 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(): if os.path.exists("export.html"): diff --git a/Windows/export.html b/Windows/export.html index 8eaac65..3f96532 100644 --- a/Windows/export.html +++ b/Windows/export.html @@ -1,9 +1,9 @@