def __init__(self, session, filterEntry, add_edit):
		Screen.__init__(self, session)

		try:
			self.skinName = "AutoTimerFilterEditor"
			self.onChangedEntry = []
			self.add_edit = add_edit
			if filterEntry is not None:
				self.EntryDate  = NoSave(ConfigDateTime(filterEntry[2], _("%d.%B %Y"), increment = 86400))
				self.EntryTime  = NoSave(ConfigClock(default = filterEntry[2]))
				self.EntryTitle = NoSave(ConfigText(default = filterEntry[1], fixed_size = False))
			else:
				self.EntryDate  = NoSave(ConfigDateTime(time.time(), _("%d.%B %Y"), increment = 86400))
				self.EntryTime  = NoSave(ConfigClock(default = time.time()))
				self.EntryTitle = NoSave(ConfigText(default = "", fixed_size = False))
			self.list = [
				getConfigListEntry(_("Date"), self.EntryDate),
				getConfigListEntry(_("Time"), self.EntryTime),
				getConfigListEntry(_("Title"), self.EntryTitle),
			]
			ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changed)
			self["key_red"] = StaticText(_("Cancel"))
			self["key_green"] = StaticText(_("Save"))
			self["actions"] = ActionMap(["SetupActions", "ColorActions"],
				{
					"cancel": self.cancel,
					"save": self.save,
				}
			)
			# Trigger change
			self.changed()
			self.onLayoutFinish.append(self.setCustomTitle)
		except Exception:
			import traceback
			traceback.print_exc()
예제 #2
0
def TimeSpanEntryInit():
	now = localtime()
	begin = mktime((now.tm_year, now.tm_mon, now.tm_mday, 8, 00, 0, now.tm_wday, now.tm_yday, now.tm_isdst))
	end = mktime((now.tm_year, now.tm_mon, now.tm_mday, 16, 00, 0, now.tm_wday, now.tm_yday, now.tm_isdst))

	config.plugins.AdvHdmiCec.Entries.append(ConfigSubsection())
	i = len(config.plugins.AdvHdmiCec.Entries) - 1
	config.plugins.AdvHdmiCec.Entries[i].fromWD = ConfigSelection(choices=[
		("0", WEEKDAYS[0]),
		("1", WEEKDAYS[1]),
		("2", WEEKDAYS[2]),
		("3", WEEKDAYS[3]),
		("4", WEEKDAYS[4]),
		("5", WEEKDAYS[5]),
		("6", WEEKDAYS[6]),
	], default="0")
	config.plugins.AdvHdmiCec.Entries[i].toWD = ConfigSelection(choices=[
		("0", WEEKDAYS[0]),
		("1", WEEKDAYS[1]),
		("2", WEEKDAYS[2]),
		("3", WEEKDAYS[3]),
		("4", WEEKDAYS[4]),
		("5", WEEKDAYS[5]),
		("6", WEEKDAYS[6]),
	], default="6")
	config.plugins.AdvHdmiCec.Entries[i].begin = ConfigClock(default=int(begin))
	config.plugins.AdvHdmiCec.Entries[i].end = ConfigClock(default=int(end))
	return config.plugins.AdvHdmiCec.Entries[i]
예제 #3
0
	def IPTVstartInstantRecording(self, limitEvent = True):
		import RecordDateInput
		begin = int(time())
		end = begin + 3600

		self.starttime=ConfigClock(default = begin)
		self.endtime=ConfigClock(default = end)

		dlg = self.session.openWithCallback(self.RecordDateInputClosed, RecordDateInput.RecordDateInput, self.starttime, self.endtime)
		dlg.setTitle(_("Please enter recording time"))
