From 565f3a9d83f540c5932c562d04303e8e815d1232 Mon Sep 17 00:00:00 2001 From: Brendan Howell Date: Sun, 23 Jan 2022 16:32:06 +0100 Subject: [PATCH] add a base element to deal with relative urls for images and links --- screenless/bureau/bureau.py | 9 --------- screenless/bureau/publications/article.html | 1 + screenless/bureau/publications/publications.py | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/screenless/bureau/bureau.py b/screenless/bureau/bureau.py index 1059bdd..0d72203 100644 --- a/screenless/bureau/bureau.py +++ b/screenless/bureau/bureau.py @@ -461,21 +461,12 @@ class Bureau(object): # use an URL fetcher that waits 30s instead of 10s def slowfetch(url, timeout=30, ssl_context=None): - if len(url) < 50: - print("fetching", url) - import time - start = time.time() ret = weasyprint.default_url_fetcher(url, 30, ssl_context) - elapsed = time.time() - start - if len(url) < 50: - print("fetched", url, "in", elapsed) return ret html_rendered = weasyprint.HTML(url_fetcher=slowfetch, string=templ.render_unicode(**kwargs)) - print("log level:", str(self.log.getEffectiveLevel())) - print("config:", self.config) if self.log.getEffectiveLevel() == logging.DEBUG: with open("/tmp/debug.html", "w") as html_out: html_out.write(templ.render_unicode(**kwargs)) diff --git a/screenless/bureau/publications/article.html b/screenless/bureau/publications/article.html index e826846..924f79e 100644 --- a/screenless/bureau/publications/article.html +++ b/screenless/bureau/publications/article.html @@ -2,6 +2,7 @@ ${title} +