a little profiling to sort our why we don't download images

workspace
Brendan Howell 5 years ago
parent b706d2e177
commit 41a1b4cd2b

@ -386,7 +386,13 @@ class Bureau(object):
# use an URL fetcher that waits 30s instead of 10s
def slowfetch(url, timeout=30, ssl_context=None):
return weasyprint.default_url_fetcher(url, 30, ssl_context)
print("fetching", url)
import time
start = time.time()
ret = weasyprint.default_url_fetcher(url, 30, ssl_context)
elapsed = time.time() - start
print("fetched", url, "in", elapsed)
return ret
weasyprint.HTML(url_fetcher=slowfetch,
string=templ.render_unicode(**kwargs)).write_pdf(pdfpath)

Loading…
Cancel
Save