diff --git a/qutebrowser/network/qutescheme.py b/qutebrowser/network/qutescheme.py index 30a5fa69d..548a7bf33 100644 --- a/qutebrowser/network/qutescheme.py +++ b/qutebrowser/network/qutescheme.py @@ -17,6 +17,8 @@ """Handler functions for different qute:... pages.""" +import logging + from qutebrowser.network.schemehandler import (SchemeHandler, SpecialNetworkReply) from qutebrowser.utils.version import version @@ -104,6 +106,7 @@ class QuteSchemeHandler(SchemeHandler): # FIXME handle unknown pages # FIXME adjust URLutils based on handlers + logging.debug('request: {}'.format(request)) data = handle(urlstring(request.url())) return SpecialNetworkReply(request, data, "text/html", self.parent()) diff --git a/qutebrowser/network/schemehandler.py b/qutebrowser/network/schemehandler.py index ec119f4d3..1949da39b 100644 --- a/qutebrowser/network/schemehandler.py +++ b/qutebrowser/network/schemehandler.py @@ -20,6 +20,8 @@ """Base class for custom scheme handlers.""" +import logging + from PyQt5.QtNetwork import QNetworkReply, QNetworkRequest from PyQt5.QtCore import pyqtSlot, QObject, QIODevice, QByteArray @@ -96,6 +98,7 @@ class SpecialNetworkReply(QNetworkReply): if self._data.length() == 0: self.finished.emit() return self._data.length() + super().bytesAvailable() + logging.debug("bytes available: {}".format(len(self._data))) def readData(self, maxlen): """Retrieve data from the reply object. @@ -115,4 +118,5 @@ class SpecialNetworkReply(QNetworkReply): self._data.remove(0, len_) if self._data.length() == 0: self.finished.emit() + logging.debug("readdata, len {}, maxlen {}, buf {}".format(len(self._data), maxlen, buf)) return buf