1
# -*- coding: utf-8 -*-
4
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
5
__docformat__ = 'restructuredtext en'
9
from calibre.customize.conversion import OutputFormatPlugin
10
from calibre.ebooks.pdb.ereader.writer import Writer
12
class EREADEROutput(OutputFormatPlugin):
14
name = 'eReader PDB Output'
15
author = 'John Schember'
18
def convert(self, oeb_book, output_path, input_plugin, opts, log):
22
if not hasattr(output_path, 'write'):
24
if not os.path.exists(os.path.dirname(output_path)) and os.path.dirname(output_path) != '':
25
os.makedirs(os.path.dirname(output_path))
26
out_stream = open(output_path, 'wb')
28
out_stream = output_path
33
writer.dump(oeb_book, out_stream)