mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Pull from driver-dev
This commit is contained in:
commit
6977727e05
@ -244,7 +244,7 @@ class KindleDXOutput(OutputProfile):
|
||||
# Screen size is a best guess
|
||||
screen_size = (744, 1022)
|
||||
dpi = 150.0
|
||||
comic_screen_size = (744, 1022)
|
||||
comic_screen_size = (741, 1022)
|
||||
|
||||
@classmethod
|
||||
def tags_to_string(cls, tags):
|
||||
|
@ -56,6 +56,7 @@ def line_length(raw, percent):
|
||||
if not lengths:
|
||||
return 0
|
||||
|
||||
lengths = list(set(lengths))
|
||||
total = sum(lengths)
|
||||
avg = total / len(lengths)
|
||||
max_line = avg * 2
|
||||
@ -189,7 +190,7 @@ class HTMLPreProcessor(object):
|
||||
if length:
|
||||
line_length_rules = [
|
||||
# Un wrap using punctuation
|
||||
(re.compile(r'(?<=.{%i}[a-z,;:-IA])\s*(?P<ital></(i|b|u)>)?\s*(<p.*?>)\s*(?=(<(i|b|u)>)?[\w\d])' % length, re.UNICODE), wrap_lines),
|
||||
(re.compile(r'(?<=.{%i}[a-z\.,;:)-IA])\s*(?P<ital></(i|b|u)>)?\s*(<p.*?>)\s*(?=(<(i|b|u)>)?\s*[\w\d(])' % length, re.UNICODE), wrap_lines),
|
||||
]
|
||||
|
||||
rules = self.PDFTOHTML + line_length_rules
|
||||
|
@ -135,7 +135,7 @@ class EbookIterator(object):
|
||||
plumber.opts, plumber.input_fmt, self.log,
|
||||
{}, self.base)
|
||||
|
||||
if plumber.input_fmt.lower() == 'pdf':
|
||||
if plumber.input_fmt.lower() in ('pdf', 'rb'):
|
||||
self.pathtoopf = create_oebbook(self.log, self.pathtoopf, plumber.opts,
|
||||
plumber.input_plugin)
|
||||
if hasattr(self.pathtoopf, 'manifest'):
|
||||
|
@ -30,5 +30,5 @@ class PluginWidget(Widget, Ui_Form):
|
||||
self.opt_newline.setModel(self.newline_model)
|
||||
|
||||
default_index = self.opt_newline.findText(default)
|
||||
self.opt_newline.setCurrentIndex(default_index if default_index != -1 else 0)
|
||||
|
||||
system_index = self.opt_newline.findText('system')
|
||||
self.opt_newline.setCurrentIndex(default_index if default_index != -1 else system_index if system_index != -1 else 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user