add some debugging for pre-rendered html

workspace
Brendan Howell 5 years ago
parent 69f3587f4d
commit 6b706839ee

@ -399,13 +399,12 @@ class Bureau(object):
html_rendered = weasyprint.HTML(url_fetcher=slowfetch, html_rendered = weasyprint.HTML(url_fetcher=slowfetch,
string=templ.render_unicode(**kwargs)) string=templ.render_unicode(**kwargs))
if self.log.getEffectiveLevel == logging.DEBUG: if self.log.getEffectiveLevel() == logging.DEBUG:
with open("/tmp/debug.html", "w") as html_out: with open("/tmp/debug.html", "w") as html_out:
html_out.write(html_rendered) html_out.write(html_rendered)
self.log.debug("debug html output at /tmp/debug.html") self.log.debug("debug html output at /tmp/debug.html")
html_rendered.write_pdf(pdfpath) html_rendered.write_pdf(pdfpath)
self.log.debug("wrote PDF to:", pdfpath)
subprocess.call("lpr -o sides=two-sided-long-edge -o InputSlot=Upper " subprocess.call("lpr -o sides=two-sided-long-edge -o InputSlot=Upper "
+ pdfpath, shell=True) + pdfpath, shell=True)

Loading…
Cancel
Save