Fixed the fix

This commit is contained in:
boltgolt 2018-02-25 19:07:36 +01:00
parent c2ba378134
commit edf3dbfacd

View file

@ -48,7 +48,7 @@ handleStatus(subprocess.call(["apt", "install", "-y", "git",
"cmake"])) "cmake"]))
# Update pip # Update pip
handleStatus(subprocess.call(["pip install --upgrade pip"], shell=True)) handleStatus(subprocess.call(["pip3 install --upgrade pip"], shell=True))
log("Starting camera check") log("Starting camera check")
@ -81,9 +81,14 @@ for dev in devices:
# Let fswebcam keep the camera open in the background # Let fswebcam keep the camera open in the background
sub = subprocess.Popen(["fswebcam -S 9999999999 -d /dev/" + dev + " /dev/null 2>/dev/null"], shell=True, preexec_fn=os.setsid) sub = subprocess.Popen(["fswebcam -S 9999999999 -d /dev/" + dev + " /dev/null 2>/dev/null"], shell=True, preexec_fn=os.setsid)
try:
# Ask the user if this is the right one # Ask the user if this is the right one
print("\033[33mOne of your cameras should now be on.\033[0m") print("\033[33mOne of your cameras should now be on.\033[0m")
ans = input("Did your IR emitters turn on? [y/N]: ") ans = input("Did your IR emitters turn on? [y/N]: ")
except KeyboardInterrupt:
# Kill fswebcam if the user aborts
os.killpg(os.getpgid(sub.pid), signal.SIGTERM)
raise
# The user has answered, kill fswebcam # The user has answered, kill fswebcam
os.killpg(os.getpgid(sub.pid), signal.SIGTERM) os.killpg(os.getpgid(sub.pid), signal.SIGTERM)