Exemple #1
0
 def __init__(self):
     self.userlist = []
     config.plugins.youtubeplayer.usercount = ConfigInteger(0)
     config.plugins.youtubeplayer.users = ConfigSubList()
     config.plugins.youtubeplayer.defaultuser = ConfigText("", False)
     for usernum in range(0, config.plugins.youtubeplayer.usercount.value):
         self.new()
Exemple #2
0
	def createConfig(self):
		def setVlt(fancontrol, fanid, configElement):
			fancontrol.setVoltage(fanid, configElement.value)

		def setPWM(fancontrol, fanid, configElement):
			fancontrol.setPWM(fanid, configElement.value)

		config.fans = ConfigSubList()
		for fanid in range(self.getFanCount()):
			fan = ConfigSubsection()
			fan.vlt = ConfigSlider(default=15, increment=5, limits=(0, 255))
			if model == "tm2t":
				fan.pwm = ConfigSlider(default=150, increment=5, limits=(0, 255))
			elif model == "tmsingle":
				fan.pwm = ConfigSlider(default=100, increment=5, limits=(0, 255))
			elif model == "beyonwizu4":
				fan.pwm = ConfigSlider(default=0xcc, increment=0x11, limits=(0x22, 0xff))
			elif model == "beyonwizt4":
				fan.pwm = ConfigSlider(default=200, increment=5, limits=(0, 255))
			else:
				fan.pwm = ConfigSlider(default=50, increment=5, limits=(0, 255))
			fan.vlt_standby = ConfigSlider(default=5, increment=5, limits=(0, 255))
			if model == "beyonwizu4":
				fan.pwm_standby = ConfigSlider(default=0x44, increment=0x11, limits=(0x22, 0xff))
			elif model == "beyonwizt4":
				fan.pwm_standby = ConfigSlider(default=10, increment=5, limits=(0, 0xff))
			else:
				fan.pwm_standby = ConfigSlider(default=0, increment=5, limits=(0, 255))
			fan.vlt.addNotifier(boundFunction(setVlt, self, fanid))
			fan.pwm.addNotifier(boundFunction(setPWM, self, fanid))
			config.fans.append(fan)
Exemple #3
0
	def getPMTInfo(self):
		service = self.session.nav.getCurrentService()
		audio = service and service.audioTracks()
		n = audio and audio.getNumberOfTracks() or 0
		if n > 0:
			from DVDTitle import ConfigFixedText
			from TitleProperties import languageChoices
			from Components.config import config, ConfigSubsection, ConfigSubList, ConfigSelection, ConfigYesNo
			self.t.properties.audiotracks = ConfigSubList()
			for x in range(n):
				i = audio.getTrackInfo(x)
				DVB_lang = i.getLanguage()
				description = i.getDescription()
				pid = str(i.getPID())
				if description == "MPEG":
					description = "MP2"
				print("[DVDBurn] audiotrack pid:", pid, "description:", description, "language:", DVB_lang, "count:", x, "active:", (x < 8))
				self.t.properties.audiotracks.append(ConfigSubsection())
				self.t.properties.audiotracks[-1].active = ConfigYesNo(default = (x < 8))
				self.t.properties.audiotracks[-1].format = ConfigFixedText(description)
				self.t.properties.audiotracks[-1].language = ConfigSelection(choices = languageChoices.choices, default=languageChoices.getLanguage(DVB_lang))
				self.t.properties.audiotracks[-1].pid = ConfigFixedText(pid)
				self.t.properties.audiotracks[-1].DVB_lang = ConfigFixedText(DVB_lang)
		sAspect = service.info().getInfo(iServiceInformation.sAspect)
		if sAspect in ( 1, 2, 5, 6, 9, 0xA, 0xD, 0xE ):
			aspect = "4:3"
		else:
			aspect = "16:9"
		self.t.properties.aspect.setValue(aspect)
		self.t.VideoType = service.info().getInfo(iServiceInformation.sVideoType)
Exemple #4
0
def InitCiConfig():
    config.ci = ConfigSubList()
    config.cimisc = ConfigSubsection()
    if SystemInfo["CommonInterface"]:
        for slot in range(SystemInfo["CommonInterface"]):
            config.ci.append(ConfigSubsection())
            config.ci[slot].canDescrambleMultipleServices = ConfigSelection(
                choices=[("auto", _("auto")), ("no", _("no")),
                         ("yes", _("yes"))],
                default="auto")
            config.ci[slot].use_static_pin = ConfigYesNo(default=True)
            config.ci[slot].static_pin = ConfigPIN(default=0)
            config.ci[slot].show_ci_messages = ConfigYesNo(default=True)
            if SystemInfo["CI%dSupportsHighBitrates" % slot]:
                config.ci[slot].canHandleHighBitrates = ConfigYesNo(
                    default=True)
                config.ci[slot].canHandleHighBitrates.slotid = slot
                config.ci[slot].canHandleHighBitrates.addNotifier(setCIBitrate)
            if SystemInfo["CI%dRelevantPidsRoutingSupport" % slot]:
                config.ci[slot].relevantPidsRouting = ConfigYesNo(
                    default=False)
                config.ci[slot].relevantPidsRouting.slotid = slot
                config.ci[slot].relevantPidsRouting.addNotifier(
                    setRelevantPidsRouting)
        if SystemInfo["CommonInterfaceCIDelay"]:
            config.cimisc.dvbCiDelay = ConfigSelection(default="256",
                                                       choices=[("16", "16"),
                                                                ("32", "32"),
                                                                ("64", "64"),
                                                                ("128", "128"),
                                                                ("256", "256")
                                                                ])
            config.cimisc.dvbCiDelay.addNotifier(setdvbCiDelay)
