vedb / pupil_recording_interface

A pythonic interface for the Pupil Core system
https://vedb.github.io/pupil_recording_interface
GNU General Public License v3.0
1 stars 0 forks source link

Decorators #10

Closed phausamann closed 4 years ago

phausamann commented 4 years ago

These decorators register the corresponding class such that a from_config implementation can look up the class in a registry.

Example for @device

@device('new_device')
class NewDevice:
    ...

def from_config(config, ...)
    ...
    device = _device_registry[config.device_type].from_config(config, ...)
    ...