Add the commit_name to all input/output plugins

This commit is contained in:
Kovid Goyal 2018-07-04 09:46:00 +05:30
parent 948a0b8ad4
commit b3f5a3cd42
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
40 changed files with 42 additions and 11 deletions

View File

@ -136,6 +136,7 @@ class InputFormatPlugin(Plugin):
type = _('Conversion input') type = _('Conversion input')
can_be_disabled = False can_be_disabled = False
supported_platforms = ['windows', 'osx', 'linux'] supported_platforms = ['windows', 'osx', 'linux']
commit_name = None # unique name under which options for this plugin are saved
#: Set of file types for which this plugin should be run #: Set of file types for which this plugin should be run
#: For example: ``set(['azw', 'mobi', 'prc'])`` #: For example: ``set(['azw', 'mobi', 'prc'])``
@ -285,6 +286,7 @@ class OutputFormatPlugin(Plugin):
type = _('Conversion output') type = _('Conversion output')
can_be_disabled = False can_be_disabled = False
supported_platforms = ['windows', 'osx', 'linux'] supported_platforms = ['windows', 'osx', 'linux']
commit_name = None # unique name under which options for this plugin are saved
#: The file type (extension without leading period) that this #: The file type (extension without leading period) that this
#: plugin outputs #: plugin outputs

View File

@ -15,6 +15,7 @@ class AZW4Input(InputFormatPlugin):
author = 'John Schember' author = 'John Schember'
description = 'Convert AZW4 to HTML' description = 'Convert AZW4 to HTML'
file_types = set(['azw4']) file_types = set(['azw4'])
commit_name = 'azw4_input'
def convert(self, stream, options, file_ext, log, def convert(self, stream, options, file_ext, log,
accelerators): accelerators):

View File

@ -16,6 +16,7 @@ class CHMInput(InputFormatPlugin):
author = 'Kovid Goyal and Alex Bramley' author = 'Kovid Goyal and Alex Bramley'
description = 'Convert CHM files to OEB' description = 'Convert CHM files to OEB'
file_types = set(['chm']) file_types = set(['chm'])
commit_name = 'chm_input'
def _chmtohtml(self, output_dir, chm_path, no_images, log, debug_dump=False): def _chmtohtml(self, output_dir, chm_path, no_images, log, debug_dump=False):
from calibre.ebooks.chm.reader import CHMReader from calibre.ebooks.chm.reader import CHMReader

View File

