Exemple #1
0
 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))
                         })
Exemple #2
0
 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)]
Exemple #3
0
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})