Source code for senseye_cameras.input.input
import logging
import atexit
log = logging.getLogger(__name__)
[docs]class Input:
'''General interface for cameras or other input streams.'''
def __init__(self, id=0, config=None, defaults=None):
config = config or {}
defaults = defaults or {}
self.id = id
self.input = None
self.config = {**defaults, **config}
atexit.register(self.close)
[docs] def open(self):
'''Initializes the input.'''
log.debug(f'open() not implemented for {str(self)}. There was most likely an error initializing this object.')
[docs] def close(self):
'''Properly disposes of the input object.'''
log.debug(f'close() not implemented for {str(self)}.')
def __str__(self):
return f'{self.__class__.__name__}:{self.id}'