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()
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()
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
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")
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())