def playService(self, service): Notifications.RemovePopup("ZapPipError") if service is None: return False ref = self.resolveAlternatePipService(service) if ref: if SystemInfo["CanNotDoSimultaneousTranscodeAndPIP"] and StreamServiceList: self.pipservice = None self.currentService = None self.currentServiceReference = None if not config.usage.hide_zap_errors.value: Notifications.AddPopup(text="PiP...\n" + _("Connected transcoding, limit - no PiP!"), type=MessageBox.TYPE_ERROR, timeout=5, id="ZapPipError") return False if self.isPlayableForPipService(ref): print "playing pip service", ref and ref.toString() else: if not config.usage.hide_zap_errors.value: Notifications.AddPopup(text="PiP...\n" + _("No free tuner!"), type=MessageBox.TYPE_ERROR, timeout=5, id="ZapPipError") return False self.pipservice = eServiceCenter.getInstance().play(ref) if self.pipservice and not self.pipservice.setTarget(1, True): if hasattr(self, "dishpipActive") and self.dishpipActive is not None: self.dishpipActive.startPiPService(ref) self.pipservice.start() self.currentService = service self.currentServiceReference = ref return True else: self.pipservice = None self.currentService = None self.currentServiceReference = None if not config.usage.hide_zap_errors.value: Notifications.AddPopup(text=_("Incorrect service type for Picture in Picture!"), type=MessageBox.TYPE_ERROR, timeout=5, id="ZapPipError") return False
def isServicePlayable(self, ref, callback, session=None): if not config.ParentalControl.configured.value or not config.ParentalControl.servicepinactive.value: return True #Check if configuration has already been read or if the significant values have changed. #If true: read the configuration if self.configInitialized == False or self.storeServicePin != config.ParentalControl.storeservicepin.value: self.getConfigValues() service = ref.toCompareString() if (config.ParentalControl.type.value == LIST_WHITELIST and not self.whitelist.has_key(service)) or (config.ParentalControl.type.value == LIST_BLACKLIST and self.blacklist.has_key(service)): #Check if the session pin is cached if self.sessionPinCached == True: return True self.callback = callback #Someone started to implement different levels of protection. Seems they were never completed #I did not throw out this code, although it is of no use at the moment levelNeeded = 0 if self.serviceLevel.has_key(service): levelNeeded = self.serviceLevel[service] pinList = self.getPinList()[:levelNeeded + 1] if not session: Notifications.AddNotificationParentalControl(boundFunction(self.servicePinEntered, ref), PinInput, triesEntry = config.ParentalControl.retries.servicepin, pinList = pinList, service = ServiceReference(ref).getServiceName(), title = _("this service is protected by a parental control pin"), windowTitle = _("Parental control")) else: Notifications.RemovePopup("Parental control") if self.PinDlg: self.PinDlg.close() self.PinDlg = session.openWithCallback(boundFunction(self.servicePinEntered, ref), PinInput, triesEntry = config.ParentalControl.retries.servicepin, pinList = pinList, service = ServiceReference(ref).getServiceName(), title = _("this service is protected by a parental control pin"), windowTitle = _("Parental control")) return False else: return True
def isServicePlayable(self, ref, callback, session=None): self.session = session if self.isProtected(ref): if self.sessionPinCached: return True self.callback = callback service = ref.toCompareString() title = 'FROM BOUQUET "userbouquet.' in service and _( "this bouquet is protected by a parental control pin") or _( "this service is protected by a parental control pin") if session: Notifications.RemovePopup("Parental control") if self.PinDlg: self.PinDlg.close() self.PinDlg = session.openWithCallback( boundFunction(self.servicePinEntered, ref), PinInput, triesEntry=config.ParentalControl.retries.servicepin, pinList=self.getPinList(), service=ServiceReference(ref).getServiceName(), title=title, windowTitle=_("Parental control"), simple=False) else: Notifications.AddNotificationParentalControl( boundFunction(self.servicePinEntered, ref), PinInput, triesEntry=config.ParentalControl.retries.servicepin, pinList=self.getPinList(), service=ServiceReference(ref).getServiceName(), title=title, windowTitle=_("Parental control")) return False else: return True
def nextService(self): print("[EPGRefresh] Maybe zap to next service") try: service = self.scanServices.pop(0) except IndexError: print("[EPGRefresh] Done refreshing EPG") self.cleanUp() else: Notifications.RemovePopup("Parental control") if self.isServiceProtected(service): skipProtectedServices = config.plugins.epgrefresh.skipProtectedServices.value adapter = config.plugins.epgrefresh.adapter.value if (not self.forcedScan ) or skipProtectedServices == "always" or ( self.forcedScan and Screens.Standby.inStandby is None and skipProtectedServices == "bg_only" and (adapter == "pip" or adapter == "main")): print("[EPGRefresh] Service is protected, skipping!") self.refresh() return if (not self.refreshAdapter.backgroundCapable and Screens.Standby.inStandby): print( "[EPGRefresh] Adapter is not able to run in background or not available, falling back to MainPictureAdapter" ) self.maybeStopAdapter() self.refreshAdapter = MainPictureAdapter(self.session) self.refreshAdapter.prepare() self.refreshAdapter.play(eServiceReference(service.sref)) delay = service.duration or config.plugins.epgrefresh.interval_seconds.value if not delay: delay = 20 if not self.wait.isActive(): self.wait.start(int(delay * 1000), True)
def isServicePlayable(self, ref, callback, session=None): self.session = session if not config.ParentalControl.servicepinactive.value: return True #Check if configuration has already been read or if the significant values have changed. #If true: read the configuration if self.storeServicePin != config.ParentalControl.storeservicepin.value: self.getConfigValues() service = ref.toCompareString() info = eServiceCenter.getInstance().info(ref) age = 0 if service.startswith("1:") and service.rsplit(":", 1)[1].startswith("/"): refstr = info and info.getInfoString(ref, iServiceInformation.sServiceref) service = refstr and eServiceReference(refstr).toCompareString() elif int(config.ParentalControl.age.value): event = info and info.getEvent(ref) rating = event and event.getParentalData() age = rating and rating.getRating() age = age and age <= 15 and age + 3 or 0 if (age and age >= int(config.ParentalControl.age.value)) or service and self.blacklist.has_key(service): #Check if the session pin is cached if self.sessionPinCached: return True self.callback = callback title = 'FROM BOUQUET "userbouquet.' in service and _("this bouquet is protected by a parental control pin") or _("this service is protected by a parental control pin") if session: Notifications.RemovePopup("Parental control") if self.PinDlg: self.PinDlg.close() self.PinDlg = session.openWithCallback(boundFunction(self.servicePinEntered, ref), PinInput, triesEntry=config.ParentalControl.retries.servicepin, pinList=self.getPinList(), service=ServiceReference(ref).getServiceName(), title=title, windowTitle=_("Parental control"), simple=False) else: Notifications.AddNotificationParentalControl(boundFunction(self.servicePinEntered, ref), PinInput, triesEntry=config.ParentalControl.retries.servicepin, pinList=self.getPinList(), service=ServiceReference(ref).getServiceName(), title=title, windowTitle=_("Parental control")) return False else: return True
def lineReceived(self, line): #15.07.06 00:38:54;CALL;1;4;<provider>;<callee>; #15.07.06 00:38:58;DISCONNECT;1;0; #15.07.06 00:39:22;RING;0;<caller>;<outgoing msn>; #15.07.06 00:39:27;DISCONNECT;0;0; a = line.split(';') (date, event) = a[0:2] line = a[2] if event == "RING": phone = a[4] number = a[3] text = _("incoming call!\n%s calls on %s!") % (number, phone) timeout = 10 elif event == "DISCONNECT": Notifications.RemovePopup("FritzCall_%s" % line) return else: return Notifications.AddPopup(text=text, type=MessageBox.TYPE_INFO, timeout=timeout, id="FritzCall_%s" % line)
def __onClose(self): global inStandby inStandby = None if self.prev_running_service: self.session.nav.playService(self.prev_running_service) elif self.paused_service: self.paused_service.unPauseService() self.session.screen["Standby"].boolean = False globalActionMap.setEnabled(True) print "goto deep1" Notifications.RemovePopup(id="RecordTimerQuitMainloop")
def zapTo(self): if self.zapFunc and self.key_red_choice == self.ZAP: ref = self["list"].getCurrent()[1] if ref: currentref = self.session.nav.getCurrentlyPlayingServiceOrGroup( ) self.zapFunc(ref.ref) if currentref and currentref == ref.ref: Notifications.RemovePopup("Parental control") config.misc.graph_mepg.save() self.close(True)
def __onClose(self): global inStandby inStandby = None if self.prev_running_service: self.session.nav.playService(self.prev_running_service) elif self.paused_service: self.paused_service.unPauseService() elif self.prev_running_service: service = self.prev_running_service.toString() if config.servicelist.startupservice_onstandby.value: self.session.nav.playService(eServiceReference(config.servicelist.startupservice.value)) from Screens.InfoBar import InfoBar InfoBar.instance and InfoBar.instance.servicelist.correctChannelNumber() else: self.session.nav.playService(self.prev_running_service) self.session.screen["Standby"].boolean = False globalActionMap.setEnabled(True) print ("goto deep1") Notifications.RemovePopup(id = "RecordTimerQuitMainloop")
def gotoDeepStandby(self, answer): if answer: if config.plugins.serienRec.afterAutocheck.value == "2": if not NavigationInstance.instance.RecordTimer.isRecording(): for each in self.messageList: Notifications.RemovePopup(each[3]) print "[SerienRecorder] gehe in Deep-Standby" SRLogger.writeLog("gehe in Deep-Standby") if Screens.Standby.inStandby: from RecordTimer import RecordTimerEntry RecordTimerEntry.TryQuitMainloop() else: Notifications.AddNotificationWithID("Shutdown", Screens.Standby.TryQuitMainloop, 1) else: print "[SerienRecorder] Eine laufende Aufnahme verhindert den Deep-Standby" SRLogger.writeLog("Eine laufende Aufnahme verhindert den Deep-Standby") else: print "[SerienRecorder] gehe in Standby" SRLogger.writeLog("gehe in Standby") Notifications.AddNotification(Screens.Standby.Standby)
def __seekToPosition(self): if getPlayPositionInSeconds(self.session) is None: self.__timer.start(500, True) else: Notifications.RemovePopup(self.RESUME_POPUP_ID) self.doSeek(int(self.__position))
def isServicePlayable(self, ref, callback, session=None): self.session = session if not config.ParentalControl.configured.value or not config.ParentalControl.servicepinactive.value: return True #Check if configuration has already been read or if the significant values have changed. #If true: read the configuration if self.configInitialized == False or self.storeServicePin != config.ParentalControl.storeservicepin.value: self.getConfigValues() service = ref.toCompareString() info = eServiceCenter.getInstance().info(ref) age = 0 if service.startswith("1:") and service.rsplit(":", 1)[1].startswith("/"): refstr = info and info.getInfoString( ref, iServiceInformation.sServiceref) service = refstr and eServiceReference(refstr).toCompareString() else: event = info and info.getEvent(ref) rating = event and event.getParentalData() age = rating and rating.getRating() + 3 or 0 if (age and age >= int(config.ParentalControl.age.value)) or service and ( (config.ParentalControl.type.value == LIST_WHITELIST and not self.whitelist.has_key(service)) or (config.ParentalControl.type.value == LIST_BLACKLIST and self.blacklist.has_key(service))): #Check if the session pin is cached if self.sessionPinCached == True: return True self.callback = callback #Someone started to implement different levels of protection. Seems they were never completed #I did not throw out this code, although it is of no use at the moment levelNeeded = 0 if self.serviceLevel.has_key(service): levelNeeded = self.serviceLevel[service] pinList = self.getPinList()[:levelNeeded + 1] title = 'FROM BOUQUET "userbouquet.' in service and _( "this bouquet is protected by a parental control pin") or _( "this service is protected by a parental control pin") if session: Notifications.RemovePopup("Parental control") if self.PinDlg: self.PinDlg.close() self.PinDlg = session.openWithCallback( boundFunction(self.servicePinEntered, ref), PinInput, triesEntry=config.ParentalControl.retries.servicepin, pinList=pinList, service=ServiceReference(ref).getServiceName(), title=title, windowTitle=_("Parental control"), simple=False) else: Notifications.AddNotificationParentalControl( boundFunction(self.servicePinEntered, ref), PinInput, triesEntry=config.ParentalControl.retries.servicepin, pinList=pinList, service=ServiceReference(ref).getServiceName(), title=title, windowTitle=_("Parental control")) return False else: return True