Exemple #5
0
def InitParentalControl():
	global parentalControl
	parentalControl = ParentalControl()
	config.ParentalControl = ConfigSubsection()
	config.ParentalControl.configured = ConfigYesNo(default = False)
	config.ParentalControl.mode = ConfigSelection(default = "simple", choices = [("simple", _("simple")), ("complex", _("complex"))])
	config.ParentalControl.storeservicepin = ConfigSelection(default = "never", choices = [("never", _("never")), ("5", _("5 minutes")), ("30", _("30 minutes")), ("60", _("60 minutes")), ("standby", _("until standby/restart"))])
	config.ParentalControl.storeservicepincancel = ConfigSelection(default = "never", choices = [("never", _("never")), ("5", _("5 minutes")), ("30", _("30 minutes")), ("60", _("60 minutes")), ("standby", _("until standby/restart"))])
	config.ParentalControl.servicepinactive = ConfigYesNo(default = False)
	config.ParentalControl.setuppinactive = ConfigYesNo(default = False)
	config.ParentalControl.type = ConfigSelection(default = "blacklist", choices = [(LIST_WHITELIST, _("whitelist")), (LIST_BLACKLIST, _("blacklist"))])
	config.ParentalControl.setuppin = ConfigPIN(default = -1)
	
	config.ParentalControl.retries = ConfigSubsection()
	config.ParentalControl.retries.setuppin = ConfigSubsection()
	config.ParentalControl.retries.setuppin.tries = ConfigInteger(default = 3)
	config.ParentalControl.retries.setuppin.time = ConfigInteger(default = 3)	
	config.ParentalControl.retries.servicepin = ConfigSubsection()
	config.ParentalControl.retries.servicepin.tries = ConfigInteger(default = 3)
	config.ParentalControl.retries.servicepin.time = ConfigInteger(default = 3)
#	config.ParentalControl.configured = configElement("config.ParentalControl.configured", configSelection, 1, (("yes", _("yes")), ("no", _("no"))))
	#config.ParentalControl.mode = configElement("config.ParentalControl.mode", configSelection, 0, (("simple", _("simple")), ("complex", _("complex"))))
	#config.ParentalControl.storeservicepin = configElement("config.ParentalControl.storeservicepin", configSelection, 0, (("never", _("never")), ("5_minutes", _("5 minutes")), ("30_minutes", _("30 minutes")), ("60_minutes", _("60 minutes")), ("restart", _("until restart"))))
	#config.ParentalControl.servicepinactive = configElement("config.ParentalControl.servicepinactive", configSelection, 1, (("yes", _("yes")), ("no", _("no"))))
	#config.ParentalControl.setuppinactive = configElement("config.ParentalControl.setuppinactive", configSelection, 1, (("yes", _("yes")), ("no", _("no"))))
	#config.ParentalControl.type = configElement("config.ParentalControl.type", configSelection, 0, (("whitelist", _("whitelist")), ("blacklist", _("blacklist"))))
	#config.ParentalControl.setuppin = configElement("config.ParentalControl.setuppin", configSequence, "0000", configSequenceArg().get("PINCODE", (4, "")))

	config.ParentalControl.servicepin = ConfigSubList()

	for i in (0, 1, 2):
		config.ParentalControl.servicepin.append(ConfigPIN(default = -1))
Exemple #6
0
 def loadConfigFile(self):
     print("[AutomaticVolumeAdjustmentConfig] Loading config file...")
     self.config = Config()
     if not os_path.exists(self.CONFIG_FILE):
         try:
             fd = os_open(self.CONFIG_FILE, os_O_RDWR | os_O_CREAT)
             os_close(fd)
         except Exception as e:
             print("Error: ", e)
     try:
         self.config.loadFromFile(self.CONFIG_FILE)
     except Exception as e:
         print("Error: ", e)
     self.config.entriescount = ConfigInteger(0)
     self.config.Entries = ConfigSubList()
     self.config.enable = ConfigYesNo(default=False)
     self.config.modus = ConfigSelection(choices=[
         ("0", _("Automatic volume adjust")),
         ("1", _("Remember service volume value"))
     ],
                                         default="0")
     self.config.adustvalue = ConfigSelectionNumber(-50, 50, 5, default=25)
     self.config.mpeg_max_volume = ConfigSelectionNumber(10,
                                                         100,
                                                         5,
                                                         default=100)
     self.config.show_volumebar = ConfigYesNo(default=False)
     self.initConfig()
Exemple #7
0
def InitCiConfig():
    config.ci = ConfigSubList()
    for slot in range(MAX_NUM_CI):
        config.ci.append(ConfigSubsection())
        config.ci[slot].canDescrambleMultipleServices = ConfigSelection(
            choices=[("auto", _("Auto")), ("no", _("No")), ("yes", _("Yes"))],
            default="auto")
        config.ci[slot].use_static_pin = ConfigYesNo(default=True)
        config.ci[slot].static_pin = ConfigPIN(default=0)
        config.ci[slot].show_ci_messages = ConfigYesNo(default=True)
        if SystemInfo["CommonInterfaceSupportsHighBitrates"]:
            if getBrandOEM() in ('dags', 'blackbox'):
                config.ci[slot].canHandleHighBitrates = ConfigSelection(
                    choices=[("no", _("No")), ("yes", _("Yes"))],
                    default="yes")
            else:
                config.ci[slot].canHandleHighBitrates = ConfigSelection(
                    choices=[("no", _("No")), ("yes", _("Yes"))], default="no")
            config.ci[slot].canHandleHighBitrates.slotid = slot
            config.ci[slot].canHandleHighBitrates.addNotifier(setCIBitrate)
        if SystemInfo["CommonInterfaceCIDelay"]:
            config.ci.dvbCiDelay = ConfigSelection(default="256",
                                                   choices=[("16", _("16")),
                                                            ("32", _("32")),
                                                            ("64", _("64")),
                                                            ("128", _("128")),
                                                            ("256", _("256"))])
            config.ci.dvbCiDelay.addNotifier(setdvbCiDelay)
Exemple #8
0
 def getSkinParts(self):
     self.parts = {}
     self.screens = {}
     self.partlist = ConfigSubList()
     self.screenlist = ConfigSubDict()
     self.idx = 0
     self.readSkinParts("/usr/share/enigma2/MetrixHD/skinparts/")
