mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Only load jsbrowser in the recipe system if it is actually needed
This commit is contained in:
parent
b54c64df75
commit
29ccc7d54d
@ -14,7 +14,6 @@ from functools import partial
|
|||||||
from calibre import jsbrowser
|
from calibre import jsbrowser
|
||||||
from calibre.ebooks.chardet import strip_encoding_declarations
|
from calibre.ebooks.chardet import strip_encoding_declarations
|
||||||
from calibre.utils.imghdr import what
|
from calibre.utils.imghdr import what
|
||||||
from calibre.web.jsbrowser.browser import Timeout
|
|
||||||
|
|
||||||
# remove_comments() {{{
|
# remove_comments() {{{
|
||||||
remove_comments = '''
|
remove_comments = '''
|
||||||
@ -225,6 +224,7 @@ def fetch_page(
|
|||||||
while not load_complete(browser, url, recursion_level):
|
while not load_complete(browser, url, recursion_level):
|
||||||
browser.run_for_a_time(0.1)
|
browser.run_for_a_time(0.1)
|
||||||
if time.time() - start_time > browser.default_timeout:
|
if time.time() - start_time > browser.default_timeout:
|
||||||
|
from calibre.web.jsbrowser.browser import Timeout
|
||||||
raise Timeout('Timed out while waiting for %s to load' % url)
|
raise Timeout('Timed out while waiting for %s to load' % url)
|
||||||
|
|
||||||
children = links(browser, url, recursion_level)
|
children = links(browser, url, recursion_level)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user