def main(): os.environ['SDL_VIDEODRIVER'] = 'dummy' if '--debug' in sys.argv: logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger() settings.from_files(cfg='yaml', verbose=True) settings.from_args(sys.argv[1:]) if settings.prometheus: start_http_server(settings.prometheus_port) b = Board(settings) http = HTTPThread(b, settings) http.start() for file in get_files(settings.yaml_directory, 'yaml'): sound_set = SoundSet.from_yaml(file, settings=settings) b.register_sound_set(sound_set) joystick = Joystick(settings.device_path, backend=settings.input_type, mapping=settings.physical_mapping, offset=settings.scancode_offset) b.register_joystick(joystick) http_joystick = Joystick(http.queue, backend='queue') b.register_joystick(http_joystick) b.run()
def main(): logger = logging.getLogger() settings.from_args(sys.argv[1:]) if settings.debug: logger.setLevel(logging.DEBUG) os.environ['SDL_VIDEODRIVER'] = 'dummy' b = Board() for file in get_files(settings.yaml_directory, 'yaml'): sound_set = SoundSet.from_yaml(file, settings=settings) b.register_sound_set(sound_set) joystick = Joystick(settings.device_path, backend=settings.input_type, mapping=settings.physical_mapping, offset=settings.scancode_offset) b.register_joystick(joystick) b.run()
def test_1(): s = SoundSet(test_config) assert len(s.sounds) == 3 assert all(isinstance(s, SoundInterface) for s in s.sounds.values())