initialize gpio config. quote escaping

workspace
Brendan Howell 8 years ago
parent eeae5331aa
commit 771b9924d9

@ -33,8 +33,7 @@ class Photography(Bureau):
# set up the gpios for lamp & knobs
gpio.init()
gpio.pullup(self.doc_light_pin, 0) # reset pullup state
gpio.pullup(self.doc_light_pin, gpio.PULLDOWN)
gpio.setcfg(doc_light_pin, gpio.OUTPUT)
def _doc_light_on(self):
@ -66,15 +65,16 @@ class Photography(Bureau):
mjpg = os.path.join(modpath, "..", "..", "lib", "mjpg-streamer",
"mjpg-streamer-experimental", "mjpg_streamer")
mjpg_dir = os.path.dirname(mjpg)
cmd = mjpg.split() + ["-i", "'input_uvc.so -r 3264x2448 -n'", "-o", "'output_file.so -f /tmp/webcam -d 500 -s 1'"]
cmd = mjpg.split() + ["-i", "input_uvc.so -r 3264x2448 -n", "-o", "output_file.so -f /tmp/webcam -d 500 -s 1"]
print(cmd)
proc = subprocess.Popen(cmd, shell=True, env={"LD_LIBRARY_PATH": mjpg_dir})
time.sleep(2)
proc.terminate()
time.sleep(1)
# copy last image to the tmpfile
filelist = os.listdir()
filelist = os.listdir("/tmp/webcam")
newest = max(filelist, key=lambda x: os.stat(x).st_mtime)
shutil.copyfile(newest, tmpimg.name)

Loading…
Cancel
Save