From fd842a19ba0c762a636126af0f057022347a1b1d Mon Sep 17 00:00:00 2001 From: Brendan Howell Date: Fri, 5 May 2017 00:35:32 +0200 Subject: [PATCH] use full path for images --- screenless/bureau/photography/photography.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/screenless/bureau/photography/photography.py b/screenless/bureau/photography/photography.py index 305b825..5778d80 100644 --- a/screenless/bureau/photography/photography.py +++ b/screenless/bureau/photography/photography.py @@ -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()