def keep_awake():
 if (KERNEL32 or sleepless):
  if sabnzbd.cfg.keep_awake():
   awake = False
   if (not sabnzbd.downloader.Downloader.do.paused):
    if ((not PostProcessor.do.empty()) or (not NzbQueue.do.is_empty())):
     awake = True
     if KERNEL32:
      KERNEL32.SetThreadExecutionState(ctypes.c_int(1))
     else:
      sleepless.keep_awake(u'SABnzbd is busy downloading and/or post-processing')
   if ((not awake) and sleepless):
    sleepless.allow_sleep()

def keep_awake ( ) : if ( KERNEL32 or sleepless ) : if sabnzbd . cfg . keep_awake ( ) : awake = False if ( not sabnzbd . downloader . Downloader . do . paused ) : if ( ( not PostProcessor . do . empty ( ) ) or ( not NzbQueue . do . is_empty ( ) ) ) : awake = True if KERNEL32 : KERNEL32 . SetThreadExecutionState ( ctypes . c_int ( 1 ) ) else : sleepless . keep_awake ( u'SABnzbd is busy downloading and/or post-processing' ) if ( ( not awake ) and sleepless ) : sleepless . allow_sleep ( )
if we still have work to do .