Esempio n. 1
0
def control_power(onoff):
    if onoff == "on":
        MjpgStreamer.start()
        return 'started'
    elif onoff == "off":
        MjpgStreamer.stop()
        return 'stopped'
    return 'error'
Esempio n. 2
0
def control_power(onoff):
    if onoff == "on":
        MjpgStreamer.start()
        return 'started'
    elif onoff == "off":
        MjpgStreamer.stop()
        return 'stopped'
    return 'error'
Esempio n. 3
0
 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)
Esempio n. 4
0
 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)
Esempio n. 5
0
def capture_stream():
    return Response(MjpgStreamer.captureImgStream(), mimetype='image/png')
Esempio n. 6
0
def capture():
    return MjpgStreamer.captureImg(request.authorization.username)
Esempio n. 7
0
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"
Esempio n. 8
0
def prune():
    return MjpgStreamer.prunedir("/home/pi/igem15-sw/captured/%s" % request.authorization.username)
Esempio n. 9
0
def snap():
    return MjpgStreamer.captureSnap(request.authorization.username)
Esempio n. 10
0
def snap():
    return MjpgStreamer.captureSnap(request.authorization.username)
Esempio n. 11
0
def kick(user):
    MjpgStreamer.start()

    return 'Kicked'
Esempio n. 12
0
def capture():
    return MjpgStreamer.captureImg(request.authorization.username)
Esempio n. 13
0
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"
Esempio n. 14
0
def prune():
    return MjpgStreamer.prunedir("/home/pi/igem15-sw/captured/%s" %
                                 request.authorization.username)
Esempio n. 15
0
def snap_scale(cal):
    return MjpgStreamer.scaleCaptureImg(
        MjpgStreamer.captureSnap(request.authorization.username), cal)
Esempio n. 16
0
def capture_scale(cal):
    return MjpgStreamer.scaleCaptureImg(MjpgStreamer.captureImg(request.authorization.username), cal)
Esempio n. 17
0
def kick(user):
    MjpgStreamer.start()

    return 'Kicked'
Esempio n. 18
0
def capture_stream():
    return Response(MjpgStreamer.captureImgStream(), mimetype='image/png')