mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 22:33:42 +02:00
Pull from driver-dev
This commit is contained in:
commit
6977727e05
4 changed files with 6 additions and 5 deletions
|
|
@ -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 @@ def __call__(self, html, remove_special_chars=None):
|
|||
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 @@ def __enter__(self):
|
|||
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 @@ def __init__(self, parent, get_option, get_help, db=None, book_id=None):
|
|||
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…
Reference in a new issue