示例#1
0
 def run(self):
     if DEBUG:
         while True:
             time.sleep(3)
             print("From Task::run() hola")
     else:
         from nuxhash.daemon import main
         main()
示例#2
0
def main3():
    while True:
        tz = TimeZones()
        if tz.isWhite():
            break
        time.sleep(97)
    TimeTask().start()
    if DEBUG:
        while True:
            time.sleep(3)
            print("From main3() hola")
    else:
        from nuxhash.daemon import main
        main()
示例#3
0
def nuxhash_gui():
    from nuxhash.gui.main import main
    main()
示例#4
0
def mata():
    from nuxhash.daemon import main
    main()
示例#5
0
def nuxhashd():
    from nuxhash.daemon import main
    main()
示例#6
0
                wait_secs = 1
                cnt += 1
            else:
                wait_secs = 23
            logging.debug(
                'Quiet: %s, hour: %d, last_quiet: %s, wait_secs: %d, event: %s, cnt: %d',
                str(quiet), dt_now.hour, str(last_quiet), wait_secs,
                str(bEvent), cnt)
        except Exception as e:
            logging.error("sched_onoff(who)->Exception: %s", str(e))
            quiet = False
        #if procs.not_all() and ((dt_now.hour >= 23 or dt_now.hour < 7) or (quiet and (dt_now.hour >= inith or dt_now.hour < 8 or dt_now.weekday() > 4))):
        # if procs.not_all() and quiet and (dt_now.hour >= inith or dt_now.hour < 8 or dt_now.weekday() > 4):
        if procs.not_all() and ((dt_now.hour > 0 and dt_now.hour < 5) or
                                (quiet and
                                 (dt_now.hour >= inith or dt_now.hour < 8
                                  or dt_now.weekday() > 4))):
            logging.info('sched_onoff: starting processes')
            procs.start()
        # elif procs.some() and not quiet: # and (dt_now.hour > 6 and dt_now.hour < 23):
        elif procs.some() and not quiet and (dt_now.hour > 4
                                             or dt_now.hour < 1):
            logging.info('sched_onoff: about to stop processes')
            procs.stop()
            logging.info('ched_onoff: terminating processes')
        bEvent = listen_who(wait_secs)


if __name__ == '__main__':
    main()