0
0
Fork 0
mirror of https://github.com/boltgolt/howdy.git synced 2024-09-19 09:51:19 +02:00

Cleaned up AttributeError on wrong device path

This commit is contained in:
boltgolt 2020-12-30 15:20:10 +01:00
parent ed1de648a2
commit ed407d4f9e
No known key found for this signature in database
GPG key ID: BECEC9937E1AAE26

View file

@ -32,7 +32,10 @@ class VideoCapture:
# Check device path # Check device path
if not os.path.exists(self.config.get("video", "device_path")): if not os.path.exists(self.config.get("video", "device_path")):
print("Camera path is not configured correctly, please edit the 'device_path' config value.") if self.config.getboolean("video", "warn_no_device"):
print("Howdy could not find a camera device at the path specified in the config file.")
print("It is very likely that the path is not configured correctly, please edit the 'device_path' config value by running:")
print("\n\tsudo howdy config\n")
sys.exit(1) sys.exit(1)
# Create reader # Create reader
@ -52,7 +55,10 @@ class VideoCapture:
Frees resources when destroyed Frees resources when destroyed
""" """
if self is not None: if self is not None:
self.internal.release() try:
self.internal.release()
except AttributeError as err:
pass
def release(self): def release(self):
""" """