mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
When deleting custom recipes, use recycle bin
Fixes #1186142 [Recipe deleted without option to cancel deletion](https://bugs.launchpad.net/calibre/+bug/1186142)
This commit is contained in:
parent
9a0d88dffa
commit
0fbba2966c
@ -16,6 +16,7 @@ from lxml.builder import ElementMaker
|
||||
from calibre import browser, force_unicode
|
||||
from calibre.utils.date import parse_date, now as nowf, utcnow, tzlocal, \
|
||||
isoformat, fromordinal
|
||||
from calibre.utils.recycle_bin import delete_file
|
||||
|
||||
NS = 'http://calibre-ebook.com/recipe_collection'
|
||||
E = ElementMaker(namespace=NS, nsmap={None:NS})
|
||||
@ -167,7 +168,7 @@ def remove_custom_recipe(id_):
|
||||
fname = existing[1]
|
||||
del custom_recipes[id_]
|
||||
try:
|
||||
os.remove(os.path.join(bdir, fname))
|
||||
delete_file(os.path.join(bdir, fname))
|
||||
except:
|
||||
pass
|
||||
|
||||
@ -526,6 +527,3 @@ class SchedulerConfig(object):
|
||||
self.schedule_recipe(recipe, typ, schedule,
|
||||
last_downloaded=r['last_downloaded'])
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user