mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
...
This commit is contained in:
parent
7fa847f6e8
commit
b7e4c64da9
@ -577,7 +577,7 @@ class Browser(QObject, FormsMixin):
|
|||||||
ans[url] = raw
|
ans[url] = raw
|
||||||
urls.discard(url)
|
urls.discard(url)
|
||||||
|
|
||||||
while urls and time.time() - start_time < timeout and self.page.ready_state not in {'complete', 'completed'}:
|
while urls and time.time() - start_time < timeout and not self.load_completed:
|
||||||
get_resources()
|
get_resources()
|
||||||
if urls:
|
if urls:
|
||||||
self.run_for_a_time(0.1)
|
self.run_for_a_time(0.1)
|
||||||
@ -586,6 +586,10 @@ class Browser(QObject, FormsMixin):
|
|||||||
get_resources()
|
get_resources()
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
@property
|
||||||
|
def load_completed(self):
|
||||||
|
return self.page.ready_state in {'complete', 'completed'}
|
||||||
|
|
||||||
def get_resource(self, url, rtype='img', use_cache=True, timeout=default_timeout):
|
def get_resource(self, url, rtype='img', use_cache=True, timeout=default_timeout):
|
||||||
'''
|
'''
|
||||||
Download a resource (image/stylesheet/script). The resource is
|
Download a resource (image/stylesheet/script). The resource is
|
||||||
|
Loading…
x
Reference in New Issue
Block a user