@ -21,6 +21,7 @@ class ComicInput(InputFormatPlugin):
description = 'Optimize comic files (.cbz, .cbr, .cbc) for viewing on portable devices' description = 'Optimize comic files (.cbz, .cbr, .cbc) for viewing on portable devices'
file_types = set(['cbz', 'cbr', 'cbc']) file_types = set(['cbz', 'cbr', 'cbc'])
is_image_collection = True is_image_collection = True
commit_name = 'comic_input'
core_usage = -1 core_usage = -1
options = set([ options = set([

View File

@ -19,6 +19,7 @@ class DJVUInput(InputFormatPlugin):
author = 'Anthon van der Neut' author = 'Anthon van der Neut'
description = 'Convert OCR-ed DJVU files (.djvu) to HTML' description = 'Convert OCR-ed DJVU files (.djvu) to HTML'
file_types = set(['djvu', 'djv']) file_types = set(['djvu', 'djv'])
commit_name = 'djvu_input'
def convert(self, stream, options, file_ext, log, accelerators): def convert(self, stream, options, file_ext, log, accelerators):
from calibre.ebooks.txt.processor import convert_basic from calibre.ebooks.txt.processor import convert_basic
@ -61,4 +62,3 @@ class DJVUInput(InputFormatPlugin):
meta_info_to_oeb_metadata(mi, oeb.metadata, log) meta_info_to_oeb_metadata(mi, oeb.metadata, log)
return oeb return oeb

View File

@ -14,6 +14,7 @@ class DOCXInput(InputFormatPlugin):
author = 'Kovid Goyal' author = 'Kovid Goyal'
description = _('Convert DOCX files (.docx and .docm) to HTML') description = _('Convert DOCX files (.docx and .docm) to HTML')
file_types = {'docx', 'docm'} file_types = {'docx', 'docm'}
commit_name = 'docx_input'
options = { options = {
OptionRecommendation(name='docx_no_cover', recommended_value=False, OptionRecommendation(name='docx_no_cover', recommended_value=False,

View File

@ -17,6 +17,7 @@ class DOCXOutput(OutputFormatPlugin):
name = 'DOCX Output' name = 'DOCX Output'
author = 'Kovid Goyal' author = 'Kovid Goyal'
file_type = 'docx' file_type = 'docx'
commit_name = 'docx_output'
options = { options = {
OptionRecommendation(name='docx_page_size', recommended_value='letter', OptionRecommendation(name='docx_page_size', recommended_value='letter',

View File

@ -34,6 +34,7 @@ class EPUBInput(InputFormatPlugin):
description = 'Convert EPUB files (.epub) to HTML' description = 'Convert EPUB files (.epub) to HTML'
file_types = set(['epub']) file_types = set(['epub'])
output_encoding = None output_encoding = None
commit_name = 'epub_input'
recommendations = set([('page_breaks_before', '/', OptionRecommendation.MED)]) recommendations = set([('page_breaks_before', '/', OptionRecommendation.MED)])

View File

@ -48,6 +48,7 @@ class EPUBOutput(OutputFormatPlugin):
name = 'EPUB Output' name = 'EPUB Output'
author = 'Kovid Goyal' author = 'Kovid Goyal'
file_type = 'epub' file_type = 'epub'
commit_name = 'epub_output'
options = set([ options = set([
OptionRecommendation(name='extract_to', OptionRecommendation(name='extract_to',

View File

@ -19,6 +19,7 @@ class FB2Input(InputFormatPlugin):
author = 'Anatoly Shipitsin' author = 'Anatoly Shipitsin'
description = 'Convert FB2 and FBZ files to HTML' description = 'Convert FB2 and FBZ files to HTML'
file_types = {'fb2', 'fbz'} file_types = {'fb2', 'fbz'}
commit_name = 'fb2_input'
recommendations = set([ recommendations = set([
('level1_toc', '//h:h1', OptionRecommendation.MED), ('level1_toc', '//h:h1', OptionRecommendation.MED),

View File

@ -14,6 +14,7 @@ class FB2Output(OutputFormatPlugin):
name = 'FB2 Output' name = 'FB2 Output'
author = 'John Schember' author = 'John Schember'
file_type = 'fb2' file_type = 'fb2'
commit_name = 'fb2_output'
FB2_GENRES = [ FB2_GENRES = [
# Science Fiction & Fantasy # Science Fiction & Fantasy

View File

@ -29,6 +29,7 @@ class HTMLInput(InputFormatPlugin):
author = 'Kovid Goyal' author = 'Kovid Goyal'
description = 'Convert HTML and OPF files to an OEB' description = 'Convert HTML and OPF files to an OEB'
file_types = set(['opf', 'html', 'htm', 'xhtml', 'xhtm', 'shtm', 'shtml']) file_types = set(['opf', 'html', 'htm', 'xhtml', 'xhtm', 'shtm', 'shtml'])
commit_name = 'html_input'
options = set([ options = set([
OptionRecommendation(name='breadth_first', OptionRecommendation(name='breadth_first',

View File

@ -20,6 +20,7 @@ class HTMLOutput(OutputFormatPlugin):
name = 'HTML Output' name = 'HTML Output'
author = 'Fabian Grassl' author = 'Fabian Grassl'
file_type = 'zip' file_type = 'zip'
commit_name = 'html_output'
options = set([ options = set([
OptionRecommendation(name='template_css', OptionRecommendation(name='template_css',

View File

@ -18,6 +18,7 @@ class HTMLZInput(InputFormatPlugin):
author = 'John Schember' author = 'John Schember'
description = 'Convert HTML files to HTML' description = 'Convert HTML files to HTML'
file_types = set(['htmlz']) file_types = set(['htmlz'])
commit_name = 'htmlz_input'
def convert(self, stream, options, file_ext, log, def convert(self, stream, options, file_ext, log,
accelerators): accelerators):

View File

@ -20,6 +20,7 @@ class HTMLZOutput(OutputFormatPlugin):
name = 'HTMLZ Output' name = 'HTMLZ Output'
author = 'John Schember' author = 'John Schember'
file_type = 'htmlz' file_type = 'htmlz'
commit_name = 'htmlz_output'
options = set([ options = set([
OptionRecommendation(name='htmlz_css_type', recommended_value='class', OptionRecommendation(name='htmlz_css_type', recommended_value='class',

View File

@ -15,6 +15,7 @@ class LITInput(InputFormatPlugin):
author = 'Marshall T. Vandegrift' author = 'Marshall T. Vandegrift'
description = 'Convert LIT files to HTML' description = 'Convert LIT files to HTML'
file_types = set(['lit']) file_types = set(['lit'])
commit_name = 'lit_input'
def convert(self, stream, options, file_ext, log, def convert(self, stream, options, file_ext, log,
accelerators): accelerators):

View File

@ -15,6 +15,7 @@ class LITOutput(OutputFormatPlugin):
name = 'LIT Output' name = 'LIT Output'
author = 'Marshall T. Vandegrift' author = 'Marshall T. Vandegrift'
file_type = 'lit' file_type = 'lit'
commit_name = 'lit_output'
def convert(self, oeb, output_path, input_plugin, opts, log): def convert(self, oeb, output_path, input_plugin, opts, log):
self.log, self.opts, self.oeb = log, opts, oeb self.log, self.opts, self.oeb = log, opts, oeb
@ -35,5 +36,3 @@ class LITOutput(OutputFormatPlugin):
rasterizer(oeb, opts) rasterizer(oeb, opts)
lit = LitWriter(self.opts) lit = LitWriter(self.opts)
lit(oeb, output_path) lit(oeb, output_path)

View File

@ -16,6 +16,7 @@ class LRFInput(InputFormatPlugin):
author = 'Kovid Goyal' author = 'Kovid Goyal'
description = 'Convert LRF files to HTML' description = 'Convert LRF files to HTML'
file_types = set(['lrf']) file_types = set(['lrf'])
commit_name = 'lrf_input'
def convert(self, stream, options, file_ext, log, def convert(self, stream, options, file_ext, log,
accelerators): accelerators):

View File

@ -90,6 +90,7 @@ class LRFOutput(OutputFormatPlugin):
name = 'LRF Output' name = 'LRF Output'
author = 'Kovid Goyal' author = 'Kovid Goyal'
file_type = 'lrf' file_type = 'lrf'
commit_name = 'lrf_output'
options = set([ options = set([
OptionRecommendation(name='enable_autorotation', recommended_value=False, OptionRecommendation(name='enable_autorotation', recommended_value=False,

View File

@ -14,6 +14,7 @@ class MOBIInput(InputFormatPlugin):
author = 'Kovid Goyal' author = 'Kovid Goyal'
description = 'Convert MOBI files (.mobi, .prc, .azw) to HTML' description = 'Convert MOBI files (.mobi, .prc, .azw) to HTML'
file_types = set(['mobi', 'prc', 'azw', 'azw3', 'pobi']) file_types = set(['mobi', 'prc', 'azw', 'azw3', 'pobi'])
commit_name = 'mobi_input'
def convert(self, stream, options, file_ext, log, def convert(self, stream, options, file_ext, log,
accelerators): accelerators):
@ -60,4 +61,3 @@ class MOBIInput(InputFormatPlugin):
q.write(raw) q.write(raw)
accelerators['pagebreaks'] = '//h:div[@class="mbp_pagebreak"]' accelerators['pagebreaks'] = '//h:div[@class="mbp_pagebreak"]'
return mr.created_opf_path return mr.created_opf_path

View File

@ -41,6 +41,7 @@ class MOBIOutput(OutputFormatPlugin):
name = 'MOBI Output' name = 'MOBI Output'
author = 'Kovid Goyal' author = 'Kovid Goyal'
file_type = 'mobi' file_type = 'mobi'
commit_name = 'mobi_output'
options = set([ options = set([
OptionRecommendation(name='prefer_author_sort', OptionRecommendation(name='prefer_author_sort',
@ -271,6 +272,7 @@ class AZW3Output(OutputFormatPlugin):
name = 'AZW3 Output' name = 'AZW3 Output'
author = 'Kovid Goyal' author = 'Kovid Goyal'
file_type = 'azw3' file_type = 'azw3'
commit_name = 'azw3_output'
options = set([ options = set([
OptionRecommendation(name='prefer_author_sort', OptionRecommendation(name='prefer_author_sort',

View File

@ -16,10 +16,9 @@ class ODTInput(InputFormatPlugin):
author = 'Kovid Goyal' author = 'Kovid Goyal'
description = 'Convert ODT (OpenOffice) files to HTML' description = 'Convert ODT (OpenOffice) files to HTML'
file_types = set(['odt']) file_types = set(['odt'])
commit_name = 'odt_input'
def convert(self, stream, options, file_ext, log, def convert(self, stream, options, file_ext, log,
accelerators): accelerators):
from calibre.ebooks.odt.input import Extract from calibre.ebooks.odt.input import Extract
return Extract()(stream, '.', log) return Extract()(stream, '.', log)

View File

@ -16,6 +16,7 @@ class OEBOutput(OutputFormatPlugin):
name = 'OEB Output' name = 'OEB Output'
author = 'Kovid Goyal' author = 'Kovid Goyal'
file_type = 'oeb' file_type = 'oeb'
commit_name = 'oeb_output'
recommendations = set([('pretty_print', True, OptionRecommendation.HIGH)]) recommendations = set([('pretty_print', True, OptionRecommendation.HIGH)])
@ -119,4 +120,3 @@ class OEBOutput(OutputFormatPlugin):
if clc: if clc:
lang.text = clc lang.text = clc
# }}} # }}}

View File

@ -15,6 +15,7 @@ class PDBInput(InputFormatPlugin):
author = 'John Schember' author = 'John Schember'
description = 'Convert PDB to HTML' description = 'Convert PDB to HTML'
file_types = set(['pdb', 'updb']) file_types = set(['pdb', 'updb'])
commit_name = 'pdb_input'
def convert(self, stream, options, file_ext, log, def convert(self, stream, options, file_ext, log,
accelerators): accelerators):

View File

@ -16,6 +16,7 @@ class PDBOutput(OutputFormatPlugin):
name = 'PDB Output' name = 'PDB Output'
author = 'John Schember' author = 'John Schember'
file_type = 'pdb' file_type = 'pdb'
commit_name = 'pdb_output'
options = set([ options = set([
OptionRecommendation(name='format', recommended_value='doc', OptionRecommendation(name='format', recommended_value='doc',
@ -60,4 +61,3 @@ class PDBOutput(OutputFormatPlugin):
if close: if close:
out_stream.close() out_stream.close()

View File

@ -15,6 +15,7 @@ class PDFInput(InputFormatPlugin):
author = 'Kovid Goyal and John Schember' author = 'Kovid Goyal and John Schember'
description = 'Convert PDF files to HTML' description = 'Convert PDF files to HTML'
file_types = set(['pdf']) file_types = set(['pdf'])
commit_name = 'pdf_input'
options = set([ options = set([
OptionRecommendation(name='no_images', recommended_value=False, OptionRecommendation(name='no_images', recommended_value=False,

View File

@ -50,6 +50,7 @@ class PDFOutput(OutputFormatPlugin):
name = 'PDF Output' name = 'PDF Output'
author = 'Kovid Goyal' author = 'Kovid Goyal'
file_type = 'pdf' file_type = 'pdf'
commit_name = 'pdf_output'
options = set([ options = set([
OptionRecommendation(name='use_profile_size', recommended_value=False, OptionRecommendation(name='use_profile_size', recommended_value=False,

View File

@ -19,6 +19,7 @@ class PMLInput(InputFormatPlugin):
description = 'Convert PML to OEB' description = 'Convert PML to OEB'
# pmlz is a zip file containing pml files and png images. # pmlz is a zip file containing pml files and png images.
file_types = set(['pml', 'pmlz']) file_types = set(['pml', 'pmlz'])
commit_name = 'pml_input'
def process_pml(self, pml_path, html_path, close_all=False): def process_pml(self, pml_path, html_path, close_all=False):
from calibre.ebooks.pml.pmlconverter import PML_HTMLizer from calibre.ebooks.pml.pmlconverter import PML_HTMLizer

View File

@ -16,6 +16,7 @@ class PMLOutput(OutputFormatPlugin):
name = 'PML Output' name = 'PML Output'
author = 'John Schember' author = 'John Schember'
file_type = 'pmlz' file_type = 'pmlz'
commit_name = 'pml_output'
options = set([ options = set([
OptionRecommendation(name='pml_output_encoding', recommended_value='cp1252', OptionRecommendation(name='pml_output_encoding', recommended_value='cp1252',

View File

@ -15,6 +15,7 @@ class RBInput(InputFormatPlugin):
author = 'John Schember' author = 'John Schember'
description = 'Convert RB files to HTML' description = 'Convert RB files to HTML'
file_types = set(['rb']) file_types = set(['rb'])
commit_name = 'rb_input'
def convert(self, stream, options, file_ext, log, def convert(self, stream, options, file_ext, log,
accelerators): accelerators):

View File

@ -14,6 +14,7 @@ class RBOutput(OutputFormatPlugin):
name = 'RB Output' name = 'RB Output'
author = 'John Schember' author = 'John Schember'
file_type = 'rb' file_type = 'rb'
commit_name = 'rb_output'
options = set([ options = set([
OptionRecommendation(name='inline_toc', OptionRecommendation(name='inline_toc',

View File

@ -23,6 +23,7 @@ class RecipeInput(InputFormatPlugin):
author = 'Kovid Goyal' author = 'Kovid Goyal'
description = _('Download periodical content from the internet') description = _('Download periodical content from the internet')
file_types = set(['recipe', 'downloaded_recipe']) file_types = set(['recipe', 'downloaded_recipe'])
commit_name = 'recipe_input'
recommendations = set([ recommendations = set([
('chapter', None, OptionRecommendation.HIGH), ('chapter', None, OptionRecommendation.HIGH),
@ -147,4 +148,3 @@ class RecipeInput(InputFormatPlugin):
if isinstance(raw, unicode): if isinstance(raw, unicode):
raw = raw.encode('utf-8') raw = raw.encode('utf-8')
zf.writestr('download.recipe', raw) zf.writestr('download.recipe', raw)

View File

@ -44,6 +44,7 @@ class RTFInput(InputFormatPlugin):
author = 'Kovid Goyal' author = 'Kovid Goyal'
description = 'Convert RTF files to HTML' description = 'Convert RTF files to HTML'
file_types = set(['rtf']) file_types = set(['rtf'])
commit_name = 'rtf_input'
options = { options = {
OptionRecommendation(name='ignore_wmf', recommended_value=False, OptionRecommendation(name='ignore_wmf', recommended_value=False,
@ -317,4 +318,3 @@ class RTFInput(InputFormatPlugin):
p.text = (p.text or '') + img.tail p.text = (p.text or '') + img.tail
else: else:
p[idx-1].tail = (p[idx-1].tail or '') + img.tail p[idx-1].tail = (p[idx-1].tail or '') + img.tail

View File

@ -14,6 +14,7 @@ class RTFOutput(OutputFormatPlugin):
name = 'RTF Output' name = 'RTF Output'
author = 'John Schember' author = 'John Schember'
file_type = 'rtf' file_type = 'rtf'
commit_name = 'rtf_output'
def convert(self, oeb_book, output_path, input_plugin, opts, log): def convert(self, oeb_book, output_path, input_plugin, opts, log):
from calibre.ebooks.rtf.rtfml import RTFMLizer from calibre.ebooks.rtf.rtfml import RTFMLizer

View File

@ -23,6 +23,7 @@ class SNBInput(InputFormatPlugin):
author = 'Li Fanxi' author = 'Li Fanxi'
description = 'Convert SNB files to OEB' description = 'Convert SNB files to OEB'
file_types = set(['snb']) file_types = set(['snb'])
commit_name = 'snb_input'
options = set([ options = set([
]) ])
@ -119,4 +120,3 @@ class SNBInput(InputFormatPlugin):
item.html_input_href = f item.html_input_href = f
return oeb return oeb

View File

@ -16,6 +16,7 @@ class SNBOutput(OutputFormatPlugin):
name = 'SNB Output' name = 'SNB Output'
author = 'Li Fanxi' author = 'Li Fanxi'
file_type = 'snb' file_type = 'snb'
commit_name = 'snb_output'
options = set([ options = set([
OptionRecommendation(name='snb_output_encoding', recommended_value='utf-8', OptionRecommendation(name='snb_output_encoding', recommended_value='utf-8',

View File

@ -15,6 +15,7 @@ class TCRInput(InputFormatPlugin):
author = 'John Schember' author = 'John Schember'
description = 'Convert TCR files to HTML' description = 'Convert TCR files to HTML'
file_types = set(['tcr']) file_types = set(['tcr'])
commit_name = 'tcr_input'
def convert(self, stream, options, file_ext, log, accelerators): def convert(self, stream, options, file_ext, log, accelerators):
from calibre.ebooks.compression.tcr import decompress from calibre.ebooks.compression.tcr import decompress

View File

@ -15,6 +15,7 @@ class TCROutput(OutputFormatPlugin):
name = 'TCR Output' name = 'TCR Output'
author = 'John Schember' author = 'John Schember'
file_type = 'tcr' file_type = 'tcr'
commit_name = 'tcr_output'
options = set([ options = set([
OptionRecommendation(name='tcr_output_encoding', recommended_value='utf-8', OptionRecommendation(name='tcr_output_encoding', recommended_value='utf-8',

View File

@ -31,6 +31,7 @@ class TXTInput(InputFormatPlugin):
author = 'John Schember' author = 'John Schember'
description = 'Convert TXT files to HTML' description = 'Convert TXT files to HTML'
file_types = {'txt', 'txtz', 'text', 'md', 'textile', 'markdown'} file_types = {'txt', 'txtz', 'text', 'md', 'textile', 'markdown'}
commit_name = 'txt_input'
options = set([ options = set([
OptionRecommendation(name='paragraph_type', recommended_value='auto', OptionRecommendation(name='paragraph_type', recommended_value='auto',

View File

@ -20,6 +20,7 @@ class TXTOutput(OutputFormatPlugin):
name = 'TXT Output' name = 'TXT Output'
author = 'John Schember' author = 'John Schember'
file_type = 'txt' file_type = 'txt'
commit_name = 'txt_output'
options = set([ options = set([
OptionRecommendation(name='newline', recommended_value='system', OptionRecommendation(name='newline', recommended_value='system',