def get(self, viewid, var): if var is None: view = data_handler.get_view(viewid) return jsonify({'variables': view.variables}) else: return jsonify({'variables': Variable(var, data_handler.get_type(var), data_handler.get_value(var)) })
def variables(self): return [Variable(var, data_handler.get_type(var), data_handler.get_value(var)) for var in data_handler.get_view_vars(self.viewid)]
def data_stream(viewid): while True: time.sleep(.1) for var in data_handler.get_view_vars(viewid): yield json.dumps({"value": data_handler.get_value(var), "var": var})