Ejemplo n.º 1
0
 def update(self):
     if self.timeout > 0:
         self.timeout -= 1
         self.setInformativeText(_("Shutting in") + " {0}".format(self.timeout))
     else:
         shutdown = Shutdown()
         if shutdown.start_shutting():
             events.trigger_quit()
Ejemplo n.º 2
0
 def update_(self):
     if self.timeout > 0:
         self.timeout -= 1
         self.setInformativeText("{} {}".format(_("Shutting in"), self.timeout))
     else:
         shutdown = Shutdown()
         if shutdown.start_shutting():
             events.quit.emit()
         self.timer.stop()
Ejemplo n.º 3
0
 def update_(self):
     if self.timeout > 0:
         self.timeout -= 1
         self.setInformativeText("{} {}".format(_("Shutting in"),
                                                self.timeout))
     else:
         shutdown = Shutdown()
         if shutdown.start_shutting():
             events.quit.emit()
         self.timer.stop()
Ejemplo n.º 4
0
 def check_timeout(self):
     if self.cancel:
         return False
     elif self.timeout > 0:
         self.timeout -= 1
         self.label.set_text(_("Shutting in") + " {0}".format(self.timeout))
         return True
     else:
         shutdown = Shutdown()
         if shutdown.start_shutting():
             #self.quit()
             events.trigger_quit()
         return False
Ejemplo n.º 5
0
 def check_timeout(self):
     if self.cancel:
         return False
     elif self.timeout > 0:
         self.timeout -= 1
         self.label.set_text(_("Shutting in") + " {0}".format(self.timeout))
         return True
     else:
         shutdown = Shutdown()
         if shutdown.start_shutting():
             #self.quit()
             events.trigger_quit()
         return False
Ejemplo n.º 6
0
    async def __prepare_for_shutdown(self, timeout=10):
        try:
            while self.__stop is False:
                self.__log.info("Shutdown countdown {}".format(timeout))
                await asyncio.sleep(1)

                if timeout == 0:
                    self.__log.info("Shutting down")
                    sh = Shutdown()
                    sh.start()
                    break
                timeout -= 1
        except asyncio.CancelledError:
            self.__log.info("Shutdown Cancelled")
Ejemplo n.º 7
0
        if ialtar["enabled"]:
            if ialtar['image']:
                ThreadMgr().start(ImageHandler())
            hasPhrase = ialtar['phrase']
            if ialtar['player']:
                ThreadMgr().start(iAltar())

        music = Hosts().getLocalAttr('music')
        if music['enabled']:
            SoundTrackManager(soundDir).changeNumSoundThreads(
                specs['numMusicThreads'])
            if music['player']:
                ThreadMgr().start(MusicPlayer())

        if Hosts().getLocalAttr('hasPowerCheck'):
            ThreadMgr().start(Shutdown())

        gardenExit = 6

        recog = Hosts().getLocalAttr('recog')
        if recog['enabled']:
            hasPhrase = recog['phrase'] != ""
            if recog['engine']:
                from recogHandler import RecogHandler
                ThreadMgr().start(RecogHandler())

        if hasPhrase:
            phr = Hosts().getLocalAttr("phrase")

            if phr["enabled"]:
                ThreadMgr().start(PhraseHandler())