예제 #4
0
	def createConfig(self):
		# calculate default values
		day = []
		weekday = 0
		for x in (0, 1, 2, 3, 4, 5, 6):
			day.append(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:
				flags = self.timer.repeated
				repeated = "user"
				count = 0
				for x in (0, 1, 2, 3, 4, 5, 6):
					if flags == 1: # weekly
# 						print "[TimerEntryBase] Set to weekday " + str(x)
						weekday = x
					if flags & 1 == 1: # set user defined flags
						day[x] = 1
						count += 1
					else:
						day[x] = 0
					flags >>= 1
				if count == 1:
					repeated = "weekly"
		else: # once
			type = "once"
			repeated = None
			weekday = int(strftime("%u", localtime(self.timer.begin))) - 1
			day[weekday] = 1

		self.timerentry_type = ConfigSelection(choices=[("once", _("once")), ("repeated", _("repeated"))], default=type)
		self.timerentry_repeated = ConfigSelection(default=repeated, choices=[("weekly", _("weekly")), ("daily", _("daily")), ("weekdays", _("Mon-Fri")), ("user", _("user defined"))])

		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_repeatedbegindate = ConfigDateTime(default=self.timer.repeatedbegindate, formatstring=config.usage.date.full.value, increment=86400)

		choices = [("mon", _("Monday")), ("tue", _("Tuesday")), ("wed", _("Wednesday")), ("thu", _("Thursday")), ("fri", _("Friday")), ("sat", _("Saturday")), ("sun", _("Sunday"))]
		self.timerentry_weekday = ConfigSelection(default=choices[weekday][0], choices=choices)

		self.timerentry_day = ConfigSubList()
		for x in (0, 1, 2, 3, 4, 5, 6):
			self.timerentry_day.append(ConfigYesNo(default=day[x]))
예제 #5
0
    def IPTVstartInstantRecording(self, limitEvent=True):
        from . import record
        begin = int(time())
        end = begin + 3600

        if glob.currentepglist[glob.currentchannelistindex][3]:
            name = glob.currentepglist[glob.currentchannelistindex][3]
        else:
            name = glob.currentchannelist[glob.currentchannelistindex][0]

        self.name = NoSave(ConfigText(default=name, fixed_size=False))
        self.date = time()
        self.starttime = NoSave(ConfigClock(default=begin))
        self.endtime = NoSave(ConfigClock(default=end))
        self.session.openWithCallback(self.RecordDateInputClosed, record.RecordDateInput, self.name, self.date, self.starttime, self.endtime, True)
예제 #6
0
	def enterDateTime(self):
		if not EPGSelectionBase.lastEnteredTime:
			# The stored date and time is shared by all EPG types.
			EPGSelectionBase.lastEnteredTime = ConfigClock(default=time())
			EPGSelectionBase.lastEnteredDate = ConfigDateTime(default=time(), formatstring=config.usage.date.full.value, increment=86400)
		dti = self.session.openWithCallback(self.onDateTimeInputClosed, TimeDateInput, EPGSelectionBase.lastEnteredTime, EPGSelectionBase.lastEnteredDate)
		dti.setTitle(_("Advance EPG to the following date and time"))
예제 #7
0
	def enterDateTime(self):
		if self.type == EPG_TYPE_MULTI:
			global mepg_config_initialized
			if not mepg_config_initialized:
				config.misc.prev_mepg_time=ConfigClock(default = time())
				mepg_config_initialized = True
			self.session.openWithCallback(self.onDateTimeInputClosed, TimeDateInput, config.misc.prev_mepg_time )
예제 #8
0
	def enterDateTime(self):
		if self.type == EPG_TYPE_MULTI:
			global mepg_config_initialized
			if not mepg_config_initialized:
				config.misc.prev_mepg_time=ConfigClock(default = time())
				mepg_config_initialized = True
			self.session.openWithCallback(self.onDateTimeInputClosed, TimeDateInput, config.misc.prev_mepg_time )
		elif self.type == EPG_TYPE_SINGLE:
			if not isinstance(self, OutdatedEPGSelection) and config.misc.epgcache_outdated_timespan.value:
				self.session.open(OutdatedEPGSelection, self.currentService.ref)
	def makeList(self):
		self.list = []

		if getImageDistro() != "openvix":
			device_default = None
			i = 0
			for mountpoint in self.mountpoint:
				if mountpoint == self.config.db_root:
					device_default = self.mountdescription[i]
				i += 1

			## default device is really important... if miss a default we force it on first entry and update now the main config
			if device_default == None:
				self.config.db_root = self.mountpoint[0]
				device_default = self.mountdescription[0]

		lamedb_default = _("main lamedb")
		if self.config.lamedb != "lamedb":
			lamedb_default = self.config.lamedb.replace("lamedb.", "").replace(".", " ")

		scheduled_default = None
		if self.config.download_standby_enabled:
			scheduled_default = _("every hour (only in standby)")
		elif self.config.download_daily_enabled:
			scheduled_default = _("once a day")
		else:
			scheduled_default = _("disabled")

		if getImageDistro() != "openvix":
			self.list.append((_("Storage device"), ConfigSelection(self.mountdescription, device_default)))
		if len(self.lamedbs_desc) > 1:
			self.list.append((_("Preferred lamedb"), ConfigSelection(self.lamedbs_desc, lamedb_default)))

		self.list.append((_("Enable csv import"), ConfigYesNo(self.config.csv_import_enabled > 0)))
		if getImageDistro() != "openvix":
			self.list.append((_("Force epg reload on boot"), ConfigYesNo(self.config.force_load_on_boot > 0)))
		self.list.append((_("Scheduled download"), ConfigSelection(self.automatictype, scheduled_default)))

		if self.config.download_daily_enabled:
			ttime = localtime()
			ltime = (ttime[0], ttime[1], ttime[2], self.config.download_daily_hours, self.config.download_daily_minutes, ttime[5], ttime[6], ttime[7], ttime[8])
			self.list.append((_("Scheduled download at"), ConfigClock(mktime(ltime))))

		if not self.fastpatch:
			self.list.append((_("Reboot after a scheduled download"), ConfigYesNo(self.config.download_daily_reboot > 0)))
			self.list.append((_("Reboot after a manual download"), ConfigYesNo(self.config.download_manual_reboot > 0)))
		self.list.append((_("Show as plugin"), ConfigYesNo(self.config.show_plugin > 0)))
		self.list.append((_("Show as extension"), ConfigYesNo(self.config.show_extension > 0)))
		if getImageDistro() != "openvix":
			self.list.append((_("Show 'Force reload' as plugin"), ConfigYesNo(self.config.show_force_reload_as_plugin > 0)))

		self["config"].list = self.list
		self["config"].setList(self.list)
		self.setInfo()
	def createConfig(self, conf_date, conf_time):
		self.save_mask = 0
		if conf_time:
			self.save_mask |= 1
		else:
			conf_time = ConfigClock(default = time.time()),
		if conf_date:
			self.save_mask |= 2
		else:
			conf_date = ConfigDateTime(default = time.time(), formatstring = _("%d.%B %Y"), increment = 86400)
		self.timeinput_date = conf_date
		self.timeinput_time = conf_time
예제 #11
0
def menuCallbackAutoTimer(self, ret):
    ret = ret and ret[1]
    if ret:
        if ret == "add":
            from AutoTimerEditor import addAutotimerFromEvent
            cur = self["list"].getCurrent()
            evt = cur[0]
            sref = cur[1]
            if not evt:
                return
            try:
                addAutotimerFromEvent(self.session, evt=evt, service=sref)
            except:
                pass
        elif ret == "preview":
            from AutoTimerPreview import AutoTimerPreview
            try:
                if not autotimer.getStatusParseEPGrunning():
                    total, new, modified, timers, conflicts, similars = autotimer.parseEPG(
                        simulateOnly=True)
                    self.session.open(AutoTimerPreview, timers)
            except:
                pass
        elif ret == "search":
            try:
                if not autotimer.getStatusParseEPGrunning():
                    editCallback(self.session)
            except:
                pass
        elif ret == "timerlist":
            try:
                from Screens.TimerEdit import TimerEditList
                self.session.open(TimerEditList)
            except:
                pass
        elif ret == "openplugin":
            try:
                main(self.session)
            except:
                pass
        elif ret == "input":
            try:
                from time import time as my_time
                global mepg_config_initialized
                if not mepg_config_initialized:
                    config.misc.prev_mepg_time = ConfigClock(default=my_time())
                    mepg_config_initialized = True
                self.session.openWithCallback(self.onDateTimeInputClosed,
                                              TimeDateInput,
                                              config.misc.prev_mepg_time)
            except:
                pass
예제 #12
0
    def createConfig(self, conf_date, conf_starttime, conf_endtime):
        self.save_mask = 0
        if conf_starttime:
            self.save_mask |= 1
        else:
            conf_starttime = ConfigClock(default=time.time()),

        if conf_endtime:
            self.save_mask |= 2
        else:
            conf_endtime = ConfigClock(default=time.time()),

        if conf_date:
            self.save_mask |= 3
        else:
            conf_date = ConfigDateTime(
                default=time.time(),
                formatstring=config.usage.date.full.value,
                increment=86400)

        self.timeinput_date = conf_date
        self.timeinput_starttime = conf_starttime
        self.timeinput_endtime = conf_endtime
예제 #13
0
 def createConfig(self, conf_date, conf_time):
     self.save_mask = 0
     if conf_time:
         self.save_mask |= self.TIME_MASK
     else:
         conf_time = ConfigClock(default=time.time())
     if conf_date:
         self.save_mask |= self.DATE_MASK
     else:
         conf_date = ConfigDateTime(
             default=time.time(),
             formatstring=config.usage.date.daylong.value,
             increment=86400)
     self.timeinput_date = conf_date
     self.timeinput_time = conf_time
예제 #14
0
def InitClientMode():
    config.clientmode = ConfigSubsection()
    config.clientmode.enabled = ConfigYesNo(default=False)

    def clientModeChanged(configElement):
        SystemInfo["ClientModeEnabled"] = configElement.value == True
        SystemInfo["ClientModeDisabled"] = configElement.value != True

    config.clientmode.enabled.addNotifier(clientModeChanged,
                                          immediate_feedback=True,
                                          initial_call=True)
    config.clientmode.serverAddressType = ConfigSelection(default="ip",
                                                          choices=[
                                                              ("ip", _("IP")),
                                                              ("domain",
                                                               _("Domain"))
                                                          ])
    config.clientmode.serverIP = ConfigIP(default=[0, 0, 0, 0], auto_jump=True)
    config.clientmode.serverDomain = ConfigText(default="", fixed_size=False)
    config.clientmode.serverStreamingPort = ConfigInteger(default=8001,
                                                          limits=(1, 65535))
    config.clientmode.serverFTPusername = ConfigText(default="root",
                                                     fixed_size=False)
    config.clientmode.serverFTPpassword = ConfigText(default="",
                                                     fixed_size=False)
    config.clientmode.serverFTPPort = ConfigInteger(default=21,
                                                    limits=(1, 65535))
    config.clientmode.passive = ConfigYesNo(False)
    config.clientmode.enableSchedule = ConfigYesNo(False)
    config.clientmode.scheduleRepeatInterval = ConfigSelection(
        default="360",
        choices=[("60", _("Every hour")), ("120", _("Every 2 hours")),
                 ("180", _("Every 3 hours")), ("360", _("Every 6 hours")),
                 ("720", _("Every 12 hours")), ("daily", _("Daily"))])
    config.clientmode.scheduletime = ConfigClock(default=0)  # 1:00
    # to reinstate normal mode settings
    config.clientmode.nim_cache = ConfigText(default="", fixed_size=False)
    config.clientmode.remote_fallback_enabled_cache = ConfigYesNo(
        default=False)
    config.clientmode.remote_fallback_cache = ConfigText(default="",
                                                         fixed_size=False)
    print("[ClientMode] Client mode data initialised.")
예제 #15
0
                                                                   limits=(0,
                                                                           30))
