home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_1035 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  1.7 KB  |  40 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. __license__ = 'GPL v3'
  5. __copyright__ = '2010, John Schember <john@nachtimwald.com>'
  6. __docformat__ = 'restructuredtext en'
  7. from calibre.ebooks.pdb.formatreader import FormatReader
  8. from calibre.ptempfile import TemporaryFile
  9.  
  10. class Reader(FormatReader):
  11.     
  12.     def __init__(self, header, stream, log, options):
  13.         self.header = header
  14.         self.stream = stream
  15.         self.log = log
  16.         self.options = options
  17.         setattr(self.options, 'new_pdf_engine', False)
  18.         setattr(self.options, 'no_images', False)
  19.         setattr(self.options, 'unwrap_factor', 0.5)
  20.  
  21.     
  22.     def extract_content(self, output_dir):
  23.         self.log.info('Extracting PDF...')
  24.         
  25.         try:
  26.             pdf_n = _[1]
  27.             pdf = open(pdf_n, 'rwb')
  28.             for x in xrange(self.header.section_count()):
  29.                 pdf.write(self.header.section_data(x))
  30.             
  31.             plugin_for_input_format = plugin_for_input_format
  32.             import calibre.customize.ui
  33.             pdf.seek(0)
  34.             return plugin_for_input_format('pdf').convert(pdf, self.options, 'pdf', self.log, [])
  35.         finally:
  36.             pass
  37.  
  38.  
  39.  
  40.