Don't die if temporary directory doesn't exist

This commit is contained in:
Kovid Goyal 2008-04-07 13:50:35 +05:30
parent 24f3e635b2
commit d41a9e891a

View File

@ -334,6 +334,8 @@ class HTMLConverter(object):
self.book.set_author(self.get_text(a))
if self.verbose:
tdir = tempfile.gettempdir()
if not os.path.exists(tdir):
os.makedirs(tdir)
dump = open(os.path.join(tdir, 'html2lrf-verbose.html'), 'wb')
dump.write(unicode(soup).encode('utf-8'))
self.logger.info(_('Written preprocessed HTML to ')+dump.name)