def finish(self, *args, **kwargs): if Screens.Standby.inStandby is None and config.plugins.epgrefresh.enablemessage.value: try: Notifications.AddPopup(_("EPG refresh finished."), MessageBox.TYPE_INFO, 4, NOTIFICATIONID) except: pass epgrefreshtimer.cleanup() self.maybeStopAdapter() if not self.check_finish: self.check_finish = True try: self.checkTimer.callback.append(self.checkFinish) self.checkTimer.start(30000, True) self.forcedScan = False print("[EPGRefresh] pause 30 sec...") except: pass else: return self.isrunning = False if config.plugins.epgrefresh.afterevent.value and self.DontShutdown: self.DontShutdown = False self.forcedScan = False print("[EPGRefresh] Return to TV viewing...") return if not self.forcedScan and config.plugins.epgrefresh.afterevent.value and not Screens.Standby.inTryQuitMainloop: self.forcedScan = False print("[EPGRefresh] Shutdown after EPG refresh...") self.session.open(Screens.Standby.TryQuitMainloop, 1) self.forcedScan = False self.DontShutdown = False
def finish(self, *args, **kwargs): if Screens.Standby.inStandby is None and config.plugins.epgrefresh.enablemessage.value: try: Notifications.AddPopup(_("EPG refresh finished."), MessageBox.TYPE_INFO, 4, NOTIFICATIONID) except: pass epgrefreshtimer.cleanup() self.maybeStopAdapter() if not self.check_finish: self.check_finish = True try: self.checkTimer.callback.append(self.checkFinish) self.checkTimer.start(30000, True) self.forcedScan = False print("[EPGRefresh] pause 30 sec...") except: pass else: return self.isrunning = False if config.plugins.epgrefresh.afterevent.value and self.DontShutdown: self.DontShutdown = False self.forcedScan = False print("[EPGRefresh] Return to TV viewing...") return if not self.forcedScan and config.plugins.epgrefresh.afterevent.value and not Screens.Standby.inTryQuitMainloop: self.forcedScan = False print("[EPGRefresh] Shutdown after EPG refresh...") self.session.open( Screens.Standby.TryQuitMainloop, 1 ) self.forcedScan = False self.DontShutdown = False
def finish(self, *args, **kwargs): if self.showPendingServicesMessageShown: self.msg.close() print("[EPGRefresh] Debug: Refresh finished!") if config.plugins.epgrefresh.enablemessage.value: Notifications.AddPopup(_("EPG refresh finished."), MessageBox.TYPE_INFO, 4, ENDNOTIFICATIONID, domain = NOTIFICATIONDOMAIN) epgrefreshtimer.cleanup() self.maybeStopAdapter() if config.plugins.epgrefresh.epgsave.value: Notifications.AddPopup(_("EPG refresh save."), MessageBox.TYPE_INFO, 4, ENDNOTIFICATIONID, domain = NOTIFICATIONDOMAIN) from enigma import eEPGCache myEpg = None myEpg = eEPGCache.getInstance() myEpg.save() # shutdown if we're supposed to go to deepstandby and not recording if not self.forcedScan and config.plugins.epgrefresh.afterevent.value \ and not Screens.Standby.inTryQuitMainloop: self.forcedScan = False if Screens.Standby.inStandby: RecordTimerEntry.TryQuitMainloop() else: Notifications.AddNotificationWithID("Shutdown", Screens.Standby.TryQuitMainloop, 1, domain = NOTIFICATIONDOMAIN) self.forcedScan = False self.isrunning = False self._nextTodo()
def finish(self, *args, **kwargs): if self.showPendingServicesMessageShown: self.msg.close() print("[EPGRefresh] Debug: Refresh finished!") if config.plugins.epgrefresh.enablemessage.value: Notifications.AddPopup(_("EPG refresh finished."), MessageBox.TYPE_INFO, 4, ENDNOTIFICATIONID, domain = NOTIFICATIONDOMAIN) epgrefreshtimer.cleanup() self.maybeStopAdapter() if config.plugins.epgrefresh.epgsave.value: Notifications.AddPopup(_("EPG refresh save."), MessageBox.TYPE_INFO, 4, ENDNOTIFICATIONID, domain = NOTIFICATIONDOMAIN) from enigma import eEPGCache myEpg = None myEpg = eEPGCache.getInstance() myEpg.save() # shutdown if we're supposed to go to standby and not recording # forced scan --> manually started scan / non-forced scan --> automated scan # dontshutdownonabort overrides the shutdown if not self.forcedScan and config.plugins.epgrefresh.afterevent.value \ and not Screens.Standby.inTryQuitMainloop: if (not config.plugins.epgrefresh.dontshutdownonabort.value and self.doStopRunningRefresh) or not self.doStopRunningRefresh: self.forcedScan = False if Screens.Standby.inStandby: RecordTimerEntry.TryQuitMainloop() else: Notifications.AddNotificationWithID("Shutdown", Screens.Standby.TryQuitMainloop, 1, domain = NOTIFICATIONDOMAIN) # reset doStopRunningRefresh here instead of cleanUp as it is needed to avoid shutdown self.doStopRunningRefresh = False self.forcedScan = False self.isrunning = False self._nextTodo()
def finish(self, *args, **kwargs): if not Screens.Standby.inStandby and not config.plugins.epgrefresh.background and config.plugins.epgrefresh.enablemessage.value: Notifications.AddPopup(_("EPG refresh finished."), MessageBox.TYPE_INFO, 4, NOTIFICATIONID) self.forcedScan = False epgrefreshtimer.cleanup() self.maybeStopAdapter() # shutdown if we're supposed to go to deepstandby and not recording if not self.forcedScan and config.plugins.epgrefresh.afterevent.value \ and not Screens.Standby.inTryQuitMainloop: if Screens.Standby.inStandby: self.session.open(Screens.Standby.TryQuitMainloop, 1) else: Notifications.AddNotificationWithID("Shutdown", Screens.Standby.TryQuitMainloop, 1)
def finish(self, *args, **kwargs): print("[EPGRefresh] Debug: Refresh finished!") if config.plugins.epgrefresh.enablemessage.value: Notifications.AddPopup(_("EPG refresh finished."), MessageBox.TYPE_INFO, 4, ENDNOTIFICATIONID, domain = NOTIFICATIONDOMAIN) epgrefreshtimer.cleanup() self.maybeStopAdapter() # shutdown if we're supposed to go to deepstandby and not recording if not self.forcedScan and config.plugins.epgrefresh.afterevent.value \ and not Screens.Standby.inTryQuitMainloop: self.forcedScan = False if Screens.Standby.inStandby: RecordTimerEntry.TryQuitMainloop() else: Notifications.AddNotificationWithID("Shutdown", Screens.Standby.TryQuitMainloop, 1, domain = NOTIFICATIONDOMAIN) self.forcedScan = False self.isrunning = False self._nextTodo()
def cleanUp(self): config.plugins.epgrefresh.lastscan.value = int(time()) config.plugins.epgrefresh.lastscan.save() # Eventually force autotimer to parse epg if config.plugins.epgrefresh.parse_autotimer.value: removeInstance = False try: # Import Instance from Plugins.Extensions.AutoTimer.plugin import autotimer if autotimer is None: removeInstance = True # Create an instance from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer autotimer = AutoTimer() # Parse EPG autotimer.parseEPG() except Exception as e: print("[EPGRefresh] Could not start AutoTimer:", e) finally: # Remove instance if there wasn't one before if removeInstance: autotimer = None # shutdown if we're supposed to go to deepstandby and not recording if not self.forcedScan and config.plugins.epgrefresh.afterevent.value and not Screens.Standby.inTryQuitMainloop: self.session.open(Screens.Standby.TryQuitMainloop, 1) if ( not Screens.Standby.inStandby and not config.plugins.epgrefresh.background and config.plugins.epgrefresh.enablemessage.value ): Notifications.AddPopup(_("EPG refresh finished."), MessageBox.TYPE_INFO, 4, NOTIFICATIONID) self.forcedScan = False epgrefreshtimer.cleanup() self.maybeStopAdapter()
def cleanUp(self): config.plugins.epgrefresh.lastscan.value = int(time()) config.plugins.epgrefresh.lastscan.save() # Eventually force autotimer to parse epg if config.plugins.epgrefresh.parse_autotimer.value: removeInstance = False try: # Import Instance from Plugins.Extensions.AutoTimer.plugin import autotimer if autotimer is None: removeInstance = True # Create an instance from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer autotimer = AutoTimer() # Parse EPG autotimer.parseEPG() except Exception as e: print("[EPGRefresh] Could not start AutoTimer:", e) finally: # Remove instance if there wasn't one before if removeInstance: autotimer = None # shutdown if we're supposed to go to deepstandby and not recording if not self.forcedScan and config.plugins.epgrefresh.afterevent.value \ and not Screens.Standby.inTryQuitMainloop: self.session.open(Screens.Standby.TryQuitMainloop, 1) if not Screens.Standby.inStandby and not config.plugins.epgrefresh.background and config.plugins.epgrefresh.enablemessage.value: Notifications.AddNotification(MessageBox, _("EPG refresh finished."), type=MessageBox.TYPE_INFO, timeout=4) self.forcedScan = False epgrefreshtimer.cleanup() self.maybeStopAdapter()
autotimer.parseEPG() except Exception, e: print "[EPGRefresh] Could not start AutoTimer:", e finally: # Remove instance if there wasn't one before if removeInstance: autotimer = None # shutdown if we're supposed to go to deepstandby and not recording if not self.forcedScan and config.plugins.epgrefresh.afterevent.value \ and not Screens.Standby.inTryQuitMainloop: self.session.open(Screens.Standby.TryQuitMainloop, 1) self.forcedScan = False epgrefreshtimer.cleanup() # Zap back if self.previousService is not None or Screens.Standby.inStandby: self.session.nav.playService(self.previousService) def refresh(self): if self.forcedScan: self.nextService() else: # Abort if a scan finished later than our begin of timespan if self.beginOfTimespan < config.plugins.epgrefresh.lastscan.value: return if config.plugins.epgrefresh.force.value \ or (Screens.Standby.inStandby and \ not self.session.nav.RecordTimer.isRecording()):
def finish(self, *args, **kwargs): if self.showPendingServicesMessageShown: self.msg.close() print("[EPGRefresh] Debug: Refresh finished!") if config.plugins.epgrefresh.enablemessage.value: Notifications.AddPopup(_("EPG refresh finished."), MessageBox.TYPE_INFO, 4, ENDNOTIFICATIONID, domain=NOTIFICATIONDOMAIN) epgrefreshtimer.cleanup() self.maybeStopAdapter() if config.plugins.epgrefresh.epgsave.value: Notifications.AddPopup(_("EPG refresh save."), MessageBox.TYPE_INFO, 4, ENDNOTIFICATIONID, domain=NOTIFICATIONDOMAIN) from enigma import eEPGCache myEpg = None myEpg = eEPGCache.getInstance() myEpg.save() force_auto_shutdown = self.session.nav.wasTimerWakeup() and \ config.plugins.epgrefresh.afterevent.value == "auto" and \ Screens.Standby.inStandby and config.misc.standbyCounter.value == 1 and \ config.misc.prev_wakeup_time.value == config.plugins.epgrefresh.wakeup_time.value if not self.forcedScan: # shutdown if config.plugins.epgrefresh.afterevent.value == "standby" or force_auto_shutdown: if not Screens.Standby.inTryQuitMainloop: if (not config.plugins.epgrefresh.dontshutdownonabort.value and self.doStopRunningRefresh ) or not self.doStopRunningRefresh: self.forcedScan = False if Screens.Standby.inStandby: RecordTimerEntry.TryQuitMainloop() else: Notifications.AddNotificationWithCallback( self.sendTryQuitMainloopNotification, MessageBox, _("EPGRefresh wants to shut down\nyour Dreambox. Shutdown now?" ), timeout=10, domain=NOTIFICATIONDOMAIN) # idle elif config.plugins.epgrefresh.afterevent.value == "idle": if not Screens.Standby.inStandby: Notifications.AddNotificationWithCallback( self.sendStandbyNotification, MessageBox, _("EPGRefresh wants to set your\nDreambox to idle. Do that now?" ), timeout=10, domain=NOTIFICATIONDOMAIN) self.doStopRunningRefresh = False self.forcedScan = False self.isrunning = False self._nextTodo()
if removeInstance: autotimer = None # shutdown if we're supposed to go to deepstandby and not recording if not self.forcedScan and config.plugins.epgrefresh.afterevent.value \ and not Screens.Standby.inTryQuitMainloop: self.session.open( Screens.Standby.TryQuitMainloop, 1 ) if not Screens.Standby.inStandby and not config.plugins.epgrefresh.background and config.plugins.epgrefresh.enablemessage.value: Notifications.AddNotification(MessageBox, _("EPG refresh finished."), type=MessageBox.TYPE_INFO, timeout=4) self.forcedScan = False epgrefreshtimer.cleanup() self.maybeStopAdapter() def refresh(self): if self.forcedScan: self.nextService() else: # Abort if a scan finished later than our begin of timespan if self.beginOfTimespan < config.plugins.epgrefresh.lastscan.value: return if config.plugins.epgrefresh.force.value \ or (Screens.Standby.inStandby and \ not self.session.nav.RecordTimer.isRecording()): self.nextService() # We don't follow our rules here - If the Box is still in Standby and not recording we won't reach this line