MCPcopy
hub / github.com/PyQt5/PyQt / httpFinished

Method httpFinished

Demo/FacePoints.py:59–76  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

57 self.startCapture()
58
59 def httpFinished(self):
60 self.outFile.close()
61 if self.httpRequestAborted or self._reply.error():
62 self.outFile.remove()
63 self._reply.deleteLater()
64 del self._reply
65 # 下载完成解压文件并加载摄像头
66 self.setText("正在解压数据。。。")
67 try:
68 bz = BZ2Decompressor()
69 data = bz.decompress(
70 open('Data/shape_predictor_68_face_landmarks.dat.bz2', 'rb').read())
71 open('Data/shape_predictor_68_face_landmarks.dat', 'wb').write(data)
72 except Exception as e:
73 self.setText('解压失败:' + str(e))
74 return
75 self.setText('正在开启摄像头。。。')
76 self.startCapture()
77
78 def httpReadyRead(self):
79 self.outFile.write(self._reply.readAll())

Callers

nothing calls this directly

Calls 4

startCaptureMethod · 0.95
errorMethod · 0.80
deleteLaterMethod · 0.80
setTextMethod · 0.45

Tested by

no test coverage detected