config.AdvancedMovieSelection.debug = ConfigYesNo(default=False)
config.AdvancedMovieSelection.hotplug = ConfigYesNo(default=True)
config.AdvancedMovieSelection.show_picon = ConfigYesNo(default=True)
config.AdvancedMovieSelection.piconpath = ConfigDirectory(
    eEnv.resolve('${datadir}/enigma2/picon/'))
config.AdvancedMovieSelection.show_wastebasket = ConfigYesNo(default=True)
config.AdvancedMovieSelection.use_original_movieplayer_summary = ConfigYesNo(
    default=False)
config.AdvancedMovieSelection.auto_empty_wastebasket = ConfigSelection(
    default="-1",
    choices=[("-1", _("Disabled")), ("1", _("Daily")),
             ("2", _("Every second day")), ("7", _("Weekly")),
             ("14", _("Every two weeks")), ("30", _("Monthly"))])
config.AdvancedMovieSelection.empty_wastebasket_time = ConfigClock(
    default=10800)
config.AdvancedMovieSelection.empty_wastebasket_min_age = ConfigInteger(
    default=0, limits=(0, 999))
config.AdvancedMovieSelection.last_auto_empty_wastebasket = ConfigInteger(
    default=0)
config.AdvancedMovieSelection.next_auto_empty_wastebasket = ConfigInteger(
    default=0)
config.AdvancedMovieSelection.next_empty_check = ConfigInteger(default=30,
                                                               limits=(01, 60))