def InitParentalControl():
	config.ParentalControl = ConfigSubsection()
	config.ParentalControl.storeservicepin = ConfigSelection(default = "never", choices = [("never", _("never")), ("5", _("%d minutes") % 5), ("15", _("%d minutes") % 15), ("30", _("%d minutes") % 30), ("60", _("%d minutes") % 60), ("120", _("%d minutes") % 120), ("standby", _("until standby/restart"))])
	config.ParentalControl.configured = ConfigYesNo(default = False)
	config.ParentalControl.setuppinactive = ConfigYesNo(default = False)
	config.ParentalControl.retries = ConfigSubsection()
	config.ParentalControl.retries.servicepin = ConfigSubsection()
	config.ParentalControl.retries.servicepin.tries = ConfigInteger(default = 3)
	config.ParentalControl.retries.servicepin.time = ConfigInteger(default = 3)
	config.ParentalControl.servicepin = ConfigSubList()
	config.ParentalControl.servicepin.append(ConfigPIN(default = 0))
	config.ParentalControl.age = ConfigSelection(default = "18", choices = [("0", _("No age block"))] + list((str(x), "%d+" % x) for x in range(3,19)))
	config.ParentalControl.hideBlacklist = ConfigYesNo(default = False)
	config.ParentalControl.config_sections = ConfigSubsection()
	config.ParentalControl.config_sections.main_menu = ConfigYesNo(default = False)
	config.ParentalControl.config_sections.configuration = ConfigYesNo(default = False)
	config.ParentalControl.config_sections.timer_menu = ConfigYesNo(default = False)
	config.ParentalControl.config_sections.plugin_browser = ConfigYesNo(default = False)
	config.ParentalControl.config_sections.standby_menu = ConfigYesNo(default = False)
	config.ParentalControl.config_sections.software_update = ConfigYesNo(default = False)
	config.ParentalControl.config_sections.manufacturer_reset = ConfigYesNo(default = True)
	config.ParentalControl.config_sections.movie_list = ConfigYesNo(default = False)
	config.ParentalControl.config_sections.context_menus = ConfigYesNo(default = False)
	config.ParentalControl.config_sections.menu_sort = ConfigYesNo(default = False)

	#Added for backwards compatibility with some 3rd party plugins that depend on this config
	config.ParentalControl.servicepinactive = config.ParentalControl.configured
	config.ParentalControl.setuppin = config.ParentalControl.servicepin[0]
	config.ParentalControl.retries.setuppin = config.ParentalControl.retries.servicepin
	config.ParentalControl.type = ConfigSelection(default = "blacklist", choices = [(LIST_BLACKLIST, _("blacklist"))])

	global parentalControl
	parentalControl = ParentalControl()
Exemple #10
0
 def __init__(self, project):
     self.properties = ConfigSubsection()
     self.properties.menutitle = ConfigText(fixed_size=False,
                                            visible_width=80)
     self.properties.menusubtitle = ConfigText(fixed_size=False,
                                               visible_width=80)
     self.properties.aspect = ConfigSelection(
         choices=[("4:3", _("4:3")), ("16:9", _("16:9"))])
     self.properties.widescreen = ConfigSelection(
         choices=[("nopanscan", "nopanscan"), ("noletterbox",
                                               "noletterbox")])
     self.properties.autochapter = ConfigInteger(default=0, limits=(0, 60))
     self.properties.audiotracks = ConfigSubList()
     self.DVBname = _("Title")
     self.DVBdescr = _("Description")
     self.DVBchannel = _("Channel")
     self.cuesheet = []
     self.source = None
     self.filesize = 0
     self.estimatedDiskspace = 0
     self.inputfile = ""
     self.cutlist = []
     self.chaptermarks = []
     self.timeCreate = None
     self.project = project
     self.length = 0
     self.VideoType = -1
     self.VideoPID = -1
     self.framerate = 0
     self.progressive = -1
     self.resolution = (-1, -1)
Exemple #11
0
    def createConfig(self):
        def setVlt(fancontrol, fanid, configElement):
            fancontrol.setVoltage(fanid, configElement.value)

        def setPWM(fancontrol, fanid, configElement):
            fancontrol.setPWM(fanid, configElement.value)

        config.fans = ConfigSubList()
        for fanid in range(self.getFanCount()):
            fan = ConfigSubsection()
            fan.vlt = ConfigSlider(default=15, increment=5, limits=(0, 255))
            if getBoxType() == 'tm2t':
                fan.pwm = ConfigSlider(default=150,
                                       increment=5,
                                       limits=(0, 255))
            if getBoxType() == 'tmsingle':
                fan.pwm = ConfigSlider(default=100,
                                       increment=5,
                                       limits=(0, 255))
            else:
                fan.pwm = ConfigSlider(default=50,
                                       increment=5,
                                       limits=(0, 255))
            fan.vlt_standby = ConfigSlider(default=5,
                                           increment=5,
                                           limits=(0, 255))
            fan.pwm_standby = ConfigSlider(default=0,
                                           increment=5,
                                           limits=(0, 255))
            fan.vlt.addNotifier(boundFunction(setVlt, self, fanid))
            fan.pwm.addNotifier(boundFunction(setPWM, self, fanid))
            config.fans.append(fan)
 def __init__(self):
     self.serverlist = []
     config.plugins.vlcplayer = ConfigSubsection()
     config.plugins.vlcplayer.servercount = ConfigInteger(0)
     config.plugins.vlcplayer.servers = ConfigSubList()
     config.plugins.vlcplayer.defaultserver = ConfigText("", False)
     for servernum in range(0, config.plugins.vlcplayer.servercount.value):
         self.new()
Exemple #13
0
def InitCiConfig():
	config.ci = ConfigSubList()
	for slot in range(MAX_NUM_CI):
		config.ci.append(ConfigSubsection())
		config.ci[slot].canDescrambleMultipleServices = ConfigSelection(choices = [("auto", _("Auto")), ("no", _("No")), ("yes", _("Yes"))], default = "auto")
		if SystemInfo["CommonInterfaceSupportsHighBitrates"]:
			config.ci[slot].canHandleHighBitrates = ConfigSelection(choices = [("no", _("No")), ("yes", _("Yes"))], default = "yes")
			config.ci[slot].canHandleHighBitrates.slotid = slot
			config.ci[slot].canHandleHighBitrates.addNotifier(setCIBitrate)
