def cmd_variable_list(cmd: dict) -> tuple: """ gets a list of dics with variable key and formatted value """ index = cmd['IDX'] last_tick, variables = Variable.get_news(index) ret = {'tick': last_tick, 'variables': variables} return (0, ret)
def thread_timer_loop(): """ TODO """ global CYCLICTIMEHANDLER _variable_tick = 0 while RUN: if Variable.is_new(_variable_tick): _variable_tick, _news = Variable.get_news(_variable_tick) else: _news = {} for func, args in CYCLICTIMEHANDLER: try: func(_news, args) except: pass time.sleep(0.100)