config.AdvancedMovieSelection.show_begintime = ConfigYesNo(default=False)
config.AdvancedMovieSelection.show_date_shortdesc = ConfigYesNo(default=False)
config.AdvancedMovieSelection.show_dirsize = ConfigYesNo(default=False)
config.AdvancedMovieSelection.show_diskusage = ConfigYesNo(default=False)
config.AdvancedMovieSelection.dirsize_digits = ConfigSelection(default="0",
                                                               choices=[
                                                                   ("0", "0"),
    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")
예제 #17
0
from Screens.ChoiceBox import ChoiceBox
from Tools.Directories import resolveFilename, SCOPE_CURRENT_SKIN
from RecordTimer import RecordTimerEntry, parseEvent, AFTEREVENT
from ServiceReference import ServiceReference, isPlayableForCur
from Tools.LoadPixmap import LoadPixmap
from Tools.Alternatives import CompareWithAlternatives
import Tools.Notifications
from enigma import eEPGCache, eListbox, gFont, eListboxPythonMultiContent, RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_HALIGN_CENTER,\
	RT_VALIGN_CENTER, RT_WRAP, BT_SCALE, BT_KEEP_ASPECT_RATIO, eSize, eRect, eTimer, getBestPlayableServiceReference, loadPNG
from GraphMultiEpgSetup import GraphMultiEpgSetup
from time import localtime, time, strftime

MAX_TIMELINES = 6

config.misc.graph_mepg = ConfigSubsection()
config.misc.graph_mepg.prev_time = ConfigClock(default = time())
config.misc.graph_mepg.prev_time_period = ConfigInteger(default = 120, limits = (60, 300))
config.misc.graph_mepg.ev_fontsize = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 8, wraparound = True)
config.misc.graph_mepg.items_per_page = ConfigSelectionNumber(min = 3, max = 40, stepwidth = 1, default = 6, wraparound = True)
config.misc.graph_mepg.items_per_page_listscreen = ConfigSelectionNumber(min = 3, max = 60, stepwidth = 1, default = 12, wraparound = True)
config.misc.graph_mepg.default_mode = ConfigYesNo(default = False)
config.misc.graph_mepg.overjump = ConfigYesNo(default = True)
config.misc.graph_mepg.center_timeline = ConfigYesNo(default = False)
config.misc.graph_mepg.servicetitle_mode = ConfigSelection(default = "picon+servicename", choices = [
	("servicename", _("Service name")),
	("picon", _("Picon")),
	("picon+servicename", _("Picon and service name")) ])
config.misc.graph_mepg.roundTo = ConfigSelection(default = "900", choices = [("900", _("%d minutes") % 15), ("1800", _("%d minutes") % 30), ("3600", _("%d minutes") % 60)])
config.misc.graph_mepg.OKButton = ConfigSelection(default = "info", choices = [("info", _("Show detailed event info")), ("zap", _("Zap to selected channel"))])
possibleAlignmentChoices = [
	( str(RT_HALIGN_LEFT   | RT_VALIGN_CENTER          ), _("left")),
예제 #18
0
mountstate = False
mounthost = None
MAX_THREAD_COUNT = 40
timerinstance = None

config.ipboxclient = ConfigSubsection()
config.ipboxclient.host = ConfigText(default="", fixed_size=False)
config.ipboxclient.port = ConfigInteger(default=80, limits=(1, 65535))
config.ipboxclient.streamport = ConfigInteger(default=8001, limits=(1, 65535))
config.ipboxclient.auth = ConfigYesNo(default=False)
config.ipboxclient.firstconf = ConfigYesNo(default=False)
config.ipboxclient.username = ConfigText(default="", fixed_size=False)
config.ipboxclient.password = ConfigText(default="", fixed_size=False)
config.ipboxclient.schedule = ConfigYesNo(default=False)
config.ipboxclient.scheduletime = ConfigClock(default=0) # 1:00
config.ipboxclient.repeattype = ConfigSelection(default="daily", choices=[("daily", _("Daily")), ("weekly", _("Weekly")), ("monthly", _("Monthly"))])
config.ipboxclient.mounthdd = ConfigYesNo(default=False)
config.ipboxclient.remotetimers = ConfigYesNo(default=False)


def getValueFromNode(event, key):
	tmp = event.getElementsByTagName(key)[0].firstChild
	if (tmp):
		return str(tmp.nodeValue)

	return ""


class ClientModeBoxWizard(WizardLanguage):
예제 #19
0
from EPGRefreshConfiguration import EPGRefreshConfiguration
from EPGRefreshService import EPGRefreshService

_session = None
# Plugins
from Components.PluginComponent import plugins
from Plugins.Plugin import PluginDescriptor


# Calculate default begin/end
from time import time, localtime, mktime

#Configuration
config.plugins.epgrefresh = ConfigSubsection()
config.plugins.epgrefresh.enabled = ConfigYesNo(default = False)
config.plugins.epgrefresh.begin = ConfigClock(default = ((20*60) + 15) * 60)
config.plugins.epgrefresh.end = ConfigClock(default = ((6*60) + 30) * 60)
config.plugins.epgrefresh.interval_seconds = ConfigNumber(default = 120)
config.plugins.epgrefresh.delay_standby = ConfigNumber(default = 10)
config.plugins.epgrefresh.inherit_autotimer = ConfigYesNo(default = False)
config.plugins.epgrefresh.afterevent = ConfigYesNo(default = False)
config.plugins.epgrefresh.force = ConfigYesNo(default = False)
config.plugins.epgrefresh.enablemessage = ConfigYesNo(default = True)
config.plugins.epgrefresh.wakeup = ConfigYesNo(default = False)
config.plugins.epgrefresh.start_on_mainmenu = ConfigYesNo(default = False)
config.plugins.epgrefresh.stop_on_mainmenu = ConfigYesNo(default = True)
config.plugins.epgrefresh.lastscan = ConfigNumber(default = 0)
config.plugins.epgrefresh.timeout_shutdown = ConfigInteger(default = 2, limits= (2, 30))
config.plugins.epgrefresh.parse_autotimer = ConfigYesNo(default = False)
config.plugins.epgrefresh.erase = ConfigYesNo(default = False)
예제 #20
0
                rc = Console().ePopen(
                    'crontab /etc/cron/crontabs/root -c /etc/cron/crontabs')
                self.updateList()

    def info(self):
        mysel = self['list'].getCurrent()
        if mysel:
            myline = mysel[1]
            self.session.open(MessageBox, _(myline), MessageBox.TYPE_INFO)


config.crontimers = ConfigSubsection()
config.crontimers.commandtype = NoSave(
    ConfigSelection(choices=[('custom',
                              _("Custom")), ('predefined', _("Predefined"))]))
config.crontimers.cmdtime = NoSave(ConfigClock(default=0))
config.crontimers.cmdtime.value, mytmpt = ([0, 0], [0, 0])
config.crontimers.user_command = NoSave(ConfigText(fixed_size=False))
config.crontimers.runwhen = NoSave(
    ConfigSelection(default='Daily',
                    choices=[('Hourly', _("Hourly")), ('Daily', _("Daily")),
                             ('Weekly', _("Weekly")),
                             ('Monthly', _("Monthly"))]))
config.crontimers.dayofweek = NoSave(
    ConfigSelection(default='Monday',
                    choices=[('Monday', _("Monday")),
                             ('Tuesday', _("Tuesday")),
                             ('Wednesday', _("Wednesday")),
                             ('Thursday', _("Thursday")),
                             ('Friday', _("Friday")),
                             ('Saturday', _("Saturday")),
예제 #21
0
# Globals
pluginPrintname = "[Elektro]"
debug = False  # If set True, plugin will print some additional status info to track logic flow
session = None
ElektroWakeUpTime = -1
elektro_pluginversion = "3.4.5b"
elektrostarttime = 60
elektrosleeptime = 5
elektroShutdownThreshold = 60 * 20
###############################################################################

#Configuration
if debug:
    print pluginPrintname, "Setting config defaults"
config.plugins.elektro = ConfigSubsection()
config.plugins.elektro.nextday = ConfigClock(default=((6 * 60 + 0) * 60))
config.plugins.elektro.nextday2 = ConfigClock(default=((6 * 60 + 0) * 60))
config.plugins.elektro.profile = ConfigSelection(choices=[("1", "Profile 1"),
                                                          ("2", "Profile 2")],
                                                 default="1")
config.plugins.elektro.profileShift = ConfigYesNo(default=False)

config.plugins.elektro.sleep = ConfigSubDict()
for i in range(7):
    config.plugins.elektro.sleep[i] = ConfigClock(default=((1 * 60 + 0) * 60))

config.plugins.elektro.wakeup = ConfigSubDict()
for i in range(7):
    config.plugins.elektro.wakeup[i] = ConfigClock(default=((9 * 60 + 0) * 60))

config.plugins.elektro.sleep2 = ConfigSubDict()
예제 #22
0

from boxbranding import getImageDistro
#Set default configuration
config.plugins.epgimport = ConfigSubsection()
config.plugins.epgimport.enabled = ConfigEnableDisable(default=False)
config.plugins.epgimport.runboot = ConfigSelection(default="4", choices=[
		("1", _("always")),
		("2", _("only manual boot")),
		("3", _("only automatic boot")),
		("4", _("never"))
		])
config.plugins.epgimport.runboot_restart = ConfigYesNo(default=False)
config.plugins.epgimport.runboot_day = ConfigYesNo(default=False)
config.plugins.epgimport.wakeupsleep = ConfigEnableDisable(default=False)
config.plugins.epgimport.wakeup = ConfigClock(default=calcDefaultStarttime())
# Different default in OpenATV:
if getImageDistro() in ("openatv"):
	config.plugins.epgimport.showinplugins = ConfigYesNo(default=False)
else:
	config.plugins.epgimport.showinplugins = ConfigYesNo(default=True)
config.plugins.epgimport.showinextensions = ConfigYesNo(default=True)
config.plugins.epgimport.deepstandby = ConfigSelection(default="skip", choices=[
		("wakeup", _("wake up and import")),
		("skip", _("skip the import"))
		])
config.plugins.epgimport.standby_afterwakeup = ConfigYesNo(default=False)
config.plugins.epgimport.shutdown = ConfigYesNo(default=False)
config.plugins.epgimport.longDescDays = ConfigNumber(default=5)
#config.plugins.epgimport.showinmainmenu = ConfigYesNo(default = False)
config.plugins.epgimport.deepstandby_afterimport = NoSave(ConfigYesNo(default=False))
예제 #23
0
# Calculate default begin/end
from time import time, localtime, mktime
now = localtime()
begin = mktime((
    now.tm_year, now.tm_mon, now.tm_mday, 07, 30, \
 0, now.tm_wday, now.tm_yday, now.tm_isdst)
               )
end = mktime((
    now.tm_year, now.tm_mon, now.tm_mday, 20, 00, \
 0, now.tm_wday, now.tm_yday, now.tm_isdst)
             )

#Configuration
config.plugins.epgrefresh = ConfigSubsection()
config.plugins.epgrefresh.enabled = ConfigYesNo(default=False)
config.plugins.epgrefresh.begin = ConfigClock(default=int(begin))
config.plugins.epgrefresh.end = ConfigClock(default=int(end))
config.plugins.epgrefresh.interval_seconds = ConfigNumber(default=120)
config.plugins.epgrefresh.delay_standby = ConfigNumber(default=10)
config.plugins.epgrefresh.inherit_autotimer = ConfigYesNo(default=False)
config.plugins.epgrefresh.afterevent = ConfigYesNo(default=False)
config.plugins.epgrefresh.force = ConfigYesNo(default=False)
config.plugins.epgrefresh.skipProtectedServices = ConfigSelection(
    choices=[
        ("bg_only", _("Background only")),
        ("always", _("Foreground also")),
    ],
    default="bg_only")
config.plugins.epgrefresh.enablemessage = ConfigYesNo(default=True)
config.plugins.epgrefresh.wakeup = ConfigYesNo(default=False)
config.plugins.epgrefresh.lastscan = ConfigNumber(default=0)
예제 #24
0
config.plugins.ChannelsImporter.importEPG = ConfigYesNo(False)
config.plugins.ChannelsImporter.retrycount = NoSave(ConfigNumber(default=0))
config.plugins.ChannelsImporter.nextscheduletime = NoSave(
    ConfigNumber(default=0))
config.plugins.ChannelsImporter.importOnRestart = ConfigYesNo(False)
config.plugins.ChannelsImporter.enableSchedule = ConfigYesNo(False)
config.plugins.ChannelsImporter.extensions = ConfigYesNo(default=False)
config.plugins.ChannelsImporter.setupFallback = ConfigYesNo(default=False)
config.plugins.ChannelsImporter.scheduleRepeatInterval = ConfigSelection(
    default="daily",
    choices=[("2", _("Every 2 minutes (for testing)")),
             ("5", _("Every 5 minutes (for testing)")),
             ("60", _("Every hour")), ("120", _("Every 2 hours")),
             ("180", _("Every 3 hours")), ("360", _("Every 6 hours")),
             ("720", _("Every 12 hours")), ("daily", _("Daily"))])
config.plugins.ChannelsImporter.scheduletime = ConfigClock(default=0)  # 1:00
config.plugins.ChannelsImporter.errorMessages = ConfigYesNo(False)


def scheduleRepeatIntervalChanged(configElement):
    if config.plugins.ChannelsImporter.enableSchedule.value and config.plugins.ChannelsImporter.scheduleRepeatInterval.value == "daily":
        SystemInfo["ChannelsImporterRepeatDaily"] = True
    else:
        SystemInfo["ChannelsImporterRepeatDaily"] = False


config.plugins.ChannelsImporter.enableSchedule.addNotifier(
    scheduleRepeatIntervalChanged, immediate_feedback=True, initial_call=True)
config.plugins.ChannelsImporter.scheduleRepeatInterval.addNotifier(
    scheduleRepeatIntervalChanged, immediate_feedback=True, initial_call=True)
예제 #25
0
    ("4", _("Friday")),
    ("5", _("Saturday")),
    ("6", _("Sunday")),
],
                                                   default="0")
config.plugins.AdvHdmiCec.toWD = ConfigSelection(choices=[
    ("0", _("Monday")),
    ("1", _("Tuesday")),
    ("2", _("Wednesday")),
    ("3", _("Thursday")),
    ("4", _("Friday")),
    ("5", _("Saturday")),
    ("6", _("Sunday")),
],
                                                 default="6")
config.plugins.AdvHdmiCec.begin1 = ConfigClock(default=int(begin1))
config.plugins.AdvHdmiCec.end1 = ConfigClock(default=int(end1))
config.plugins.AdvHdmiCec.timespan2_enable = ConfigYesNo(default=False)
config.plugins.AdvHdmiCec.begin2 = ConfigClock(default=int(begin2))
config.plugins.AdvHdmiCec.end2 = ConfigClock(default=int(end2))
config.plugins.AdvHdmiCec.show_in = ConfigSelection(choices=[
    ("system", _("systemmenue")),
    ("plugin", _("pluginmenue")),
    ("extension", _("extensions")),
],
                                                    default="system")


class AdvHdmiCecSetup(Screen, ConfigListScreen):
    skin = """
		<screen name="menu_system" position="center,center" size="550,480" title="Advanced HDMI-Cec Setup" >
예제 #26
0
              ('/usr/share/enigma2/', '/usr/share/enigma2/'),
              ('/etc/enigma2/', '/etc/enigma2/')]
config.misc.epgcachepath = ConfigSelection(default='/etc/enigma2/',
                                           choices=hddchoises)
config.plugins.ldteam = ConfigSubsection()
config.plugins.ldteam.auto2 = ConfigSelection(default='no',
                                              choices=[('no', _('no')),
                                                       ('yes', _('yes'))])
config.plugins.ldteam.dropmode = ConfigSelection(
    default='1',
    choices=[
        ('1', _("free pagecache")),
        ('2', _("free dentries and inodes")),
        ('3', _("free pagecache, dentries and inodes")),
    ])
config.plugins.ldteam.epgtime2 = ConfigClock(default=58500)
config.plugins.ldteam.epgmhw2wait = ConfigNumber(
    default=350)  # 350 seconds = 5,83 minutes

config.epg = ConfigSubsection()
config.epg.eit = ConfigYesNo(default=True)
config.epg.mhw = ConfigYesNo(default=True)
config.epg.freesat = ConfigYesNo(default=False)
config.epg.viasat = ConfigYesNo(default=True)
config.epg.netmed = ConfigYesNo(default=True)
config.epg.virgin = ConfigYesNo(default=False)
config.epg.saveepg = ConfigYesNo(default=True)


def EpgSettingsChanged(configElement):
    from enigma import eEPGCache
예제 #27
0
gPushService = None

# Config options
config.pushservice = ConfigSubsection()

config.pushservice.about = ConfigNothing()

config.pushservice.enable = ConfigEnableDisable(default=True)

config.pushservice.boxname = ConfigText(default="Enigma2", fixed_size=False)
config.pushservice.xmlpath = ConfigText(default="/etc/enigma2/pushservice.xml",
                                        fixed_size=False)

config.pushservice.runonboot = ConfigEnableDisable(default=True)
config.pushservice.bootdelay = ConfigSelectionNumber(5, 1000, 5, default=10)
config.pushservice.time = ConfigClock(default=0)
config.pushservice.period = ConfigSelectionNumber(0, 1000, 1, default=24)


#######################################################
# Plugin configuration
def setup(session, **kwargs):
    try:
        ### For testing only
        import ConfigScreen
        reload(ConfigScreen)
        ###
        session.open(ConfigScreen.ConfigScreen)
    except Exception, e:
        print _("PushService setup exception ") + str(e)
        exc_type, exc_value, exc_traceback = sys.exc_info()
예제 #28
0
    def __init__(self, session, args=0):
        self.session = session
        self.setup_title = _("AutoBackup Configuration")
        config.plugins.configurationbackup = ConfigSubsection()
        config.plugins.configurationbackup.enabled = ConfigEnableDisable(
            default=False)
        config.plugins.configurationbackup.maxbackup = ConfigInteger(
            default=99, limits=(0, 99))
        config.plugins.configurationbackup.backuplocation = ConfigText(
            default='/media/hdd/', visible_width=50, fixed_size=False)
        config.plugins.configurationbackup.wakeup = ConfigClock(
            default=((3 * 60) + 0) * 60)  # 3:00
        config.plugins.configurationbackup.backupdirs = ConfigLocations(
            default=[
                eEnv.resolve(
                    '${sysconfdir}/enigma2/'), '/etc/network/interfaces',
                '/etc/wpa_supplicant.conf', '/etc/wpa_supplicant.ath0.conf',
                '/etc/wpa_supplicant.wlan0.conf', '/etc/resolv.conf',
                '/etc/default_gw', '/etc/hostname'
            ])

        Screen.__init__(self, session)
        cfg = config.plugins.configurationbackup
        choices = getLocationChoices()
        self.setTitle(_("AutoBackup Configuration"))
        if choices:
            currentwhere = cfg.backuplocation.value
            defaultchoice = choices[0][0]
            for k, v in choices:
                if k == currentwhere:
                    defaultchoice = k
                    break
        else:
            defaultchoice = ""
            choices = [("", _("Nowhere"))]
        self.cfgwhere = ConfigSelection(default=defaultchoice, choices=choices)
        configList = [
            getConfigListEntry(_("Backup location"), self.cfgwhere),
            getConfigListEntry(_("Daily automatic backup"),
                               config.plugins.configurationbackup.enabled),
            getConfigListEntry(_("Automatic start time"),
                               config.plugins.configurationbackup.wakeup),
            getConfigListEntry(_("Max. saved backup"),
                               config.plugins.configurationbackup.maxbackup),
        ]
        ConfigListScreen.__init__(self,
                                  configList,
                                  session=session,
                                  on_change=self.changedEntry)
        self["key_red"] = Button(_("Cancel"))
        self["key_green"] = Button(_("Ok"))
        self["key_blue"] = Button("")
        self["statusbar"] = Label()
        self["status"] = Label()
        self["setupActions"] = ActionMap(
            ["SetupActions", "ColorActions", "MenuActions"], {
                "red": self.cancel,
                "green": self.save,
                "blue": self.disable,
                "save": self.save,
                "cancel": self.cancel,
                "ok": self.save,
            }, -2)
        self.onChangedEntry = []
        self.data = ''
        self.container = enigma.eConsoleAppContainer()
        self.container.appClosed.append(self.appClosed)
        self.container.dataAvail.append(self.dataAvail)
        self.cfgwhere.addNotifier(self.changedWhere)
        self.onClose.append(self.__onClose)
예제 #29
0
    def createConfig(self):
        justplay = self.timer.justplay
        always_zap = self.timer.always_zap
        rename_repeat = self.timer.rename_repeat

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

        # calculate default values
        day = []
        weekday = 0
        for x in (0, 1, 2, 3, 4, 5, 6):
            day.append(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:
                flags = self.timer.repeated
                repeated = "user"
                count = 0
                for x in (0, 1, 2, 3, 4, 5, 6):
                    if flags == 1:  # weekly
                        # 						print "Set to weekday " + str(x)
                        weekday = x
                    if flags & 1 == 1:  # set user defined flags
                        day[x] = 1
                        count += 1
                    else:
                        day[x] = 0
                    flags >>= 1
                if count == 1:
                    repeated = "weekly"
        else:  # once
            type = "once"
            repeated = None
            weekday = int(strftime("%u", localtime(self.timer.begin))) - 1
            day[weekday] = 1

        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])
        self.timertyp = self.timerentry_justplay.value

        if SystemInfo["DeepstandbySupport"]:
            shutdownString = _("go to deep standby")
        else:
            shutdownString = _("shut down")
        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.replace(
            '\xc2\x86', '').replace('\xc2\x87', '').encode("utf-8"),
                                          visible_width=50,
                                          fixed_size=False)
        self.timerentry_description_replaced = self.timer.description.replace(
            '\xc2\x8a', ' ').encode("utf-8")
        self.timerentry_description = ConfigText(
            default=self.timerentry_description_replaced,
            visible_width=50,
            fixed_size=False)
        self.timerentry_tags = self.timer.tags[:]
        # if no tags found, make name of event default tag set.
        if not self.timerentry_tags:
            tagname = self.timer.name.strip()
            if tagname:
                tagname = tagname[0].upper() + tagname[1:].replace(" ", "_")
                self.timerentry_tags.append(tagname)

        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_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 = False, choices = [(True, _("yes")), (False, _("no"))])
        self.timerentry_showendtime = ConfigSelection(
            default=(self.timer.end > self.timer.begin + 3
                     and self.timer.justplay),
            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])
예제 #30
0
파일: EpgConfig.py 프로젝트: zukon/enigma2
def InitEPGConfig():
    config.epgselection = ConfigSubsection()
    config.epgselection.sort = ConfigSelection(default="0",
                                               choices=[("0", _("Time")),
                                                        ("1",
                                                         _("Alphanumeric"))])
    config.epgselection.overjump = ConfigYesNo(default=False)

    serviceTitleChoices = [
        ("servicename", _("Service Name")), ("picon", _("Picon")),
        ("picon+servicename", _("Picon and Service Name")),
        ("servicenumber+picon", _("Service Number and Picon")),
        ("picon+servicenumber", _("Picon and Service Number")),
        ("servicenumber+servicename", _("Service Number and Service Name")),
        ("picon+servicenumber+servicename",
         _("Picon, Service Number and Service Name")),
        ("servicenumber+picon+servicename",
         _("Service Number, Picon and Service Name"))
    ]

    singleBrowseModeChoices = [("currentservice", _("Select current service")),
                               ("lastepgservice",
                                _("Select last browsed service"))]

    multiBrowseModeChoices = [
        ("currentservice", _("Select current service")),
        ("firstservice", _("Select first service in bouquet")),
        ("lastepgservice", _("Select last browsed service"))
    ]

    config.epgselection.infobar = ConfigSubsection()
    config.epgselection.infobar.browse_mode = ConfigSelection(
        default="currentservice", choices=singleBrowseModeChoices)
    config.epgselection.infobar.type_mode = ConfigSelection(
        default="graphics",
        choices=[("text", _("Text Grid EPG")),
                 ("graphics", _("Graphics Grid EPG")),
                 ("single", _("Single EPG"))])
    if SystemInfo.get("NumVideoDecoders", 1) > 1:
        config.epgselection.infobar.preview_mode = ConfigSelection(choices=[
            ("0", _("Disabled")), ("1", _("Full screen")), ("2", _("PiP"))
        ],
                                                                   default="1")
    else:
        config.epgselection.infobar.preview_mode = ConfigSelection(choices=[
            ("0", _("Disabled")), ("1", _("Full screen"))
        ],
                                                                   default="1")
    choices = [(0, _("Use skin default"))] + [(i, _("%d") % i)
                                              for i in range(1, 5)]
    config.epgselection.infobar.itemsperpage = ConfigSelection(default=0,
                                                               choices=choices)
    config.epgselection.infobar.roundto = ConfigSelection(
        default="15",
        choices=[("15", _("%d minutes") % 15), ("30", _("%d minutes") % 30),
                 ("60", _("%d minutes") % 60)])
    config.epgselection.infobar.prevtimeperiod = ConfigSelection(
        default="180",
        choices=[
            ("60", _("%d minutes") % 60), ("90", _("%d minutes") % 90),
            ("120", _("%d minutes") % 120), ("150", _("%d minutes") % 150),
            ("180", _("%d minutes") % 180), ("210", _("%d minutes") % 210),
            ("240", _("%d minutes") % 240), ("270", _("%d minutes") % 270),
            ("300", _("%d minutes") % 300)
        ])
    config.epgselection.infobar.primetime = ConfigClock(default=(20, 0))
    config.epgselection.infobar.servicetitle_mode = ConfigSelection(
        default="servicename", choices=serviceTitleChoices)
    config.epgselection.infobar.servfs = ConfigSelectionNumber(default=0,
                                                               stepwidth=1,
                                                               min=-8,
                                                               max=10,
                                                               wraparound=True)
    config.epgselection.infobar.eventfs = ConfigSelectionNumber(
        default=0, stepwidth=1, min=-8, max=10, wraparound=True)
    config.epgselection.infobar.timelinefs = ConfigSelectionNumber(
        default=0, stepwidth=1, min=-8, max=10, wraparound=True)
    config.epgselection.infobar.timeline24h = ConfigYesNo(default=True)
    config.epgselection.infobar.servicewidth = ConfigSelectionNumber(
        default=250, stepwidth=1, min=70, max=500, wraparound=True)
    config.epgselection.infobar.piconwidth = ConfigSelectionNumber(
        default=100, stepwidth=1, min=50, max=500, wraparound=True)
    config.epgselection.infobar.infowidth = ConfigSelectionNumber(
        default=50, stepwidth=25, min=0, max=150, wraparound=True)
    config.epgselection.infobar.btn_ok = ConfigSelection(choices=okActions,
                                                         default="zap")
    config.epgselection.infobar.btn_oklong = ConfigSelection(choices=okActions,
                                                             default="zapExit")
    config.epgselection.infobar.btn_epg = ConfigSelection(
        choices=infoActions, default="openSingleEPG")
    config.epgselection.infobar.btn_epglong = ConfigSelection(
        choices=infoActions, default="")
    config.epgselection.infobar.btn_info = ConfigSelection(
        choices=infoActions, default="openEventView")
    config.epgselection.infobar.btn_infolong = ConfigSelection(
        choices=infoActions, default="openSingleEPG")
    config.epgselection.infobar.btn_red = ConfigSelection(choices=epgActions,
                                                          default="openIMDb")
    config.epgselection.infobar.btn_redlong = ConfigSelection(
        choices=epgActions, default="sortEPG")
    config.epgselection.infobar.btn_green = ConfigSelection(
        choices=epgActions, default="addEditTimer")
    config.epgselection.infobar.btn_greenlong = ConfigSelection(
        choices=epgActions, default="openTimerList")
    config.epgselection.infobar.btn_yellow = ConfigSelection(
        choices=epgActions, default="openEPGSearch")
    config.epgselection.infobar.btn_yellowlong = ConfigSelection(
        choices=epgActions, default="")
    config.epgselection.infobar.btn_blue = ConfigSelection(
        choices=epgActions, default="addEditAutoTimer")
    config.epgselection.infobar.btn_bluelong = ConfigSelection(
        choices=epgActions, default="openAutoTimerList")
    config.epgselection.infobar.btn_rec = ConfigSelection(
        choices=recActions, default="addEditTimerMenu")
    config.epgselection.infobar.btn_reclong = ConfigSelection(
        choices=recActions, default="addEditZapTimerSilent")

    config.epgselection.single = ConfigSubsection()
    config.epgselection.single.browse_mode = ConfigSelection(
        default="lastepgservice", choices=singleBrowseModeChoices)
    config.epgselection.single.preview_mode = ConfigYesNo(default=True)
    config.epgselection.single.eventfs = ConfigSelectionNumber(default=0,
                                                               stepwidth=1,
                                                               min=-8,
                                                               max=10,
                                                               wraparound=True)
    choices = [(0, _("Use skin default"))] + [(i, _("%d") % i)
                                              for i in range(1, 41)]
    config.epgselection.single.itemsperpage = ConfigSelection(default=0,
                                                              choices=choices)
    config.epgselection.single.btn_red = ConfigSelection(choices=epgActions,
                                                         default="openIMDb")
    config.epgselection.single.btn_redlong = ConfigSelection(
        choices=epgActions, default="sortEPG")
    config.epgselection.single.btn_green = ConfigSelection(
        choices=epgActions, default="addEditTimer")
    config.epgselection.single.btn_greenlong = ConfigSelection(
        choices=epgActions, default="openTimerList")
    config.epgselection.single.btn_yellow = ConfigSelection(
        choices=epgActions, default="openEPGSearch")
    config.epgselection.single.btn_yellowlong = ConfigSelection(
        choices=epgActions, default="")
    config.epgselection.single.btn_blue = ConfigSelection(
        choices=epgActions, default="addEditAutoTimer")
    config.epgselection.single.btn_bluelong = ConfigSelection(
        choices=epgActions, default="openAutoTimerList")
    config.epgselection.single.btn_ok = ConfigSelection(choices=okActions,
                                                        default="zap")
    config.epgselection.single.btn_oklong = ConfigSelection(choices=okActions,
                                                            default="zapExit")
    config.epgselection.single.btn_epg = ConfigSelection(
        choices=infoActions, default="openSingleEPG")
    config.epgselection.single.btn_epglong = ConfigSelection(
        choices=infoActions, default="")
    config.epgselection.single.btn_info = ConfigSelection(
        choices=infoActions, default="openEventView")
    config.epgselection.single.btn_infolong = ConfigSelection(
        choices=infoActions, default="openSingleEPG")
    config.epgselection.single.btn_rec = ConfigSelection(
        choices=recActions, default="addEditTimerMenu")
    config.epgselection.single.btn_reclong = ConfigSelection(
        choices=recActions, default="addEditZapTimerSilent")

    config.epgselection.multi = ConfigSubsection()
    config.epgselection.multi.showbouquet = ConfigYesNo(default=False)
    config.epgselection.multi.browse_mode = ConfigSelection(
        default="currentservice", choices=multiBrowseModeChoices)
    config.epgselection.multi.preview_mode = ConfigYesNo(default=True)
    config.epgselection.multi.eventfs = ConfigSelectionNumber(default=0,
                                                              stepwidth=1,
                                                              min=-8,
                                                              max=10,
                                                              wraparound=True)
    choices = [(0, _("Use skin default"))] + [(i, _("%d") % i)
                                              for i in range(12, 41)]
    config.epgselection.multi.itemsperpage = ConfigSelection(default=0,
                                                             choices=choices)
    config.epgselection.multi.servicewidth = ConfigSelectionNumber(
        default=7, stepwidth=1, min=5, max=20, wraparound=True)
    config.epgselection.multi.btn_ok = ConfigSelection(choices=okActions,
                                                       default="zap")
    config.epgselection.multi.btn_oklong = ConfigSelection(choices=okActions,
                                                           default="zapExit")
    config.epgselection.multi.btn_epg = ConfigSelection(
        choices=infoActions, default="openSingleEPG")
    config.epgselection.multi.btn_epglong = ConfigSelection(
        choices=infoActions, default="")
    config.epgselection.multi.btn_info = ConfigSelection(
        choices=infoActions, default="openEventView")
    config.epgselection.multi.btn_infolong = ConfigSelection(
        choices=infoActions, default="openSingleEPG")
    config.epgselection.multi.btn_rec = ConfigSelection(
        choices=recActions, default="addEditTimerMenu")
    config.epgselection.multi.btn_reclong = ConfigSelection(
        choices=recActions, default="addEditZapTimerSilent")
    config.epgselection.multi.btn_red = ConfigSelection(choices=epgActions,
                                                        default="openIMDb")
    config.epgselection.multi.btn_redlong = ConfigSelection(choices=epgActions,
                                                            default="sortEPG")
    config.epgselection.multi.btn_green = ConfigSelection(
        choices=epgActions, default="addEditTimer")
    config.epgselection.multi.btn_greenlong = ConfigSelection(
        choices=epgActions, default="openTimerList")
    config.epgselection.multi.btn_yellow = ConfigSelection(
        choices=epgActions, default="openEPGSearch")
    config.epgselection.multi.btn_yellowlong = ConfigSelection(
        choices=epgActions, default="")
    config.epgselection.multi.btn_blue = ConfigSelection(
        choices=epgActions, default="addEditAutoTimer")
    config.epgselection.multi.btn_bluelong = ConfigSelection(
        choices=epgActions, default="openAutoTimerList")

    config.epgselection.grid = ConfigSubsection()
    config.epgselection.grid.showbouquet = ConfigYesNo(default=False)
    config.epgselection.grid.browse_mode = ConfigSelection(
        default="currentservice", choices=multiBrowseModeChoices)
    config.epgselection.grid.preview_mode = ConfigYesNo(default=True)
    config.epgselection.grid.type_mode = ConfigSelection(choices=[
        ("graphics", _("Graphics")), ("text", _("Text"))
    ],
                                                         default="graphics")
    config.epgselection.grid.highlight_current_events = ConfigYesNo(
        default=True)
    config.epgselection.grid.roundto = ConfigSelection(
        default="15",
        choices=[("15", _("%d minutes") % 15), ("30", _("%d minutes") % 30),
                 ("60", _("%d minutes") % 60)])
    config.epgselection.grid.prevtimeperiod = ConfigSelection(
        default="180",
        choices=[
            ("60", _("%d minutes") % 60), ("90", _("%d minutes") % 90),
            ("120", _("%d minutes") % 120), ("150", _("%d minutes") % 150),
            ("180", _("%d minutes") % 180), ("210", _("%d minutes") % 210),
            ("240", _("%d minutes") % 240), ("270", _("%d minutes") % 270),
            ("300", _("%d minutes") % 300)
        ])
    config.epgselection.grid.primetime = ConfigClock(default=(20, 0))
    config.epgselection.grid.servicetitle_mode = ConfigSelection(
        default="servicename", choices=serviceTitleChoices)
    possibleAlignmentChoices = [
        (str(RT_HALIGN_LEFT | RT_VALIGN_CENTER), _("left")),
        (str(RT_HALIGN_CENTER | RT_VALIGN_CENTER), _("centered")),
        (str(RT_HALIGN_RIGHT | RT_VALIGN_CENTER), _("right")),
        (str(RT_HALIGN_LEFT | RT_VALIGN_CENTER | RT_WRAP), _("left, wrapped")),
        (str(RT_HALIGN_CENTER | RT_VALIGN_CENTER | RT_WRAP),
         _("centered, wrapped")),
        (str(RT_HALIGN_RIGHT | RT_VALIGN_CENTER | RT_WRAP),
         _("right, wrapped"))
    ]
    config.epgselection.grid.servicename_alignment = ConfigSelection(
        default=possibleAlignmentChoices[0][0],
        choices=possibleAlignmentChoices)
    config.epgselection.grid.servicenumber_alignment = ConfigSelection(
        default=possibleAlignmentChoices[0][0],
        choices=possibleAlignmentChoices)
    config.epgselection.grid.event_alignment = ConfigSelection(
        default=possibleAlignmentChoices[0][0],
        choices=possibleAlignmentChoices)
    config.epgselection.grid.timelinedate_alignment = ConfigSelection(
        default=possibleAlignmentChoices[0][0],
        choices=possibleAlignmentChoices)
    config.epgselection.grid.servfs = ConfigSelectionNumber(default=0,
                                                            stepwidth=1,
                                                            min=-8,
                                                            max=10,
                                                            wraparound=True)
    config.epgselection.grid.eventfs = ConfigSelectionNumber(default=0,
                                                             stepwidth=1,
                                                             min=-8,
                                                             max=10,
                                                             wraparound=True)
    config.epgselection.grid.timelinefs = ConfigSelectionNumber(
        default=0, stepwidth=1, min=-8, max=10, wraparound=True)
    config.epgselection.grid.timeline24h = ConfigYesNo(default=True)
    choices = [(0, _("Use skin default"))] + [(i, _("%d") % i)
                                              for i in range(3, 21)]
    config.epgselection.grid.itemsperpage = ConfigSelection(default=0,
                                                            choices=choices)
    config.epgselection.grid.pig = ConfigYesNo(default=True)
    config.epgselection.grid.heightswitch = NoSave(ConfigYesNo(default=False))
    config.epgselection.grid.servicewidth = ConfigSelectionNumber(
        default=250, stepwidth=1, min=70, max=500, wraparound=True)
    config.epgselection.grid.piconwidth = ConfigSelectionNumber(
        default=100, stepwidth=1, min=50, max=500, wraparound=True)
    config.epgselection.grid.infowidth = ConfigSelectionNumber(default=50,
                                                               stepwidth=25,
                                                               min=0,
                                                               max=150,
                                                               wraparound=True)
    config.epgselection.grid.rec_icon_height = ConfigSelection(
        choices=[("bottom", _("bottom")), ("top", _("top")),
                 ("middle", _("middle")), ("hide", _("hide"))],
        default="bottom")
    config.epgselection.grid.number_buttons_mode = ConfigSelection(
        choices=[("paging", _("Standard")),
                 ("service", _("Enter service number"))],
        default="paging")
    config.epgselection.grid.btn_ok = ConfigSelection(choices=okActions,
                                                      default="zap")
    config.epgselection.grid.btn_oklong = ConfigSelection(choices=okActions,
                                                          default="zapExit")
    config.epgselection.grid.btn_epg = ConfigSelection(choices=infoActions,
                                                       default="openSingleEPG")
    config.epgselection.grid.btn_epglong = ConfigSelection(choices=infoActions,
                                                           default="")
    config.epgselection.grid.btn_info = ConfigSelection(
        choices=infoActions, default="openEventView")
    config.epgselection.grid.btn_infolong = ConfigSelection(
        choices=infoActions, default="openSingleEPG")
    config.epgselection.grid.btn_rec = ConfigSelection(
        choices=recActions, default="addEditTimerMenu")
    config.epgselection.grid.btn_reclong = ConfigSelection(
        choices=recActions, default="addEditZapTimerSilent")
    config.epgselection.grid.btn_channelup = ConfigSelection(
        choices=channelUpActions, default="forward24Hours")
    config.epgselection.grid.btn_channeldown = ConfigSelection(
        choices=channelDownActions, default="back24Hours")
    config.epgselection.grid.btn_red = ConfigSelection(choices=epgActions,
                                                       default="openIMDb")
    config.epgselection.grid.btn_redlong = ConfigSelection(choices=epgActions,
                                                           default="sortEPG")
    config.epgselection.grid.btn_green = ConfigSelection(
        choices=epgActions, default="addEditTimer")
    config.epgselection.grid.btn_greenlong = ConfigSelection(
        choices=epgActions, default="openTimerList")
    config.epgselection.grid.btn_yellow = ConfigSelection(
        choices=epgActions, default="openEPGSearch")
    config.epgselection.grid.btn_yellowlong = ConfigSelection(
        choices=epgActions, default="")
    config.epgselection.grid.btn_blue = ConfigSelection(
        choices=epgActions, default="addEditAutoTimer")
    config.epgselection.grid.btn_bluelong = ConfigSelection(
        choices=epgActions, default="openAutoTimerList")