def _load_hotkeymap(): """ Return the specified hotkey mappings. Load from the json file if we have not done that already. """ mappings = Config.load("hotkeymap.json") return mappings["hotkeymap"]
def start(ctrl): """ Start the ZenPlayer web API backend. """ config = Config.load("webserver.json") Logger.info("Webserver: Starting web server ") thread = FlaskThread(ctrl, config) thread.daemon = True thread.start() WebServer._thread = thread
def get_class_data(ctrl): """ Return a list of dictionaries, where each dictionary contains the following keys: "name": The name of the class "instance": A reference to the instantiated instance of this class "methods": A list of public methods of the class exposed for the API """ class_list = Config.load("webserver_classes.json") ret = [] for name in class_list: obj = Loader._get_class(name)(ctrl) ret.append({"name": name, "instance": obj, "methods": Loader._get_public_methods(obj)}) return ret
def _load_keymap(): """ Load the specified key mappings from the json file. """ mappings = Config.load("keymap.json") return mappings["keymap"]
def __init__(self, **kwargs): super().__init__(**kwargs) self._config = Config.load("zenplayer.json") self.init_logging()