Fix pdfjs error page after jinja.render changes
This commit is contained in:
parent
e0475bf4e1
commit
4cd49d42cc
@ -219,14 +219,14 @@ class BrowserPage(QWebPage):
|
|||||||
def _show_pdfjs(self, reply):
|
def _show_pdfjs(self, reply):
|
||||||
"""Show the reply with pdfjs."""
|
"""Show the reply with pdfjs."""
|
||||||
try:
|
try:
|
||||||
page = pdfjs.generate_pdfjs_page(reply.url()).encode('utf-8')
|
page = pdfjs.generate_pdfjs_page(reply.url())
|
||||||
except pdfjs.PDFJSNotFound:
|
except pdfjs.PDFJSNotFound:
|
||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
# WORKAROUND for https://bitbucket.org/logilab/pylint/issue/490/
|
# WORKAROUND for https://bitbucket.org/logilab/pylint/issue/490/
|
||||||
page = (jinja.env.get_template('no_pdfjs.html')
|
page = jinja.render('no_pdfjs.html',
|
||||||
.render(url=reply.url().toDisplayString())
|
url=reply.url().toDisplayString())
|
||||||
.encode('utf-8'))
|
self.mainFrame().setContent(page.encode('utf-8'), 'text/html',
|
||||||
self.mainFrame().setContent(page, 'text/html', reply.url())
|
reply.url())
|
||||||
reply.deleteLater()
|
reply.deleteLater()
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user