Added picamera import checker
This commit is contained in:
parent
b98522a424
commit
013aebd97a
2 changed files with 19 additions and 2 deletions
15
openflexure_microscope/rescue/check_picamera.py
Normal file
15
openflexure_microscope/rescue/check_picamera.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import logging
|
||||
|
||||
def main():
|
||||
error_sources = []
|
||||
logging.info("Attempting to import picamera...")
|
||||
|
||||
try:
|
||||
from picamerax import PiCamera
|
||||
except Exception as e: # pylint: disable=W0703
|
||||
# TODO: Parse exception object for a few different issues, and append different error sources
|
||||
# E.g. pi with camera already in use, disconnected, unsupported OS, etc
|
||||
logging.error(e)
|
||||
error_sources.append("picamera_import_error")
|
||||
|
||||
return error_sources
|
||||
Loading…
Add table
Add a link
Reference in a new issue