Fixed the fix
This commit is contained in:
parent
c2ba378134
commit
edf3dbfacd
1 changed files with 18 additions and 13 deletions
31
installer.py
31
installer.py
|
|
@ -37,18 +37,18 @@ log("Installing required apt packages")
|
||||||
|
|
||||||
# Install packages though apt
|
# Install packages though apt
|
||||||
handleStatus(subprocess.call(["apt", "install", "-y", "git",
|
handleStatus(subprocess.call(["apt", "install", "-y", "git",
|
||||||
"python3-pip",
|
"python3-pip",
|
||||||
"python3-dev",
|
"python3-dev",
|
||||||
"python3-setuptools",
|
"python3-setuptools",
|
||||||
"build-essential",
|
"build-essential",
|
||||||
"libpam-python",
|
"libpam-python",
|
||||||
"fswebcam",
|
"fswebcam",
|
||||||
"libopencv-dev",
|
"libopencv-dev",
|
||||||
"python-opencv",
|
"python-opencv",
|
||||||
"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)
|
||||||
|
|
||||||
# Ask the user if this is the right one
|
try:
|
||||||
print("\033[33mOne of your cameras should now be on.\033[0m")
|
# Ask the user if this is the right one
|
||||||
ans = input("Did your IR emitters turn on? [y/N]: ")
|
print("\033[33mOne of your cameras should now be on.\033[0m")
|
||||||
|
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)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue