This commit is contained in:
Florian Bruhin 2016-09-14 12:00:29 +02:00
parent c128aba27e
commit 5501d90268
3 changed files with 5 additions and 2 deletions

View File

@ -97,6 +97,7 @@ class add_handler: # pylint: disable=invalid-name
return self._function(*args, **kwargs)
def wrong_backend_handler(self, url):
"""Show an error page about using the invalid backend."""
html = jinja.render('error.html',
title="Error while opening qute:url",
url=url.toDisplayString(),

View File

@ -29,12 +29,14 @@ from qutebrowser.utils import log
class QuteSchemeHandler(QWebEngineUrlSchemeHandler):
"""Handle qute:* requests on QtWebEngine."""
def install(self, profile):
"""Install the handler for qute: URLs on the given profile."""
profile.installUrlSchemeHandler(b'qute', self)
def requestStarted(self, job):
"""This method is called when a request for the scheme is started.
"""Handle a request for a qute: scheme.
This method must be reimplemented by all custom URL scheme handlers. The
request is asynchronous and does not need to be handled right away.

View File

@ -54,7 +54,7 @@ class QuteSchemeHandler(schemehandler.SchemeHandler):
return networkreply.ErrorNetworkReply(
request, errorstr, QNetworkReply.ContentNotFoundError,
self.parent())
except qutescheme.QuteSchemeOSError:
except qutescheme.QuteSchemeOSError as e:
return networkreply.ErrorNetworkReply(
request, str(e), QNetworkReply.ContentNotFoundError,
self.parent())