def run(conf_file=None): """Run the screen.""" if not conf_file: parser = argparse.ArgumentParser() parser.add_argument( "--config", action="store", help="Point to a YAML configuration file.", default="/etc/infopanel/infopanel.yaml", ) args = parser.parse_args() conf_file = args.config conf = config.load_config_yaml(conf_file) apply_global_config(conf) disp = display.display_factory(conf) datasrc = data.InputData() infopanel = driver_factory(disp, datasrc, conf) if conf.get("mqtt"): client = mqtt.MQTTClient(datasrc, conf["mqtt"]) client.start() else: client = None try: # infopanel.start() # multiple threads infopanel.run() # main thread finally: if client: client.stop() LOG.info("Quitting.")
def load_test_config(): """Load a pre-packaged test config.""" conf = config.load_config_yaml(os.path.join(TEST_ROOT, "test_config.yaml")) driver.apply_global_config(conf) return conf