def loadtext(start): print(text) console("tput civis") if etime == True: while funcvalue == None: stdout.write(f"\rTime Elapsed: {round(time()-start, 3)} seconds") stdout.flush() console("tput cnorm")
def mute(): global mute mute = not mute if mute: console(f'{ctrl} mutesysvolume 1') else: console(f'{ctrl} mutesysvolume 0') return "OK"
def mon(state): if state == 'off': console(f'{ctrl} monitor async_off') return "OK" elif state == 'on': console(f'{ctrl} sendkey ctrl press') return "OK" else: return "Invalid value"
def wrapper(*args, **kwargs): global funcvalue funcvalue = None que = Queue() funcThread = Thread(target=lambda q, arg1: q.put(function(arg1)), args=(que, *args)) starttime = time() textThread = Thread(target=loadtext, args=(starttime,)) funcThread.start() textThread.start() funcThread.join() funcvalue = que.get() textThread.join() console("cls") return funcvalue
def m_key(value): console(f'{ctrl} sendkey ' + value + ' press') return "OK"
def set_volume(value): value = int(value) val = str(int(65535 / 100 * value)) console(f'{ctrl} setsysvolume ' + val) return get_vol()
def brightness(value): console(f'{ctrl} setbrightness ' + value) return "OK"
def clear(): console('cls' if name == "nt" else "clear")