示例#1
0
文件: views.py 项目: hildensia/devviz
 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))
                         })
示例#2
0
文件: views.py 项目: hildensia/devviz
 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)]
示例#3
0
文件: views.py 项目: hildensia/devviz
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})