This commit is contained in:
Kovid Goyal 2011-06-24 11:33:25 -06:00
parent 094d82b92a
commit e83f2dc338
3 changed files with 9 additions and 6 deletions

View File

@ -41,7 +41,7 @@
- title: "Allow search and replace on comments custom columns." - title: "Allow search and replace on comments custom columns."
- title: "Add a new action 'Quick View' to show the books in your library by the author(s) of the currently selected book, in a separate window. You can add it to your toolbar or right click menu by going to Preferences->Toolbars." - title: "Add a new action 'Quick View' to show the books in your library by the author/tags/series/etc. of the currently selected book, in a separate window. You can add it to your toolbar or right click menu by going to Preferences->Toolbars."
- title: "Get Books: Add libri.de as a book source. Fix a bug that caused some books downloads to fail. Fixes to the Legimi and beam-ebooks.de stores" - title: "Get Books: Add libri.de as a book source. Fix a bug that caused some books downloads to fail. Fixes to the Legimi and beam-ebooks.de stores"
tickets: [799367] tickets: [799367]

View File

@ -59,6 +59,8 @@ class CompositeProgressReporter(object):
(self.global_max - self.global_min) (self.global_max - self.global_min)
self.global_reporter(global_frac, msg) self.global_reporter(global_frac, msg)
ARCHIVE_FMTS = ('zip', 'rar', 'oebzip')
class Plumber(object): class Plumber(object):
''' '''
The `Plumber` manages the conversion pipeline. An UI should call the methods The `Plumber` manages the conversion pipeline. An UI should call the methods
@ -594,7 +596,7 @@ OptionRecommendation(name='sr3_replace',
raise ValueError('Input file must have an extension') raise ValueError('Input file must have an extension')
input_fmt = input_fmt[1:].lower() input_fmt = input_fmt[1:].lower()
self.archive_input_tdir = None self.archive_input_tdir = None
if input_fmt in ('zip', 'rar', 'oebzip'): if input_fmt in ARCHIVE_FMTS:
self.log('Processing archive...') self.log('Processing archive...')
tdir = PersistentTemporaryDirectory('_plumber_archive') tdir = PersistentTemporaryDirectory('_plumber_archive')
self.input, input_fmt = self.unarchive(self.input, tdir) self.input, input_fmt = self.unarchive(self.input, tdir)

View File

@ -11,8 +11,8 @@ import sys, cPickle, shutil, importlib
from PyQt4.Qt import QString, SIGNAL, QAbstractListModel, Qt, QVariant, QFont from PyQt4.Qt import QString, SIGNAL, QAbstractListModel, Qt, QVariant, QFont
from calibre.gui2 import ResizableDialog, NONE from calibre.gui2 import ResizableDialog, NONE
from calibre.ebooks.conversion.config import GuiRecommendations, save_specifics, \ from calibre.ebooks.conversion.config import (GuiRecommendations, save_specifics,
load_specifics load_specifics)
from calibre.gui2.convert.single_ui import Ui_Dialog from calibre.gui2.convert.single_ui import Ui_Dialog
from calibre.gui2.convert.metadata import MetadataWidget from calibre.gui2.convert.metadata import MetadataWidget
from calibre.gui2.convert.look_and_feel import LookAndFeelWidget from calibre.gui2.convert.look_and_feel import LookAndFeelWidget
@ -24,7 +24,8 @@ from calibre.gui2.convert.toc import TOCWidget
from calibre.gui2.convert.debug import DebugWidget from calibre.gui2.convert.debug import DebugWidget
from calibre.ebooks.conversion.plumber import Plumber, supported_input_formats from calibre.ebooks.conversion.plumber import (Plumber,
supported_input_formats, ARCHIVE_FMTS)
from calibre.ebooks.conversion.config import delete_specifics from calibre.ebooks.conversion.config import delete_specifics
from calibre.customize.ui import available_output_formats from calibre.customize.ui import available_output_formats
from calibre.customize.conversion import OptionRecommendation from calibre.customize.conversion import OptionRecommendation
@ -159,7 +160,7 @@ class Config(ResizableDialog, Ui_Dialog):
log = Log() log = Log()
log.outputs = [] log.outputs = []
input_file = 'dummy.'+input_format input_file = 'dummy.'+input_format
if input_format in ('zip', 'rar', 'oebzip'): if input_format in ARCHIVE_FMTS:
input_file = 'dummy.html' input_file = 'dummy.html'
self.plumber = Plumber(input_file, output_path, log) self.plumber = Plumber(input_file, output_path, log)