mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-17 17:45:24 +01:00
...
This commit is contained in:
parent
7fa847f6e8
commit
b7e4c64da9
1 changed files with 5 additions and 1 deletions
|
|
@ -577,7 +577,7 @@ def get_resources():
|
|||
ans[url] = raw
|
||||
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()
|
||||
if urls:
|
||||
self.run_for_a_time(0.1)
|
||||
|
|
@ -586,6 +586,10 @@ def get_resources():
|
|||
get_resources()
|
||||
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):
|
||||
'''
|
||||
Download a resource (image/stylesheet/script). The resource is
|
||||
|
|
|
|||
Loading…
Reference in a new issue