Use python bytes instead of QByteArray methods.
This commit is contained in:
parent
435f1f45e0
commit
51616937b8
@ -93,8 +93,8 @@ class SpecialNetworkReply(QNetworkReply):
|
|||||||
bytes available (int)
|
bytes available (int)
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return self._data.length() + super().bytesAvailable()
|
|
||||||
logging.debug("bytes available: {}".format(len(self._data)))
|
logging.debug("bytes available: {}".format(len(self._data)))
|
||||||
|
return len(self._data) + super().bytesAvailable()
|
||||||
|
|
||||||
def readData(self, maxlen):
|
def readData(self, maxlen):
|
||||||
"""Retrieve data from the reply object.
|
"""Retrieve data from the reply object.
|
||||||
@ -106,8 +106,8 @@ class SpecialNetworkReply(QNetworkReply):
|
|||||||
bytestring containing the data
|
bytestring containing the data
|
||||||
|
|
||||||
"""
|
"""
|
||||||
len_ = min(maxlen, self._data.length())
|
len_ = min(maxlen, len(self._data))
|
||||||
buf = bytes(self._data[:len_])
|
buf = bytes(self._data[:len_])
|
||||||
self._data.remove(0, len_)
|
|
||||||
logging.debug("readdata, len {}, maxlen {}, buf {}".format(len(self._data), maxlen, buf))
|
logging.debug("readdata, len {}, maxlen {}, buf {}".format(len(self._data), maxlen, buf))
|
||||||
|
self._data = self._data[len_:]
|
||||||
return buf
|
return buf
|
||||||
|
Loading…
Reference in New Issue
Block a user