def prepare(self): self.title = _("Inital Setup Finished!") self.text = _("Your Dreambox is now fully set up!") if nimmanager.somethingConnected(): self.text = _("Your Dreambox is now fully set up!\nWhat do you want to do?") self._options = [ (self.OPTION_NOTHING, _("Close")), ] if nimmanager.somethingConnected(): self._options = [ (self.OPTION_NOTHING, _("Finish without further actions")), (self.OPTION_SCAN_AUTOMATIC,_("Automatic service scan")), (self.OPTION_SCAN_MANUAL,_("Manual service scan")), ] return True
def __init__(self, session): Screen.__init__(self, session) self["actions"] = ActionMap(["SetupActions", "MenuActions"], { "ok": self.keyGo, "save": self.keyGo, "cancel": self.keyCancel, "menu": self.doCloseRecursive, }, -2) self.session.postScanService = session.nav.getCurrentlyPlayingServiceOrGroup() self.list = [] tlist = [] known_networks = [ ] nims_to_scan = [ ] self.finished_cb = None for nim in nimmanager.nim_slots: # collect networks provided by this tuner need_scan = False networks = self.getNetworksForNim(nim) print "nim %d provides" % nim.slot, networks print "known:", known_networks # we only need to scan on the first tuner which provides a network. # this gives the first tuner for each network priority for scanning. for x in networks: if x not in known_networks: need_scan = True print x, "not in ", known_networks known_networks.append(x) # don't offer to scan nims if nothing is connected if not nimmanager.somethingConnected(nim.slot): need_scan = False if need_scan: nims_to_scan.append(nim) # we save the config elements to use them on keyGo self.nim_enable = [ ] if len(nims_to_scan): self.scan_clearallservices = ConfigSelection(default = "yes", choices = [("no", _("no")), ("yes", _("yes")), ("yes_hold_feeds", _("yes (keep feeds)"))]) self.list.append(getConfigListEntry(_("Clear before scan"), self.scan_clearallservices)) for nim in nims_to_scan: nimconfig = ConfigYesNo(default = True) nimconfig.nim_index = nim.slot self.nim_enable.append(nimconfig) self.list.append(getConfigListEntry(_("Scan ") + nim.slot_name + " (" + nim.friendly_type + ")", nimconfig)) ConfigListScreen.__init__(self, self.list) self["header"] = Label(_("Automatic scan")) self["footer"] = Label(_("Press OK to scan"))
def __init__(self, session): Screen.__init__(self, session) self["actions"] = ActionMap(["SetupActions", "MenuActions"], { "ok": self.keyGo, "cancel": self.keyCancel, "menu": self.closeRecursive, }, -2) self.list = [] tlist = [] known_networks = [ ] nims_to_scan = [ ] self.finished_cb = None for nim in nimmanager.nim_slots: # collect networks provided by this tuner need_scan = False networks = self.getNetworksForNim(nim) print "nim %d provides" % nim.slot, networks print "known:", known_networks # we only need to scan on the first tuner which provides a network. # this gives the first tuner for each network priority for scanning. for x in networks: if x not in known_networks: need_scan = True print x, "not in ", known_networks known_networks.append(x) # don't offer to scan nims if nothing is connected if not nimmanager.somethingConnected(nim.slot): need_scan = False if need_scan: nims_to_scan.append(nim) # we save the config elements to use them on keyGo self.nim_enable = [ ] if len(nims_to_scan): self.scan_clearallservices = ConfigSelection(default = "yes", choices = [("no", _("no")), ("yes", _("yes")), ("yes_hold_feeds", _("yes (keep feeds)"))]) self.list.append(getConfigListEntry(_("Clear before scan"), self.scan_clearallservices)) for nim in nims_to_scan: nimconfig = ConfigYesNo(default = True) nimconfig.nim_index = nim.slot self.nim_enable.append(nimconfig) self.list.append(getConfigListEntry(_("Scan ") + nim.slot_name + " (" + nim.friendly_type + ")", nimconfig)) ConfigListScreen.__init__(self, self.list) self["header"] = Label(_("Automatic Scan")) self["footer"] = Label(_("Press OK to scan"))
def startservicescan(self, postScanService=None, wasinstandby=False): self.wasinstandby = wasinstandby self.postScanService = postScanService tlist = [] known_networks = [] nims_to_scan = [] for nim in nimmanager.nim_slots: # collect networks provided by this tuner need_scan = False networks = self.getNetworksForNim(nim) # we only need to scan on the first tuner which provides a network. # this gives the first tuner for each network priority for scanning. for x in networks: if x not in known_networks: need_scan = True print x, "not in ", known_networks known_networks.append(x) # print "nim %d provides" % nim.slot, networks # print "known:", known_networks # # don't offer to scan nims if nothing is connected if not nimmanager.somethingConnected(nim.slot): need_scan = False if need_scan: nims_to_scan.append(nim) # we save the config elements to use them on keyGo self.nim_enable = [] if len(nims_to_scan): for nim in nims_to_scan: nimconfig = ConfigYesNo(default=True) nimconfig.nim_index = nim.slot self.nim_enable.append(nimconfig) self.scanList = [] self.known_networks = set() self.nim_iter = 0 self.buildTransponderList()
def startservicescan(self, postScanService=None, wasinstandby=False): self.wasinstandby = wasinstandby self.postScanService = postScanService tlist = [] known_networks = [ ] nims_to_scan = [ ] for nim in nimmanager.nim_slots: # collect networks provided by this tuner need_scan = False networks = self.getNetworksForNim(nim) # we only need to scan on the first tuner which provides a network. # this gives the first tuner for each network priority for scanning. for x in networks: if x not in known_networks: need_scan = True print x, "not in ", known_networks known_networks.append(x) # print "nim %d provides" % nim.slot, networks # print "known:", known_networks # # don't offer to scan nims if nothing is connected if not nimmanager.somethingConnected(nim.slot): need_scan = False if need_scan: nims_to_scan.append(nim) # we save the config elements to use them on keyGo self.nim_enable = [ ] if len(nims_to_scan): for nim in nims_to_scan: nimconfig = ConfigYesNo(default = True) nimconfig.nim_index = nim.slot self.nim_enable.append(nimconfig) self.scanList = [] self.known_networks = set() self.nim_iter=0 self.buildTransponderList()
def createConfig(self, currlocation=None, locations=[]): justplay = self.timer.justplay always_zap = self.timer.always_zap zap_wakeup = self.timer.zap_wakeup pipzap = self.timer.pipzap rename_repeat = self.timer.rename_repeat conflict_detection = self.timer.conflict_detection afterevent = { AFTEREVENT.NONE: "nothing", AFTEREVENT.DEEPSTANDBY: "deepstandby", AFTEREVENT.STANDBY: "standby", AFTEREVENT.AUTO: "auto" }[self.timer.afterEvent] if self.timer.record_ecm and self.timer.descramble: recordingtype = "descrambled+ecm" elif self.timer.record_ecm: recordingtype = "scrambled+ecm" elif self.timer.descramble: recordingtype = "normal" weekday_table = ("mon", "tue", "wed", "thu", "fri", "sat", "sun") day = list( [int(x) for x in reversed('{0:07b}'.format(self.timer.repeated))]) weekday = 0 if self.timer.repeated: # repeated type = "repeated" if (self.timer.repeated == 31): # Mon-Fri repeated = "weekdays" elif (self.timer.repeated == 127): # daily repeated = "daily" else: repeated = "user" if day.count(1) == 1: repeated = "weekly" weekday = day.index(1) else: # once type = "once" repeated = None weekday = int(strftime("%u", localtime(self.timer.begin))) - 1 day[weekday] = 1 self.timerentry_fallback = ConfigYesNo( default=self.timer.external_prev or config.usage.remote_fallback_external_timer.value and config.usage. remote_fallback.value and not nimmanager.somethingConnected()) self.timerentry_justplay = ConfigSelection( choices=[("zap", _("zap")), ("record", _("record")), ("zap+record", _("zap and record"))], default={ 0: "record", 1: "zap", 2: "zap+record" }[justplay + 2 * always_zap]) if SystemInfo["DeepstandbySupport"]: shutdownString = _("go to deep standby") choicelist = [("always", _("always")), ("from_standby", _("only from standby")), ("from_deep_standby", _("only from deep standby")), ("never", _("never"))] else: shutdownString = _("shut down") choicelist = [("always", _("always")), ("never", _("never"))] self.timerentry_zapwakeup = ConfigSelection(choices=choicelist, default=zap_wakeup) self.timerentry_afterevent = ConfigSelection(choices=[ ("nothing", _("do nothing")), ("standby", _("go to standby")), ("deepstandby", shutdownString), ("auto", _("auto")) ], default=afterevent) self.timerentry_recordingtype = ConfigSelection(choices=[ ("normal", _("normal")), ("descrambled+ecm", _("descramble and record ecm")), ("scrambled+ecm", _("don't descramble, record ecm")) ], default=recordingtype) self.timerentry_type = ConfigSelection(choices=[("once", _("once")), ("repeated", _("repeated"))], default=type) self.timerentry_name = ConfigText(default=self.timer.name, visible_width=50, fixed_size=False) self.timerentry_description = ConfigText( default=self.timer.description, visible_width=50, fixed_size=False) self.timerentry_tags = self.timer.tags[:] self.timerentry_tagsset = ConfigSelection(choices=[ not self.timerentry_tags and _("None") or " ".join(self.timerentry_tags) ]) self.timerentry_repeated = ConfigSelection( default=repeated, choices=[("weekly", _("weekly")), ("daily", _("daily")), ("weekdays", _("Mon-Fri")), ("user", _("user defined"))]) self.timerentry_renamerepeat = ConfigYesNo(default=rename_repeat) self.timerentry_pipzap = ConfigYesNo(default=pipzap) self.timerentry_conflictdetection = ConfigYesNo( default=conflict_detection) self.timerentry_date = ConfigDateTime( default=self.timer.begin, formatstring=config.usage.date.full.value, increment=86400) self.timerentry_starttime = ConfigClock(default=self.timer.begin) self.timerentry_endtime = ConfigClock(default=self.timer.end) self.timerentry_showendtime = ConfigSelection( default=((self.timer.end - self.timer.begin) > 4), choices=[(True, _("yes")), (False, _("no"))]) default = not self.timer.external_prev and self.timer.dirname or defaultMoviePath( ) tmp = config.movielist.videodirs.value if default not in tmp: tmp.append(default) self.timerentry_dirname = ConfigSelection(default=default, choices=tmp) default = self.timer.external_prev and self.timer.dirname or currlocation if default not in locations: locations.append(default) self.timerentry_fallbackdirname = ConfigSelection(default=default, choices=locations) self.timerentry_repeatedbegindate = ConfigDateTime( default=self.timer.repeatedbegindate, formatstring=config.usage.date.full.value, increment=86400) self.timerentry_weekday = ConfigSelection( default=weekday_table[weekday], choices=[("mon", _("Monday")), ("tue", _("Tuesday")), ("wed", _("Wednesday")), ("thu", _("Thursday")), ("fri", _("Friday")), ("sat", _("Saturday")), ("sun", _("Sunday"))]) self.timerentry_day = ConfigSubList() for x in (0, 1, 2, 3, 4, 5, 6): self.timerentry_day.append(ConfigYesNo(default=day[x])) # FIXME some service-chooser needed here servicename = "N/A" try: # no current service available? servicename = str(self.timer.service_ref.getServiceName()) except: pass self.timerentry_service_ref = self.timer.service_ref self.timerentry_service = ConfigSelection([servicename]) self.createSetup("config")
def FastScanStart(menuid, **kwargs): if menuid == "scan" and nimmanager.somethingConnected(): return [(_("Fast Scan"), FastScanMain, "fastscan", None)] else: return []
def SatfinderStart(menuid, **kwargs): if menuid == "scan" and nimmanager.somethingConnected(): return [(_("Signal finder"), SatfinderMain, "satfinder", None)] else: return []
def createConfig(self): justplay = self.timer.justplay always_zap = self.timer.always_zap zap_wakeup = self.timer.zap_wakeup pipzap = self.timer.pipzap rename_repeat = self.timer.rename_repeat conflict_detection = self.timer.conflict_detection config.movielist.videodirs.load() afterevent = { AFTEREVENT.NONE: "nothing", AFTEREVENT.DEEPSTANDBY: "deepstandby", AFTEREVENT.STANDBY: "standby", AFTEREVENT.AUTO: "auto" }[self.timer.afterEvent] if self.timer.record_ecm and self.timer.descramble: recordingtype = "descrambled+ecm" elif self.timer.record_ecm: recordingtype = "scrambled+ecm" elif self.timer.descramble: recordingtype = "normal" weekday_table = ("mon", "tue", "wed", "thu", "fri", "sat", "sun") day = list([int(x) for x in reversed('{0:07b}'.format(self.timer.repeated))]) weekday = 0 if self.timer.repeated: # repeated type = "repeated" if (self.timer.repeated == 31): # Mon-Fri repeated = "weekdays" elif (self.timer.repeated == 127): # daily repeated = "daily" else: repeated = "user" if day.count(1) == 1: repeated = "weekly" weekday = day.index(1) else: # once type = "once" repeated = None weekday = int(strftime("%u", localtime(self.timer.begin))) - 1 day[weekday] = 1 self.timerentry_fallback = ConfigYesNo(default=self.timer.external_prev or config.usage.remote_fallback_external_timer.value and config.usage.remote_fallback.value and not nimmanager.somethingConnected()) self.timerentry_justplay = ConfigSelection(choices = [ ("zap", _("zap")), ("record", _("record")), ("zap+record", _("zap and record"))], default = {0: "record", 1: "zap", 2: "zap+record"}[justplay + 2*always_zap]) if SystemInfo["DeepstandbySupport"]: shutdownString = _("go to deep standby") choicelist = [("always", _("always")), ("from_standby", _("only from standby")), ("from_deep_standby", _("only from deep standby")), ("never", _("never"))] else: shutdownString = _("shut down") choicelist = [("always", _("always")), ("never", _("never"))] self.timerentry_zapwakeup = ConfigSelection(choices = choicelist, default = zap_wakeup) self.timerentry_afterevent = ConfigSelection(choices = [("nothing", _("do nothing")), ("standby", _("go to standby")), ("deepstandby", shutdownString), ("auto", _("auto"))], default = afterevent) self.timerentry_recordingtype = ConfigSelection(choices = [("normal", _("normal")), ("descrambled+ecm", _("descramble and record ecm")), ("scrambled+ecm", _("don't descramble, record ecm"))], default = recordingtype) self.timerentry_type = ConfigSelection(choices = [("once",_("once")), ("repeated", _("repeated"))], default = type) self.timerentry_name = ConfigText(default = self.timer.name, visible_width = 50, fixed_size = False) self.timerentry_description = ConfigText(default = self.timer.description, visible_width = 50, fixed_size = False) self.timerentry_tags = self.timer.tags[:] self.timerentry_tagsset = ConfigSelection(choices = [not self.timerentry_tags and "None" or " ".join(self.timerentry_tags)]) self.timerentry_repeated = ConfigSelection(default = repeated, choices = [("weekly", _("weekly")), ("daily", _("daily")), ("weekdays", _("Mon-Fri")), ("user", _("user defined"))]) self.timerentry_renamerepeat = ConfigYesNo(default = rename_repeat) self.timerentry_pipzap = ConfigYesNo(default = pipzap) self.timerentry_conflictdetection = ConfigYesNo(default = conflict_detection) self.timerentry_date = ConfigDateTime(default = self.timer.begin, formatstring = _("%d.%B %Y"), increment = 86400) self.timerentry_starttime = ConfigClock(default = self.timer.begin) self.timerentry_endtime = ConfigClock(default = self.timer.end) self.timerentry_showendtime = ConfigSelection(default = ((self.timer.end - self.timer.begin) > 4), choices = [(True, _("yes")), (False, _("no"))]) default = self.timer.dirname or defaultMoviePath() tmp = config.movielist.videodirs.value if default not in tmp: tmp.append(default) self.timerentry_dirname = ConfigSelection(default = default, choices = tmp) self.timerentry_repeatedbegindate = ConfigDateTime(default = self.timer.repeatedbegindate, formatstring = _("%d.%B %Y"), increment = 86400) self.timerentry_weekday = ConfigSelection(default = weekday_table[weekday], choices = [("mon",_("Monday")), ("tue", _("Tuesday")), ("wed",_("Wednesday")), ("thu", _("Thursday")), ("fri", _("Friday")), ("sat", _("Saturday")), ("sun", _("Sunday"))]) self.timerentry_day = ConfigSubList() for x in (0, 1, 2, 3, 4, 5, 6): self.timerentry_day.append(ConfigYesNo(default = day[x])) # FIXME some service-chooser needed here servicename = "N/A" try: # no current service available? servicename = str(self.timer.service_ref.getServiceName()) except: pass self.timerentry_service_ref = self.timer.service_ref self.timerentry_service = ConfigSelection([servicename])