def __init__(self, parent, url, operation, content=""): QNetworkReply.__init__(self, parent) self.content = content self.offset = 0 self.setHeader(QNetworkRequest.ContentTypeHeader, "text/html; charset=UTF-8") self.setHeader(QNetworkRequest.ContentLengthHeader, len(self.content)) try: QTimer.singleShot(0, self.readyRead) QTimer.singleShot(0, self.finished) except: QTimer.singleShot(0, self, SIGNAL("readyRead()")) QTimer.singleShot(0, self, SIGNAL("finished()")) self.open(self.ReadOnly | self.Unbuffered) self.setUrl(url)
def __init__(self, parent, reply): QNetworkReply.__init__(self, parent) self.reply = reply # reply to proxy self.data = '' # contains downloaded data self.buffer = '' # contains buffer of data to read self.setOpenMode(QNetworkReply.ReadOnly | QNetworkReply.Unbuffered) #print dir(reply) # connect signal from proxy reply reply.metaDataChanged.connect(self.applyMetaData) reply.readyRead.connect(self.readInternal) reply.finished.connect(self.finished) reply.uploadProgress.connect(self.uploadProgress) reply.downloadProgress.connect(self.downloadProgress)
def __init__(self, parent, url, operation, content=""): QNetworkReply.__init__(self, parent) self.content = content self.offset = 0 self.setHeader(QNetworkRequest.ContentTypeHeader, "text/html; charset=UTF-8") self.setHeader(QNetworkRequest.ContentLengthHeader, len(self.content)) try: QTimer.singleShot(0, self.readyRead) QTimer.singleShot(0, self.finished) except: QTimer.singleShot(0, self, SIGNAL("readyRead()")) QTimer.singleShot(0, self, SIGNAL("finished()")) self.open(self.ReadOnly | self.Unbuffered) self.setUrl(url)
def __init__(self, parent, operation, request, searcher_hp, searcher_de): QNetworkReply.__init__(self, parent) url = request.url() self.setRequest(request) self.setUrl(url) self.setOperation(operation) self.open(QIODevice.ReadOnly) self._finished = False self._data = None self._offset = 0 self._url = url self._searcher_hp = searcher_hp self._searcher_de = searcher_de QTimer.singleShot(0, self._load) # don't disturb the UI thread
def __init__(self, manager, url, handler, encoding="UTF-8"): QNetworkReply.__init__(self, manager) self.setUrl(url) self._handler = handler self._encoding = encoding
def __init__(self, manager, url, handler, encoding="UTF-8"): QNetworkReply.__init__(self, manager) self.setUrl(url) self._handler = handler self._encoding = encoding