Ejemplo n.º 1
0
 def _chmtohtml(self, output_dir, chm_path, no_images, log, debug_dump=False):
     from calibre.ebooks.chm.reader import CHMReader
     log.debug('Opening CHM file')
     rdr = CHMReader(chm_path, log, input_encoding=self.opts.input_encoding)
     log.debug('Extracting CHM to %s' % output_dir)
     rdr.extract_content(output_dir, debug_dump=debug_dump)
     self._chm_reader = rdr
     return rdr.hhc_path
Ejemplo n.º 2
0
 def _chmtohtml(self, output_dir, chm_path, no_images, log, debug_dump=False):
     from calibre.ebooks.chm.reader import CHMReader
     log.debug('Opening CHM file')
     rdr = CHMReader(chm_path, log, input_encoding=self.opts.input_encoding)
     log.debug('Extracting CHM to %s' % output_dir)
     rdr.extract_content(output_dir, debug_dump=debug_dump)
     self._chm_reader = rdr
     return rdr.hhc_path
Ejemplo n.º 3
0
def get_metadata(stream):
    with TemporaryFile('_chm_metadata.chm') as fname:
        with open(fname, 'wb') as f:
            f.write(stream.read())
        from calibre.ebooks.chm.reader import CHMReader
        rdr = CHMReader(fname, default_log)
        return get_metadata_from_reader(rdr)