From aa0cac1ed3e117ae2d5840e404b55811e3a7449d Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 23 May 2013 14:03:21 +0900 Subject: [PATCH] send to trash when deleting profile --- aqt/profiles.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aqt/profiles.py b/aqt/profiles.py index 9f6add370..2ec5b71eb 100644 --- a/aqt/profiles.py +++ b/aqt/profiles.py @@ -14,6 +14,7 @@ from anki.lang import langs from aqt.utils import showWarning from aqt import appHelpSite import aqt.forms +from send2trash import send2trash metaConf = dict( ver=0, @@ -120,7 +121,9 @@ documentation for information on using a flash drive.""") self.db.commit() def remove(self, name): - shutil.rmtree(self.profileFolder()) + p = self.profileFolder() + if os.path.exists(p): + send2trash(p) self.db.execute("delete from profiles where name = ?", name.encode("utf8")) self.db.commit()