Example #1
0
def prevent_sleep():
    if MAC_OS:
        from discjockey import pmset
        pmset.prevent_idle_sleep('Disc Jockey Rip')
    elif WINDOWS:
        import ctypes
        ES_CONTINUOUS = 0x80000000
        ES_SYSTEM_REQUIRED = 0x00000001
        ctypes.windll.kernel32.SetThreadExecutionState(
                ES_CONTINUOUS | ES_SYSTEM_REQUIRED)
Example #2
0
def prevent_sleep():
    if MAC_OS:
        from discjockey import pmset
        pmset.prevent_idle_sleep('Disc Jockey Rip')
Example #3
0
def sleepless():
    if platform.system() == 'Darwin':
        from discjockey import pmset
        pmset.prevent_idle_sleep('Disc Jockey Rip')

    subprocess.call(sys.argv[1:])