Пример #1
0
 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")
Пример #2
0
def mute():
    global mute
    mute = not mute
    if mute:
        console(f'{ctrl} mutesysvolume 1')
    else:
        console(f'{ctrl} mutesysvolume 0')
    return "OK"
Пример #3
0
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"
Пример #4
0
 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
Пример #5
0
def m_key(value):
    console(f'{ctrl} sendkey ' + value + ' press')
    return "OK"
Пример #6
0
def set_volume(value):
    value = int(value)
    val = str(int(65535 / 100 * value))
    console(f'{ctrl} setsysvolume ' + val)
    return get_vol()
Пример #7
0
def brightness(value):
    console(f'{ctrl} setbrightness ' + value)
    return "OK"
Пример #8
0
def clear():
    console('cls' if name == "nt" else "clear")