Fix #1136 (Error in .91 Fetch news)

This commit is contained in:
Kovid Goyal 2008-10-06 11:26:55 -07:00
parent 57a3fee974
commit 0de5dbf311

View File

@ -13,7 +13,7 @@ recipes = [
'daily_telegraph', 'daily_telegraph',
] ]
import re, imp, inspect, time import re, imp, inspect, time, os
from calibre.web.feeds.news import BasicNewsRecipe, CustomIndexRecipe, AutomaticNewsRecipe from calibre.web.feeds.news import BasicNewsRecipe, CustomIndexRecipe, AutomaticNewsRecipe
from calibre.ebooks.lrf.web.profiles import DefaultProfile, FullContentProfile from calibre.ebooks.lrf.web.profiles import DefaultProfile, FullContentProfile
from calibre.ebooks.lrf.web import builtin_profiles from calibre.ebooks.lrf.web import builtin_profiles
@ -56,7 +56,7 @@ def compile_recipe(src):
@return: Recipe/Profile class or None, if no such class was found in C{src} @return: Recipe/Profile class or None, if no such class was found in C{src}
''' '''
global _tdir, _crep global _tdir, _crep
if _tdir is None: if _tdir is None or not os.path.exists(_tdir):
_tdir = path(PersistentTemporaryDirectory('_recipes')) _tdir = path(PersistentTemporaryDirectory('_recipes'))
temp = _tdir/('recipe%d.py'%_crep) temp = _tdir/('recipe%d.py'%_crep)
_crep += 1 _crep += 1