Exemple #14
0
def InitParentalControl():
    global parentalControl
    parentalControl = ParentalControl()
    config.ParentalControl = ConfigSubsection()
    config.ParentalControl.configured = ConfigYesNo(default=False)
    config.ParentalControl.mode = ConfigSelection(default="simple",
                                                  choices=[
                                                      ("simple", _("simple")),
                                                      ("complex", _("complex"))
                                                  ])
    config.ParentalControl.storeservicepin = ConfigSelection(
        default="never",
        choices=[("never", _("never")), ("5", _("%d minutes") % 5),
                 ("30", _("%d minutes") % 30), ("60", _("%d minutes") % 60),
                 ("standby", _("until standby/restart"))])
    config.ParentalControl.servicepinactive = ConfigYesNo(default=False)
    config.ParentalControl.setuppinactive = ConfigYesNo(default=False)
    config.ParentalControl.type = ConfigSelection(default="blacklist",
                                                  choices=[(LIST_WHITELIST,
                                                            _("whitelist")),
                                                           (LIST_BLACKLIST,
                                                            _("blacklist"))])
    config.ParentalControl.setuppin = ConfigPIN(default=-1)

    config.ParentalControl.retries = ConfigSubsection()
    config.ParentalControl.retries.setuppin = ConfigSubsection()
    config.ParentalControl.retries.setuppin.tries = ConfigInteger(default=3)
    config.ParentalControl.retries.setuppin.time = ConfigInteger(default=3)
    config.ParentalControl.retries.servicepin = ConfigSubsection()
    config.ParentalControl.retries.servicepin.tries = ConfigInteger(default=3)
    config.ParentalControl.retries.servicepin.time = ConfigInteger(default=3)

    config.ParentalControl.servicepin = ConfigSubList()

    config.ParentalControl.config_sections = ConfigSubsection()
    config.ParentalControl.config_sections.main_menu = ConfigYesNo(
        default=False)
    config.ParentalControl.config_sections.configuration = ConfigYesNo(
        default=False)
    config.ParentalControl.config_sections.timer_menu = ConfigYesNo(
        default=False)
    config.ParentalControl.config_sections.movie_list = ConfigYesNo(
        default=False)
    config.ParentalControl.config_sections.plugin_browser = ConfigYesNo(
        default=False)
    config.ParentalControl.config_sections.standby_menu = ConfigYesNo(
        default=False)
    config.ParentalControl.config_sections.software_update = ConfigYesNo(
        default=False)
    config.ParentalControl.config_sections.manufacturer_reset = ConfigYesNo(
        default=True)
    config.ParentalControl.config_sections.LDteam = ConfigYesNo(default=False)
    config.ParentalControl.config_sections.quickmenu = ConfigYesNo(
        default=False)

    for i in (0, 1, 2):
        config.ParentalControl.servicepin.append(ConfigPIN(default=-1))
	def loadFavoriteConfig(self):
		self.favoriteConfig = Config()
		if os.path.exists(self.FAVORITE_FILE):
			self.favoriteConfig.loadFromFile(self.FAVORITE_FILE)
		else:
			self.favoriteConfig.loadFromFile(self.FAVORITE_FILE_DEFAULT)
		self.favoriteConfig.entriescount =  ConfigInteger(0)
		self.favoriteConfig.Entries = ConfigSubList()
		self.initFavouriteConfig()
def InitParentalControl():
    global parentalControl
    config.ParentalControl = ConfigSubsection()
    config.ParentalControl.storeservicepin = ConfigSelection(
        default='never',
        choices=[('never', _('never')), ('5', _('%d minutes') % 5),
                 ('15', _('%d minutes') % 15), ('30', _('%d minutes') % 30),
                 ('60', _('%d minutes') % 60), ('120', _('%d minutes') % 120),
                 ('standby', _('until standby/restart'))])
    config.ParentalControl.configured = ConfigYesNo(default=False)
    config.ParentalControl.setuppinactive = ConfigYesNo(default=False)
    config.ParentalControl.retries = ConfigSubsection()
    config.ParentalControl.retries.servicepin = ConfigSubsection()
    config.ParentalControl.retries.servicepin.tries = ConfigInteger(default=3)
    config.ParentalControl.retries.servicepin.time = ConfigInteger(default=3)
    config.ParentalControl.servicepin = ConfigSubList()
    config.ParentalControl.servicepin.append(ConfigPIN(default=0))
    config.ParentalControl.age = ConfigSelection(
        default='18',
        choices=[('0', _('No age block'))] + list(
            ((str(x), '%d+' % x) for x in range(3, 19))))
    config.ParentalControl.hideBlacklist = ConfigYesNo(default=False)
    config.ParentalControl.config_sections = ConfigSubsection()
    config.ParentalControl.config_sections.main_menu = ConfigYesNo(
        default=False)
    if fileExists(
            '/usr/lib/enigma2/python/Plugins/Extensions/spazeMenu/plugin.pyo'
    ) or fileExists(
            '/usr/lib/enigma2/python/Plugins/Extensions/spazeMenu/plugin.so'):
        config.ParentalControl.config_sections.spzmenu = ConfigYesNo(
            default=False)
    config.ParentalControl.config_sections.configuration = ConfigYesNo(
        default=False)
    config.ParentalControl.config_sections.timer_menu = ConfigYesNo(
        default=False)
    config.ParentalControl.config_sections.plugin_browser = ConfigYesNo(
        default=False)
    config.ParentalControl.config_sections.standby_menu = ConfigYesNo(
        default=False)
    config.ParentalControl.config_sections.software_update = ConfigYesNo(
        default=False)
    config.ParentalControl.config_sections.manufacturer_reset = ConfigYesNo(
        default=True)
    config.ParentalControl.config_sections.movie_list = ConfigYesNo(
        default=False)
    config.ParentalControl.config_sections.context_menus = ConfigYesNo(
        default=False)
    config.ParentalControl.servicepinactive = config.ParentalControl.configured
    config.ParentalControl.setuppin = config.ParentalControl.servicepin[0]
    config.ParentalControl.retries.setuppin = config.ParentalControl.retries.servicepin
    config.ParentalControl.type = ConfigSelection(default='blacklist',
                                                  choices=[(LIST_BLACKLIST,
                                                            _('blacklist'))])
    parentalControl = ParentalControl()
