MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / onDone

Method onDone

src/astroprint/camera/__init__.py:245–259  ·  view source on GitHub ↗
(picBuf)

Source from the content-addressed store, hash-verified

243 waitForPhoto = None
244
245 def onDone(picBuf):
246 result = False
247
248 if picBuf:
249 picData = astroprintCloud().uploadImageFile(timelapseId, picBuf)
250 #we need to check again as it's possible that this was the last
251 #pic and the timelapse is closed.
252 if picData and self.timelapseInfo:
253 self.timelapseInfo['last_photo'] = picData['url']
254 self._eventManager.fire(Events.CAPTURE_INFO_CHANGED, self.timelapseInfo)
255 result = True
256
257 if waitForPhoto and not waitForPhoto.isSet():
258 responseCont[0] = result
259 waitForPhoto.set()
260
261 self.get_pic_async(onDone, text)
262

Callers

nothing calls this directly

Calls 5

astroprintCloudFunction · 0.90
uploadImageFileMethod · 0.80
fireMethod · 0.80
isSetMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected