mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Creation of custom news sources failing. Fixes #1363666 [Can't add news recipe](https://bugs.launchpad.net/calibre/+bug/1363666)
This commit is contained in:
parent
680f599f32
commit
db3ab1d874
@ -141,6 +141,9 @@ def update_custom_recipes(script_ids):
|
||||
|
||||
custom_recipes[id_] = (title, fname)
|
||||
|
||||
if not os.path.exists(bdir):
|
||||
os.makedirs(bdir)
|
||||
|
||||
with open(os.path.join(bdir, fname), 'wb') as f:
|
||||
f.write(script)
|
||||
|
||||
@ -166,6 +169,9 @@ def add_custom_recipes(script_map):
|
||||
|
||||
custom_recipes[fid] = (title, fname)
|
||||
|
||||
if not os.path.exists(bdir):
|
||||
os.makedirs(bdir)
|
||||
|
||||
with open(os.path.join(bdir, fname), 'wb') as f:
|
||||
f.write(script)
|
||||
id_ += 1
|
||||
@ -538,4 +544,3 @@ class SchedulerConfig(object):
|
||||
recipe = {'id':urn, 'title':r['title']}
|
||||
self.schedule_recipe(recipe, typ, schedule,
|
||||
last_downloaded=r['last_downloaded'])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user