Skip to content
This repository has been archived by the owner on May 18, 2022. It is now read-only.

Commit

Permalink
Don't assume running on Linux closes #22
Browse files Browse the repository at this point in the history
  • Loading branch information
bskari committed Mar 20, 2017
1 parent a9c7939 commit 210400a
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions watch.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,15 +362,18 @@ def main():
)
sys.exit(1)
if not webcam and not raspi_camera:
# Find which to use
raspi_exists = subprocess.call(
('/usr/bin/which', 'raspistill'),
stdout=open('/dev/null', 'w')
)
if raspi_exists == 0:
raspi_camera = True
else:
if os.name != 'posix':
raspi_camera = False
else:
# Find which to use
raspi_exists = subprocess.call(
('/usr/bin/which', 'raspistill'),
stdout=open('/dev/null', 'w')
)
if raspi_exists == 0:
raspi_camera = True
else:
raspi_camera = False
webcam = not raspi_camera

# RC cars in the 27 and 49 MHz spectrum typically operate on one of a
Expand Down

0 comments on commit 210400a

Please sign in to comment.