def _decorator(*args, **kwargs): if driveboard.connected(): return func(*args, **kwargs) else: bottle.abort(400, "No machine.")
def _decorator(*args, **kwargs): if driveboard.connected(): return func(*args, **kwargs) else: bottle.abort(400, "No machine.")
def status(): global time_status_last if not driveboard.connected() and (time.time() - time_status_last) > 6.0: driveboard.connect_withfind(verbose=False) time_status_last = time.time() return json.dumps(driveboard.status())
def status(): global time_status_last if not driveboard.connected() and (time.time()-time_status_last) > 6.0: driveboard.connect_withfind(verbose=False) time_status_last = time.time() return json.dumps(driveboard.status())