Coverage for qutebrowser/browser/webkit/network/networkreply.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # Based on the Eric5 helpviewer, # Copyright (c) 2009 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # qutebrowser is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with qutebrowser. If not, see <http://www.gnu.org/licenses/>. # # For some reason, a segfault will be triggered if the unnecessary lambdas in # this file aren't there. # pylint: disable=unnecessary-lambda
"""QNetworkReply subclass for fixed data."""
parent=None): """Constructor.
Args: request: reference to the request object (QNetworkRequest) fileData: reference to the data buffer (QByteArray) mimeType: for the reply (string) parent: reference to the parent object (QObject) """
QByteArray.number(len(fileData))) # For some reason, a segfault will be triggered if these lambdas aren't # there. # pylint: disable=unnecessary-lambda
def abort(self): """Abort the operation."""
"""Determine the bytes available for being read.
Return: bytes available (int) """
"""Retrieve data from the reply object.
Args: maxlen maximum number of bytes to read (int)
Return: bytestring containing the data """
"""QNetworkReply which always returns an error."""
"""Constructor.
Args: req: The QNetworkRequest associated with this reply. errorstring: The error string to print. error: The numerical error value. parent: The parent to pass to QNetworkReply. """ # We don't actually want to read anything, but we still need to open # the device to avoid getting a warning.
"""Do nothing since it's a fake reply."""
"""We always have 0 bytes available."""
"""No data available."""
"""A reply which redirects to the given URL."""
"""Called when there's e.g. a redirection limit."""
|