if self.option.choices and self.recommended_value not in self.option.choices:
raise ValueError('OpRec: %s: Recommended value not in choices' % self.option.name)
self.recommended_value not in self.option.choices
if not isinstance(self.recommended_value, (int, float, str, unicode)) or self.recommended_value is None:
raise ValueError('OpRec: %s:' % self.option.name + repr(self.recommended_value) + ' is not a string or a number')
self.recommended_value is None
class DummyReporter(object):
def __init__(self):
self.cancel_requested = False
def __call__(self, percent, msg = ''):
pass
class InputFormatPlugin(Plugin):
type = _('Conversion Input')
can_be_disabled = False
supported_platforms = [
'windows',
'osx',
'linux']
file_types = set([])
is_image_collection = False
core_usage = 1
for_viewer = False
output_encoding = 'utf-8'
common_options = set([
OptionRecommendation(name = 'input_encoding', recommended_value = None, level = OptionRecommendation.LOW, help = _('Specify the character encoding of the input document. If set this option will override any encoding declared by the document itself. Particularly useful for documents that do not declare an encoding or that have erroneous encoding declarations.'))])
CurrentDir(output_dir).__exit__ if os.path.isdir(x) else os.remove(x)
ret = self.convert(stream, options, file_ext, log, accelerators)
finally:
pass
return ret
def postprocess_book(self, oeb, opts, log):
pass
def specialize(self, oeb, opts, log, output_fmt):
pass
class OutputFormatPlugin(Plugin):
type = _('Conversion Output')
can_be_disabled = False
supported_platforms = [
'windows',
'osx',
'linux']
file_type = None
common_options = set([
OptionRecommendation(name = 'pretty_print', recommended_value = False, level = OptionRecommendation.LOW, help = _('If specified, the output plugin will try to create output that is as human readable as possible. May not have any effect for some output plugins.'))])