def control_power(onoff): if onoff == "on": MjpgStreamer.start() return 'started' elif onoff == "off": MjpgStreamer.stop() return 'stopped' return 'error'
def run(self): while not self.stopped() and self._times > 0: if self._garçon == 0: self._times -= 1 self._garçon = self._delay try: MjpgStreamer.captureImg(self._user) except: print("Exception taking picture...") self._garçon -= 1 #print("delay=%d, waiter=%d" % (self._delay, self._garçon)) time.sleep(1) self.stop() self.tl = ['', 0, 0] gui.webshell.locker.unlock(self._user)
def capture_stream(): return Response(MjpgStreamer.captureImgStream(), mimetype='image/png')
def capture(): return MjpgStreamer.captureImg(request.authorization.username)
def pruneall(): if request.authorization.username == "admin": return MjpgStreamer.prunedir("/home/pi/igem15-sw/captured/", 524288000) else: return "Error - cannot delete other user's data unless you are admin"
def prune(): return MjpgStreamer.prunedir("/home/pi/igem15-sw/captured/%s" % request.authorization.username)
def snap(): return MjpgStreamer.captureSnap(request.authorization.username)
def kick(user): MjpgStreamer.start() return 'Kicked'
def snap_scale(cal): return MjpgStreamer.scaleCaptureImg( MjpgStreamer.captureSnap(request.authorization.username), cal)
def capture_scale(cal): return MjpgStreamer.scaleCaptureImg(MjpgStreamer.captureImg(request.authorization.username), cal)