Exemple #17
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]))
Exemple #18
0
def InitCiConfig():
	config.ci = ConfigSubList()
	for slot in range(MAX_NUM_CI):
		config.ci.append(ConfigSubsection())
		config.ci[slot].canDescrambleMultipleServices = ConfigSelection(choices = [("auto", _("Auto")), ("no", _("No")), ("yes", _("Yes"))], default = "no")
		if SystemInfo["CommonInterfaceSupportsHighBitrates"]:
			if getBrandOEM() == "dags":
				config.ci[slot].canHandleHighBitrates = ConfigSelection(choices = [("no", _("No")), ("yes", _("Yes"))], default = "yes")
			else: 
				config.ci[slot].canHandleHighBitrates = ConfigSelection(choices = [("no", _("No")), ("yes", _("Yes"))], default = "no")
			config.ci[slot].canHandleHighBitrates.slotid = slot
			config.ci[slot].canHandleHighBitrates.addNotifier(setCIBitrate)
		if SystemInfo["CommonInterfaceCIDelay"]:
			config.ci.dvbCiDelay = ConfigSelection(default = "256", choices = [("16"), ("32"), ("64"), ("128"), ("256")] )
			config.ci.dvbCiDelay.addNotifier(setdvbCiDelay)
Exemple #19
0
def InitParentalControl():
    global parentalControl
    parentalControl = ParentalControl()
    config.ParentalControl = ConfigSubsection()
    config.ParentalControl.configured = ConfigYesNo(default=True)  # [iq]
    config.ParentalControl.mode = ConfigSelection(default="simple",
                                                  choices=[
                                                      ("simple", _("simple")),
                                                      ("complex", _("complex"))
                                                  ])
    config.ParentalControl.storeservicepin = ConfigSelection(
        default="never",
        choices=[("never", _("never")), ("5", _("%d minutes") % 5),
                 ("30", _("%d minutes") % 30), ("60", _("%d minutes") % 60),
                 ("standby", _("until standby/restart"))])
    config.ParentalControl.servicepinactive = ConfigYesNo(default=False)
    config.ParentalControl.setuppinactive = ConfigYesNo(default=True)  # [iq]
    config.ParentalControl.type = ConfigSelection(default="blacklist",
                                                  choices=[(LIST_WHITELIST,
                                                            _("whitelist")),
                                                           (LIST_BLACKLIST,
                                                            _("blacklist"))])
    # [iq
    config.ParentalControl.setuppin = ConfigPIN(default=0000)
    config.ParentalControl.mastersetuppin = ConfigPIN(default=2011)

    config.ParentalControl.extrastationspin = ConfigPIN(default=1149)
    # iq]

    config.ParentalControl.retries = ConfigSubsection()
    # [iq
    config.ParentalControl.retries.extrastationspin = ConfigSubsection()
    config.ParentalControl.retries.extrastationspin.tries = ConfigInteger(
        default=3)
    config.ParentalControl.retries.extrastationspin.time = ConfigInteger(
        default=3)
    # iq]
    config.ParentalControl.retries.setuppin = ConfigSubsection()
    config.ParentalControl.retries.setuppin.tries = ConfigInteger(default=3)
    config.ParentalControl.retries.setuppin.time = ConfigInteger(default=3)
    config.ParentalControl.retries.servicepin = ConfigSubsection()
    config.ParentalControl.retries.servicepin.tries = ConfigInteger(default=3)
    config.ParentalControl.retries.servicepin.time = ConfigInteger(default=3)

    config.ParentalControl.servicepin = ConfigSubList()

    for i in (0, 1, 2):
        config.ParentalControl.servicepin.append(ConfigPIN(default=-1))
def InitParentalControl():
	config.ParentalControl = ConfigSubsection()
	config.ParentalControl.storeservicepin = ConfigSelection(default="never", choices=[("never", _("never")), ("5", _("%d minutes") % 5), ("30", _("%d minutes") % 30), ("60", _("%d minutes") % 60), ("standby", _("until standby/restart"))])
	config.ParentalControl.configured = ConfigYesNo(default=False)
	config.ParentalControl.setuppinactive = ConfigYesNo(default=False)
	config.ParentalControl.retries = ConfigSubsection()
	config.ParentalControl.retries.servicepin = ConfigSubsection()
	config.ParentalControl.retries.servicepin.tries = ConfigInteger(default=3)
	config.ParentalControl.retries.servicepin.time = ConfigInteger(default=3)
	config.ParentalControl.servicepin = ConfigSubList()
	config.ParentalControl.servicepin.append(ConfigPIN(default=0))
	if haveClassifications and "AUS" in classificationCodes:
		# Invert the classification code lookup and use the mapping
		# that has the highest integer code value
		inverted = {
			classif[0]: code for code, classif in sorted(
				classificationCodes["AUS"][0].items(), key=itemgetter(0), reverse=False)
			if classif[0]
		}
		# Construct the choice list from the inverted classification
		# list, sort in ascending numerical code and add 3 to match
		# the values used in the default age-based ratings.
		choices = [("0", _("No rating block"))] + [(str(code + 3), classif) for classif, code in sorted(inverted.items(), key=itemgetter(1))]
	else:
		choices = [("0", _("No age block"))] + [(str(x), "%d+" % x) for x in range(3, 19)]
	# Use the most permissive classification limit as the default
	config.ParentalControl.age = ConfigSelection(default=choices[-1][0], choices=choices)
	config.ParentalControl.hideBlacklist = ConfigYesNo(default=False)
	config.ParentalControl.config_sections = ConfigSubsection()
	config.ParentalControl.config_sections.main_menu = ConfigYesNo(default=False)
	config.ParentalControl.config_sections.configuration = ConfigYesNo(default=False)
	config.ParentalControl.config_sections.timer_menu = ConfigYesNo(default=False)
	config.ParentalControl.config_sections.plugin_browser = ConfigYesNo(default=False)
	config.ParentalControl.config_sections.standby_menu = ConfigYesNo(default=False)
	config.ParentalControl.config_sections.software_update = ConfigYesNo(default=False)
	config.ParentalControl.config_sections.manufacturer_reset = ConfigYesNo(default=True)
	config.ParentalControl.config_sections.movie_list = ConfigYesNo(default=False)
	config.ParentalControl.config_sections.context_menus = ConfigYesNo(default=False)
	config.ParentalControl.config_sections.vixmenu = ConfigYesNo(default=False)

	# Added for backwards compatibility with some 3rd party plugins that depend on this config
	config.ParentalControl.servicepinactive = config.ParentalControl.configured
	config.ParentalControl.setuppin = config.ParentalControl.servicepin[0]
	config.ParentalControl.retries.setuppin = config.ParentalControl.retries.servicepin
	config.ParentalControl.type = ConfigSelection(default="blacklist", choices=[(LIST_BLACKLIST, _("blacklist"))])

	global parentalControl
	parentalControl = ParentalControl()
