home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- __license__ = 'GPL v3'
- __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
- __docformat__ = 'restructuredtext en'
- from calibre.customize import Plugin
-
- class InvalidEpub(ValueError):
- pass
-
-
- class ePubFixer(Plugin):
- supported_platforms = [
- 'windows',
- 'osx',
- 'linux']
- author = 'Kovid Goyal'
- type = _('ePub Fixer')
- can_be_disabled = True
-
- def short_description(self):
- raise NotImplementedError
-
- short_description = property(short_description)
-
- def long_description(self):
- raise NotImplementedError
-
- long_description = property(long_description)
-
- def fix_name(self):
- raise NotImplementedError
-
- fix_name = property(fix_name)
-
- def options(self):
- return []
-
- options = property(options)
-
- def run(self, container, opts, log, fix = False):
- raise NotImplementedError
-
-
- def add_options_to_parser(self, parser):
- parser.add_option('--' + self.fix_name.replace('_', '-'), help = self.long_description, action = 'store_true', default = False)
- for option in self.options:
- action = 'store'
- if option[1] == 'bool':
- action = 'store_true'
-
- kwargs = {
- 'action': action,
- 'default': option[2],
- 'help': option[3] }
- if option[1] != 'bool':
- kwargs['type'] = option[1]
-
- parser.add_option('--' + option[0].replace('_', '-'), **kwargs)
-
-
-
-