mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
fixes from static checking
This commit is contained in:
parent
8b39fea8f8
commit
200a3cba71
@ -45,7 +45,7 @@ class MediaDaumRecipe(BasicNewsRecipe):
|
||||
lambda match: '</em>'),
|
||||
(re.compile(r'(<br[^>]*>[ \t\r\n]*)*</i>', re.DOTALL | re.IGNORECASE),
|
||||
lambda match: '</i>'),
|
||||
(re.compile(u'\(\uB05D\)[ \t\r\n]*<br[^>]*>.*</div>', re.DOTALL | re.IGNORECASE),
|
||||
(re.compile(r'\(\uB05D\)[ \t\r\n]*<br[^>]*>.*</div>', re.DOTALL | re.IGNORECASE),
|
||||
lambda match: '</div>'),
|
||||
(re.compile(r'(<br[^>]*>[ \t\r\n]*)*<div', re.DOTALL | re.IGNORECASE),
|
||||
lambda match: '<div'),
|
||||
|
@ -64,7 +64,7 @@ class Ozon(Source):
|
||||
res = None
|
||||
if ozon_id:
|
||||
# no affiliateId is used in search/detail
|
||||
url = '{}/context/detail/id/{}'.format(self.ozon_url, quote(ozon_id), _get_affiliateId())
|
||||
url = '{}/context/detail/id/{}'.format(self.ozon_url, quote(ozon_id))
|
||||
res = ('ozon', ozon_id, url)
|
||||
return res
|
||||
|
||||
|
@ -129,7 +129,7 @@ class Index(object): # {{{
|
||||
shifts = mask_to_bit_shifts[mask]
|
||||
ans |= mask & (nentries << shifts)
|
||||
if len(cbs) != cls.control_byte_count:
|
||||
raise ValueError('The entry %r is invalid'%[lead_text, tags])
|
||||
raise ValueError('The entry {!r} is invalid'.format([lead_text, tags]))
|
||||
control_bytes.append(cbs)
|
||||
return control_bytes
|
||||
|
||||
|
@ -4,7 +4,7 @@ from __python__ import bound_methods, hash_literals
|
||||
|
||||
import traceback
|
||||
from gettext import gettext as _
|
||||
from select import selection_extents, move_end_of_selection, word_at_point
|
||||
from select import move_end_of_selection, selection_extents, word_at_point
|
||||
|
||||
from fs_images import fix_fullscreen_svg_images
|
||||
from iframe_comm import IframeClient
|
||||
@ -12,20 +12,17 @@ from range_utils import (
|
||||
highlight_associated_with_selection, reset_highlight_counter, select_crw,
|
||||
unwrap_all_crw, unwrap_crw, wrap_text_in_range
|
||||
)
|
||||
from read_book.cfi import (
|
||||
cfi_for_selection, range_from_cfi, scroll_to as scroll_to_cfi
|
||||
)
|
||||
from read_book.cfi import cfi_for_selection, range_from_cfi
|
||||
from read_book.extract import get_elements
|
||||
from read_book.find import reset_find_caches, select_search_result
|
||||
from read_book.flow_mode import (
|
||||
anchor_funcs as flow_anchor_funcs, auto_scroll_action as flow_auto_scroll_action,
|
||||
cancel_drag_scroll as cancel_drag_scroll_flow, ensure_selection_visible,
|
||||
flow_onwheel, flow_to_scroll_fraction, handle_gesture as flow_handle_gesture,
|
||||
handle_shortcut as flow_handle_shortcut, layout as flow_layout,
|
||||
scroll_by_page as flow_scroll_by_page,
|
||||
handle_shortcut as flow_handle_shortcut, jump_to_cfi as flow_jump_to_cfi,
|
||||
layout as flow_layout, scroll_by_page as flow_scroll_by_page,
|
||||
scroll_to_extend_annotation as flow_annotation_scroll,
|
||||
start_drag_scroll as start_drag_scroll_flow,
|
||||
jump_to_cfi as flow_jump_to_cfi
|
||||
start_drag_scroll as start_drag_scroll_flow
|
||||
)
|
||||
from read_book.footnotes import is_footnote_link
|
||||
from read_book.globals import (
|
||||
|
@ -284,8 +284,6 @@ def layout(is_single_page, on_resize):
|
||||
nonlocal number_of_cols
|
||||
ncols = number_of_cols = (scroll_viewport.paged_content_inline_size() + gap) / col_and_gap
|
||||
if ncols is not Math.floor(ncols):
|
||||
n = number_of_cols = Math.floor(ncols)
|
||||
dw = n*col_size + (n-1)*gap
|
||||
data = {'col_size':col_size, 'gap':gap, 'scrollWidth':scroll_viewport.paged_content_inline_size(), 'ncols':ncols, 'desired_inline_size':dis}
|
||||
return data
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user