Exemple #21
0
 def getPMTInfo(self):
     service = self.session.nav.getCurrentService()
     audio = service and service.audioTracks()
     n = audio and audio.getNumberOfTracks() or 0
     if n > 0:
         from Title import ConfigFixedText
         from Project import iso639language
         from Components.config import config, ConfigSubsection, ConfigSubList, ConfigSelection, ConfigYesNo
         self.t.properties.audiotracks = ConfigSubList()
         for x in range(n):
             i = audio.getTrackInfo(x)
             DVB_lang = i.getLanguage()
             description = i.getDescription()
             pid = str(i.getPID())
             if description == "MPEG":
                 description = "MP2"
             print "[audiotrack] pid:", pid, "description:", description, "language:", DVB_lang, "count:", x, "active:", (
                 x < 8)
             self.t.properties.audiotracks.append(ConfigSubsection())
             self.t.properties.audiotracks[-1].active = ConfigYesNo(
                 default=(x < 8))
             self.t.properties.audiotracks[-1].format = ConfigFixedText(
                 description)
             choicelist = iso639language.getChoices()
             determined_language = iso639language.determineLanguage(
                 DVB_lang)
             self.t.properties.audiotracks[-1].language = ConfigSelection(
                 choices=choicelist, default=determined_language)
             self.t.properties.audiotracks[-1].pid = ConfigFixedText(pid)
             self.t.properties.audiotracks[-1].DVB_lang = ConfigFixedText(
                 DVB_lang)
     sAspect = service.info().getInfo(iServiceInformation.sAspect)
     if sAspect in (1, 2, 5, 6, 9, 0xA, 0xD, 0xE):
         aspect = "4:3"
     else:
         aspect = "16:9"
     self.t.properties.aspect.setValue(aspect)
     self.t.VideoType = service.info().getInfo(
         iServiceInformation.sVideoType)
     self.t.VideoPID = service.info().getInfo(iServiceInformation.sVideoPID)
     xres = service.info().getInfo(iServiceInformation.sVideoWidth)
     yres = service.info().getInfo(iServiceInformation.sVideoHeight)
     self.t.resolution = (xres, yres)
     self.t.framerate = service.info().getInfo(
         iServiceInformation.sFrameRate)
     self.t.progressive = service.info().getInfo(
         iServiceInformation.sProgressive)
Exemple #22
0
def InitCiConfig():
	config.ci = ConfigSubList()
	config.cimisc = ConfigSubsection()
	for slot in list(range(MAX_NUM_CI)):
		config.ci.append(ConfigSubsection())
		config.ci[slot].enabled = ConfigYesNo(default=True)
		config.ci[slot].enabled.slotid = slot
		config.ci[slot].enabled.addNotifier(setCIEnabled)
		config.ci[slot].canDescrambleMultipleServices = ConfigSelection(choices=[("auto", _("Auto")), ("no", _("No")), ("yes", _("Yes"))], default="auto")
		config.ci[slot].use_static_pin = ConfigYesNo(default=True)
		config.ci[slot].static_pin = ConfigPIN(default=0)
		config.ci[slot].show_ci_messages = ConfigYesNo(default=True)
		if BoxInfo.getItem("CommonInterfaceSupportsHighBitrates"):
			if getBrandOEM() in ('dags', 'blackbox'):
				config.ci[slot].canHandleHighBitrates = ConfigYesNo(default=True)
			else:
				config.ci[slot].canHandleHighBitrates = ConfigYesNo(default=False)
			config.ci[slot].canHandleHighBitrates.slotid = slot
			config.ci[slot].canHandleHighBitrates.addNotifier(setCIBitrate)
		if BoxInfo.getItem("RelevantPidsRoutingSupport"):
			global relevantPidsRoutingChoices
			if not relevantPidsRoutingChoices:
				relevantPidsRoutingChoices = [("no", _("No")), ("yes", _("Yes"))]
				default = "no"
				fileName = "/proc/stb/tsmux/ci%d_relevant_pids_routing_choices"
			if fileExists(fileName, 'r'):
				relevantPidsRoutingChoices = []
				fd = open(fileName, 'r')
				data = fd.read()
				data = data.split()
				for x in data:
					relevantPidsRoutingChoices.append((x, _(x)))
				if default not in data:
					default = data[0]
			config.ci[slot].relevantPidsRouting = ConfigSelection(choices=relevantPidsRoutingChoices, default=default)
			config.ci[slot].relevantPidsRouting.slotid = slot
			config.ci[slot].relevantPidsRouting.addNotifier(setRelevantPidsRouting)
	if BoxInfo.getItem("CommonInterfaceCIDelay"):
		config.cimisc.dvbCiDelay = ConfigSelection(default="256", choices=[("16", _("16")), ("32", _("32")), ("64", _("64")), ("128", _("128")), ("256", _("256"))])
		config.cimisc.dvbCiDelay.addNotifier(setdvbCiDelay)
	if getBrandOEM() in ('entwopia', 'tripledot', 'dreambox'):
		if BoxInfo.getItem("HaveCISSL"):
			config.cimisc.civersion = ConfigSelection(default="ciplus1", choices=[("auto", _("Auto")), ("ciplus1", _("CI Plus 1.2")), ("ciplus2", _("CI Plus 1.3")), ("legacy", _("CI Legacy"))])
		else:
			config.cimisc.civersion = ConfigSelection(default="legacy", choices=[("legacy", _("CI Legacy"))])
	else:
		config.cimisc.civersion = ConfigSelection(default="auto", choices=[("auto", _("Auto")), ("ciplus1", _("CI Plus 1.2")), ("ciplus2", _("CI Plus 1.3")), ("legacy", _("CI Legacy"))])
