def _push_configs(self):
"""
Get the current configurations as well as the validation status,
then push to the client to updates the configurations form.
"""
data = self.configs.dump(flatten=True)
data["userconfig"] = self.configs.userconfig
__, errors = self.configs.check_all(raise_exception=False)
msg = {"success": True,
"type": "configs",
"action": "push",
"data": data,
"errors": errors}
message = json_encode(msg)
logger.debug("Message of current configurations: {0}".format(message))
self.write_message(message)
logger.info("WebSocket: Pushed current configurations data " +
"with validation errors to the client")
评论列表
文章目录