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

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. __license__ = 'GPL v3'
  5. __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
  6. __docformat__ = 'restructuredtext en'
  7. from calibre.customize import Plugin
  8.  
  9. class InvalidEpub(ValueError):
  10.     pass
  11.  
  12.  
  13. class ePubFixer(Plugin):
  14.     supported_platforms = [
  15.         'windows',
  16.         'osx',
  17.         'linux']
  18.     author = 'Kovid Goyal'
  19.     type = _('ePub Fixer')
  20.     can_be_disabled = True
  21.     
  22.     def short_description(self):
  23.         raise NotImplementedError
  24.  
  25.     short_description = property(short_description)
  26.     
  27.     def long_description(self):
  28.         raise NotImplementedError
  29.  
  30.     long_description = property(long_description)
  31.     
  32.     def fix_name(self):
  33.         raise NotImplementedError
  34.  
  35.     fix_name = property(fix_name)
  36.     
  37.     def options(self):
  38.         return []
  39.  
  40.     options = property(options)
  41.     
  42.     def run(self, container, opts, log, fix = False):
  43.         raise NotImplementedError
  44.  
  45.     
  46.     def add_options_to_parser(self, parser):
  47.         parser.add_option('--' + self.fix_name.replace('_', '-'), help = self.long_description, action = 'store_true', default = False)
  48.         for option in self.options:
  49.             action = 'store'
  50.             if option[1] == 'bool':
  51.                 action = 'store_true'
  52.             
  53.             kwargs = {
  54.                 'action': action,
  55.                 'default': option[2],
  56.                 'help': option[3] }
  57.             if option[1] != 'bool':
  58.                 kwargs['type'] = option[1]
  59.             
  60.             parser.add_option('--' + option[0].replace('_', '-'), **kwargs)
  61.         
  62.  
  63.  
  64.