Exemple #23
0
def InitCiConfig():
    config.ci = ConfigSubList()
    for slot in range(MAX_NUM_CI):
        config.ci.append(ConfigSubsection())
        config.ci[slot].canDescrambleMultipleServices = ConfigSelection(
            choices=[('auto', _('Auto')), ('no', _('No')), ('yes', _('Yes'))],
            default='no')
        if SystemInfo['CommonInterfaceSupportsHighBitrates']:
            if getBrandOEM() == 'dags':
                config.ci[slot].canHandleHighBitrates = ConfigSelection(
                    choices=[('no', _('No')), ('yes', _('Yes'))],
                    default='yes')
            else:
                config.ci[slot].canHandleHighBitrates = ConfigSelection(
                    choices=[('no', _('No')), ('yes', _('Yes'))], default='no')
            config.ci[slot].canHandleHighBitrates.slotid = slot
            config.ci[slot].canHandleHighBitrates.addNotifier(setCIBitrate)
Exemple #24
0
	def createConfig(self):
		def setVlt(fancontrol, fanid, configElement):
			fancontrol.setVoltage(fanid, configElement.value)
		def setPWM(fancontrol, fanid, configElement):
			fancontrol.setPWM(fanid, configElement.value)

		config.fans = ConfigSubList()
		for fanid in range(self.getFanCount()):
			fan = ConfigSubsection()
			# [ IQON by knuth
			fan.vlt = ConfigSlider(default = 15, increment = 5, limits = (0, 255))
			fan.pwm = ConfigSlider(default = 15, increment = 5, limits = (0, 255))
			fan.vlt_standby = ConfigSlider(default = 5, increment = 5, limits = (0, 255))
			fan.pwm_standby = ConfigSlider(default = 5, increment = 5, limits = (0, 255))
			# IQON by knuth ]
			fan.vlt.addNotifier(boundFunction(setVlt, self, fanid))
			fan.pwm.addNotifier(boundFunction(setPWM, self, fanid))
			config.fans.append(fan)
Exemple #25
0
	def __init__(self, session, action, value, url):
		self.defaultImg = 'Extensions/OnDemand/icons/FolderIcon.png'

		self.showWMA = str(config.ondemand.ShowiRadioWMA.value)
		self.showDefault = str(config.ondemand.ShowTuneinDefault.value)
		self.showIcon = str(config.ondemand.ShowTuneinLogos.value)

		if self.showIcon == 'True':
			if self.showDefault == 'False':
				self.defaultImg = ''

		self.favoriteConfig = Config()
		if os_path.exists(FAVORITE_FILE):
			self.favoriteConfig.loadFromFile(FAVORITE_FILE)

		self.favoriteConfig.entriescount = ConfigInteger(0)
		self.favoriteConfig.Entries = ConfigSubList()
		self.initFavoriteConfig()
		self.genreList = []
		self.getGenreList(self.genreList)

		self.screenName = "TuneinStreamsThumbCommon"
		StreamsThumbCommon.__init__(self, session, action, value, url, self.screenName)

		self.skin = """
				<screen position="0,0" size="e,e" flags="wfNoBorder" >
					<widget name="lab1" position="0,0" size="e,e" font="Regular;24" halign="center" valign="center" transparent="0" zPosition="5" />
					<widget source="Title" render="Label" position="20,0" size="e,50" font="Regular;32" />
					<widget name="list" position="0,50" size="e,e-50" scrollbarMode="showOnDemand" transparent="1" />
					<ePixmap pixmap="ViX-Common/buttons/green.png" position="800,10" size="40,40" transparent="1" alphatest="on" />
					<widget source="key_green" render="Label" position="810,0" zPosition="1" size="200,40" font="Regular;20" valign="center" halign="center" transparent="1" />
				</screen>"""

		self["key_green"] = StaticText(_("Add to Favorites"))

		self["genreActions"] = ActionMap(["ColorActions"],
		{
			"red": self.red_pressed,
			"green": self.green_pressed,
			"yellow": self.yellow_pressed,
			"blue": self.blue_pressed,

		}, -1)
Exemple #26
0
def InitCiConfig():
    config.ci = ConfigSubList()
    config.cimisc = ConfigSubsection()
    if BoxInfo.getItem("CommonInterface"):
        for slot in range(BoxInfo.getItem("CommonInterface")):
            config.ci.append(ConfigSubsection())
            config.ci[slot].canDescrambleMultipleServices = ConfigSelection(
                choices=[("auto", _("auto")), ("no", _("no")),
                         ("yes", _("yes"))],
                default="auto")
            config.ci[slot].use_static_pin = ConfigYesNo(default=True)
            config.ci[slot].static_pin = ConfigPIN(default=0)
            config.ci[slot].show_ci_messages = ConfigYesNo(default=True)
            if BoxInfo.getItem("CI%dSupportsHighBitrates" % slot):
                config.ci[slot].canHandleHighBitrates = ConfigYesNo(
                    default=True)
                config.ci[slot].canHandleHighBitrates.slotid = slot
                config.ci[slot].canHandleHighBitrates.addNotifier(setCIBitrate)
            if BoxInfo.getItem("CI%dRelevantPidsRoutingSupport" % slot):
                config.ci[slot].relevantPidsRouting = ConfigYesNo(
                    default=False)
                config.ci[slot].relevantPidsRouting.slotid = slot
                config.ci[slot].relevantPidsRouting.addNotifier(
                    setRelevantPidsRouting)
        if BoxInfo.getItem("CommonInterfaceCIDelay"):
            config.cimisc.dvbCiDelay = ConfigSelection(default="256",
                                                       choices=[("16"), ("32"),
                                                                ("64"),
                                                                ("128"),
                                                                ("256")])
            config.cimisc.dvbCiDelay.addNotifier(setdvbCiDelay)
        if BoxInfo.getItem("HaveCISSL"):
            config.cimisc.civersion = ConfigSelection(
                default="ciplus1",
                choices=[("auto", _("Auto")), ("ciplus1", _("CI Plus 1.2")),
                         ("ciplus2", _("CI Plus 1.3")),
                         ("legacy", _("CI Legacy"))])
        else:
            config.cimisc.civersion = ConfigSelection(
                default="auto",
                choices=[("auto", _("Auto")), ("ciplus1", _("CI Plus 1.2")),
                         ("ciplus2", _("CI Plus 1.3")),
                         ("legacy", _("CI Legacy"))])
