use full path for images

workspace
Brendan Howell 7 years ago
parent 666f6fc690
commit fd842a19ba

@ -75,11 +75,12 @@ class Photography(Bureau):
time.sleep(2)
killer_cmd = "killall -s SIGINT mjpg_streamer"
subprocess.Popen(killer_cmd.split())
time.sleep(2)
time.sleep(1)
# copy last image to the tmpfile
filelist = os.listdir("/tmp/webcam")
newest = max(filelist, key=lambda x: os.stat(x).st_mtime)
newest = os.path.join("/tmp/webcam", newest)
shutil.copyfile(newest, tmpimg.name)
self._doc_light_off()

Loading…
Cancel
Save