use full path for images

workspace
Brendan Howell 8 years ago
parent fd842a19ba
commit 5bcd089f69

@ -79,8 +79,9 @@ class Photography(Bureau):
# copy last image to the tmpfile # copy last image to the tmpfile
filelist = os.listdir("/tmp/webcam") filelist = os.listdir("/tmp/webcam")
for i, f in enumerate(filelist):
filelist[i] = os.path.join("/tmp/webcam", f)
newest = max(filelist, key=lambda x: os.stat(x).st_mtime) newest = max(filelist, key=lambda x: os.stat(x).st_mtime)
newest = os.path.join("/tmp/webcam", newest)
shutil.copyfile(newest, tmpimg.name) shutil.copyfile(newest, tmpimg.name)
self._doc_light_off() self._doc_light_off()

Loading…
Cancel
Save