Exemple #27
0
 def saveconfig(self):
     nim_config_list = []
     if self.initial_state != config.clientmode.enabled.value and self.initial_state == False:  # switching to client mode
         # save normal mode config so it can be reinsated when returning to normal mode
         nim_config_list = []
         for x in config.Nims:
             nim_config_list.append(x.getSavedValue())
         import json
         config.clientmode.nim_cache.value = json.dumps(nim_config_list)
         config.clientmode.remote_fallback_enabled_cache.value = config.usage.remote_fallback_enabled.value
         config.clientmode.remote_fallback_cache.value = config.usage.remote_fallback.value
         config.clientmode.timer_sanity_check_enabled_cache.value = config.usage.timer_sanity_check_enabled.value
         # normal mode config values saved
     if config.clientmode.enabled.value:
         config.usage.remote_fallback_enabled.value = True
         config.usage.remote_fallback.value = "http://%s:%d" % (
             self.getRemoteAddress(),
             config.clientmode.serverStreamingPort.value)
         config.usage.timer_sanity_check_enabled.value = False
     elif self.initial_state != config.clientmode.enabled.value:  # switching back to normal mode
         # load nim config from config.clientmode.nimcache
         import json
         nim_config_list = json.loads(config.clientmode.nim_cache.value)
         config.clientmode.nim_cache.value = ""
         config.Nims = ConfigSubList()
         for x in nim_config_list:
             tuner = ConfigSubsection()
             tuner.setSavedValue(x)
             config.Nims.append(tuner)
         config.Nims.save()
         # nim config loaded... but needs restart
         # reinstate normal mode values
         config.usage.remote_fallback_enabled.value = config.clientmode.remote_fallback_enabled_cache.value
         config.usage.remote_fallback.value = config.clientmode.remote_fallback_cache.value
         config.usage.timer_sanity_check_enabled.value = config.clientmode.timer_sanity_check_enabled_cache.value
         # reset some client mode settings
         config.clientmode.remote_fallback_enabled_cache.value = False
         config.clientmode.remote_fallback_cache.value = ""
         config.clientmode.timer_sanity_check_enabled_cache.value = True
     config.usage.save()
     config.clientmode.save()
     configfile.save()
def InitParentalControl():
    global parentalControl
    parentalControl = ParentalControl()
    config.ParentalControl = ConfigSubsection()
    config.ParentalControl.configured = ConfigYesNo(default=False)
    config.ParentalControl.mode = ConfigSelection(default="simple",
                                                  choices=[
                                                      ("simple", _("simple")),
                                                      ("complex", _("complex"))
                                                  ])
    config.ParentalControl.storeservicepin = ConfigSelection(
        default="never",
        choices=[("never", _("never")), ("5", _("%d minutes") % 5),
                 ("30", _("%d minutes") % 30), ("60", _("%d minutes") % 60),
                 ("standby", _("until standby/restart"))])
    config.ParentalControl.servicepinactive = ConfigYesNo(default=False)
    config.ParentalControl.setuppinactive = ConfigYesNo(default=False)
    config.ParentalControl.type = ConfigSelection(default="blacklist",
                                                  choices=[(LIST_WHITELIST,
                                                            _("whitelist")),
                                                           (LIST_BLACKLIST,
                                                            _("blacklist"))])
    config.ParentalControl.setuppin = ConfigPIN(default=-1)

    config.ParentalControl.retries = ConfigSubsection()
    config.ParentalControl.retries.setuppin = ConfigSubsection()
    config.ParentalControl.retries.setuppin.tries = ConfigInteger(default=3)
    config.ParentalControl.retries.setuppin.time = ConfigInteger(default=3)
    config.ParentalControl.retries.servicepin = ConfigSubsection()
    config.ParentalControl.retries.servicepin.tries = ConfigInteger(default=3)
    config.ParentalControl.retries.servicepin.time = ConfigInteger(default=3)
    config.ParentalControl.servicepin = ConfigSubList()
    config.ParentalControl.age = ConfigSelection(
        default="18",
        choices=[(0, _("No age block"))] + list(
            (str(x), "%d+" % x) for x in range(3, 19)))

    for i in (0, 1, 2):
        config.ParentalControl.servicepin.append(ConfigPIN(default=-1))
Exemple #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])
Exemple #30
0
		("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]


config.plugins.AdvHdmiCec = ConfigSubsection()
config.plugins.AdvHdmiCec.enable = ConfigYesNo(default=False)
config.plugins.AdvHdmiCec.debug = ConfigYesNo(default=False)
config.plugins.AdvHdmiCec.enable_power_on = ConfigYesNo(default=True)
config.plugins.AdvHdmiCec.enable_power_off = ConfigYesNo(default=True)
config.plugins.AdvHdmiCec.disable_after_enigmastart = ConfigYesNo(default=False)
config.plugins.AdvHdmiCec.disable_from_webif = ConfigYesNo(default=False)
config.plugins.AdvHdmiCec.entriescount = ConfigInteger(0)
config.plugins.AdvHdmiCec.Entries = ConfigSubList()
config.plugins.AdvHdmiCec.show_in = ConfigSelection(choices=[
		("system", _("systemmenue")),
		("plugin", _("pluginmenue")),
		("extension", _("extensions")),
	], default="system")
initTimeSpanEntryList()

ADVHDMI_VERSION = "1.4.3"

# HDMI-Hook-Events
# To implement a hook, just instantiate a AdvHdmiCecIF,
# and overwrite the methods before_event and/or after_event

# Events with boolean-return, that means if the CEC-signal has to be send / handled
ADVHDMI_BEFORE_POWERON = "BEFORE_POWERON"