def _getConfig(self): # Name, configElement, HelpTxt, reloadConfig try: self.list = [] self.list.append( getConfigListEntry( _("Enable Backup"), config.plugins.epgbackup.backup_enabled, _("Should the Backup-Functionality be enabled?\nFor more Information have a look at the Help-Screen." ), True)) if config.plugins.epgbackup.backup_enabled.value: self.list.append( getConfigListEntry( _("make Backup on start"), config.plugins.epgbackup. make_backup_after_unsuccess_restore, _("Make a backup before starting enigma. A backup-file will only be created, if no valid backup-file could be restored.\nNote: It's logically the same as making a backup at the ending of enigma, because the file didn't change in the meanwhile." ), False)) if epgbackup and epgbackup.epgrefresh_instance: self.list.append( getConfigListEntry( _("make Backup after EPGRefresh"), config.plugins.epgbackup.callAfterEPGRefresh, _("Make a backup after EPGRefresh."), False)) self.list.append( getConfigListEntry( _("make Backup every"), config.plugins.epgbackup.backupSaveInterval, _("Make backups periodically?"), False)) self.list.append( getConfigListEntry( _("Restore-Strategy"), config.plugins.epgbackup.backup_strategy, None, False)) self.list.append( getConfigListEntry( _("Valid Filesize"), config.plugins.epgbackup.filesize_valid, _("EPG-Files with a less size of this value (MiB) won't be backuped." ), False)) self.list.append( getConfigListEntry( _("Valid Age"), config.plugins.epgbackup.timespan_valid, _("Only keep EPG-Backup-Files younger than this days." ), False)) self.list.append( getConfigListEntry( _("Show Advanced Options"), NoSave(config.plugins.epgbackup.showadvancedoptions), _("Display more Options"), True)) if config.plugins.epgbackup.showadvancedoptions.value: self.list.append( getConfigListEntry( _("EPG-File-Write Wait"), config.plugins.epgbackup.epgwrite_wait, _("How many seconds should EPGBackup be wait to check if the EPG-File-Size didn't change before it starts the Backup." ), False)) self.list.append( getConfigListEntry( _("Maximum Boot-Count"), config.plugins.epgbackup.max_boot_count, _("After that times of unsuccesfully boot enigma2, the EPG-File will be deleted." ), False)) self.list.append( getConfigListEntry( _("Enable Debug"), config.plugins.epgbackup.enable_debug, _("Should debugmessages be printed?\nMessages from the shell-script will be append to a file. The filename will be added with the current date" ), True)) if config.plugins.epgbackup.enable_debug.value: self.list.append( getConfigListEntry( _("append plugin-messages"), config.plugins.epgbackup.plugin_debug_in_file, _("Should the debug-messages from the enigma-plugin also be append to the logfile? If you choose no the messages will print only to standard-out." ), False)) self.list.append( getConfigListEntry( _("Log-directory"), config.plugins.epgbackup.backup_log_dir, _("Directory for the Logfiles."), False)) if gUserScriptExists: self.list.append( getConfigListEntry( _("Show in User-Scripts"), config.plugins.epgbackup.showin_usr_scripts, _("Should the Manage-Script be shown in User-Scripts?" ), False)) self.list.append( getConfigListEntry( _("Show messages in background"), config.plugins.epgbackup.show_messages_background, _("Pop a notification if called in background?"), False)) self.list.append( getConfigListEntry( _("Show setup in"), config.plugins.epgbackup.show_setup_in, _("Where should this setup be displayed?"), False)) self.list.append( getConfigListEntry( _("Show \"Make Backup\" in extension menu"), config.plugins.epgbackup. show_make_backup_in_extmenu, _("Enable this to be able to make a Backup-File from within the extension menu." ), False)) self.list.append( getConfigListEntry( _("Show \"Restore Backup\" in extension menu"), config.plugins.epgbackup. show_backuprestore_in_extmenu, _("Enable this to be able to start a restore of a Backup-File from within the extension menu." ), False)) self["config"].list = self.list self["config"].setList(self.list) except: debugOut("_getConfig-Error:\n" + str(format_exc()), forced=True)
from re import compile as re_compile, search as re_search from pythonwifi.iwlibs import getNICnames, Wireless, Iwfreq, getWNICnames from pythonwifi import flags as wififlags list = [] list.append("WEP") list.append("WPA") list.append("WPA2") list.append("WPA/WPA2") weplist = [] weplist.append("ASCII") weplist.append("HEX") config.plugins.wlan = ConfigSubsection() config.plugins.wlan.essid = NoSave(ConfigText(default="home", fixed_size=False)) config.plugins.wlan.hiddenessid = NoSave( ConfigText(default="home", fixed_size=False)) config.plugins.wlan.encryption = ConfigSubsection() config.plugins.wlan.encryption.enabled = NoSave(ConfigYesNo(default=True)) config.plugins.wlan.encryption.type = NoSave( ConfigSelection(list, default="WPA/WPA2")) config.plugins.wlan.encryption.wepkeytype = NoSave( ConfigSelection(weplist, default="ASCII")) config.plugins.wlan.encryption.psk = NoSave( ConfigPassword(default="mysecurewlan", fixed_size=False)) class Wlan: def __init__(self, iface):
############# SUPPORTED MEDIA ################# VIDEO_EXTENSIONS = ('.3gp', '3g2', '.asf', '.avi', '.flv', '.mp4', '.mkv', '.mpeg', '.mov' '.mpg', '.wmv', '.divx', '.vob', '.iso', '.ts', '.m3u8') AUDIO_EXTENSIONS = ('.mp2', '.mp3', '.wma', '.ogg', '.dts', '.flac', '.wav') SUBTITLES_EXTENSIONS = ('.srt', ) PLAYLIST_EXTENSIONS = ('.m3u', 'pls') ARCHIVE_EXTENSIONS = ('.rar', '.zip', '.7zip') PLAYABLE_EXTENSIONS = VIDEO_EXTENSIONS + AUDIO_EXTENSIONS MEDIA_EXTENSIONS = VIDEO_EXTENSIONS + AUDIO_EXTENSIONS + ARCHIVE_EXTENSIONS + PLAYLIST_EXTENSIONS + SUBTITLES_EXTENSIONS ################## Player config ##################################### config.plugins.archivCZSK.videoPlayer = ConfigSubsection() config.plugins.archivCZSK.videoPlayer.info = NoSave(ConfigNothing()) playertype = [(videoPlayerInfo.type, videoPlayerInfo.getName())] config.plugins.archivCZSK.videoPlayer.exitFix = ConfigYesNo(default=False) config.plugins.archivCZSK.videoPlayer.detectedType = ConfigSelection( choices=playertype) if videoPlayerInfo.isRTMPSupported(): config.plugins.archivCZSK.videoPlayer.seeking = ConfigYesNo(default=True) else: config.plugins.archivCZSK.videoPlayer.seeking = ConfigYesNo(default=False) choicelist = [('standard', _('standard player')), ('custom', _('custom player (subtitle support)'))] config.plugins.archivCZSK.videoPlayer.type = ConfigSelection( default="custom", choices=choicelist) config.plugins.archivCZSK.videoPlayer.useVideoController = ConfigYesNo( default=True)
def createConfig(self, *args): config.pep = ConfigSubsection() config.pep.configsteps = NoSave( ConfigSelection(choices=[1, 5, 10, 25], default=1)) if os.path.exists("/proc/stb/vmpeg/0/pep_contrast"): def setContrast(config): myval = int(config.value * 256) try: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_contrast" ) print("[VideoEnhancement] setting contrast to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_contrast", "w").write("%0.8X" % myval) except IOError: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_contrast failed." ) if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.contrast = ConfigSlider(default=128, limits=(0, 255)) config.pep.contrast.addNotifier(setContrast) else: config.pep.contrast = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/pep_saturation"): def setSaturation(config): myval = int(config.value * 256) try: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_saturation" ) print("[VideoEnhancement] setting saturation to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_saturation", "w").write("%0.8X" % myval) except IOError: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_saturation failed." ) if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.saturation = ConfigSlider(default=128, limits=(0, 255)) config.pep.saturation.addNotifier(setSaturation) else: config.pep.saturation = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/pep_hue"): def setHue(config): myval = int(config.value * 256) try: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_hue" ) print("[VideoEnhancement] setting hue to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_hue", "w").write("%0.8X" % myval) except IOError: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_hue failed." ) if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.hue = ConfigSlider(default=128, limits=(0, 255)) config.pep.hue.addNotifier(setHue) else: config.pep.hue = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/pep_brightness"): def setBrightness(config): myval = int(config.value * 256) try: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_brightness" ) print("[VideoEnhancement] setting brightness to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_brightness", "w").write("%0.8X" % myval) except IOError: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_brightness failed." ) if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.brightness = ConfigSlider(default=128, limits=(0, 255)) config.pep.brightness.addNotifier(setBrightness) else: config.pep.brightness = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/pep_block_noise_reduction"): def setBlock_noise_reduction(config): myval = int(config.value) try: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_block_noise_reduction" ) print( "[VideoEnhancement] setting block_noise_reduction to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_block_noise_reduction", "w").write("%0.8X" % myval) except IOError: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_block_noise_reduction failed." ) if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.block_noise_reduction = ConfigSlider(default=0, limits=(0, 5)) config.pep.block_noise_reduction.addNotifier( setBlock_noise_reduction) else: config.pep.block_noise_reduction = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/pep_mosquito_noise_reduction"): def setMosquito_noise_reduction(config): myval = int(config.value) try: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_mosquito_noise_reduction" ) print( "[VideoEnhancement] setting mosquito_noise_reduction to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_mosquito_noise_reduction", "w").write("%0.8X" % myval) except IOError: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_mosquito_noise_reduction failed." ) if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.mosquito_noise_reduction = ConfigSlider(default=0, limits=(0, 5)) config.pep.mosquito_noise_reduction.addNotifier( setMosquito_noise_reduction) else: config.pep.mosquito_noise_reduction = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/pep_digital_contour_removal"): def setDigital_contour_removal(config): myval = int(config.value) try: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_digital_contour_removal" ) print( "[VideoEnhancement] setting digital_contour_removal to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_digital_contour_removal", "w").write("%0.8X" % myval) except IOError: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_digital_contour_removal failed." ) if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.digital_contour_removal = ConfigSlider(default=0, limits=(0, 5)) config.pep.digital_contour_removal.addNotifier( setDigital_contour_removal) else: config.pep.digital_contour_removal = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/pep_split"): def setSplitMode(config): try: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_split" ) print("[VideoEnhancement] setting splitmode to:", str(config.value)) open("/proc/stb/vmpeg/0/pep_split", "w").write(str(config.value)) except IOError: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_split failed." ) if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.split = ConfigSelection(choices={ "off": _("Off"), "left": _("Left"), "right": _("Right") }, default="off") config.pep.split.addNotifier(setSplitMode) else: config.pep.split = NoSave(ConfigNothing()) if SystemInfo["ScalerSharpness"]: def setSharpness(config): myval = int(config.value * 256) try: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_sharpness" ) print("[VideoEnhancement] setting sharpness to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_sharpness", "w").write("%0.8X" % myval) except IOError: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_sharpness failed." ) if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.sharpness = ConfigSlider(default=0, limits=(0, 255)) config.pep.sharpness.addNotifier(setSharpness) else: config.pep.sharpness = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/pep_auto_flesh"): def setAutoflesh(config): myval = int(config.value) try: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_auto_flesh" ) print("[VideoEnhancement] setting auto_flesh to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_auto_flesh", "w").write("%0.8X" % myval) except IOError: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_auto_flesh failed." ) if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.auto_flesh = ConfigSlider(default=0, limits=(0, 4)) config.pep.auto_flesh.addNotifier(setAutoflesh) else: config.pep.auto_flesh = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/pep_green_boost"): def setGreenboost(config): myval = int(config.value) try: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_green_boost" ) print("[VideoEnhancement] setting green_boost to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_green_boost", "w").write("%0.8X" % myval) except IOError: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_green_boost failed." ) if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.green_boost = ConfigSlider(default=0, limits=(0, 4)) config.pep.green_boost.addNotifier(setGreenboost) else: config.pep.green_boost = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/pep_blue_boost"): def setBlueboost(config): myval = int(config.value) try: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_blue_boost" ) print("[VideoEnhancement] setting blue_boost to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_blue_boost", "w").write("%0.8X" % myval) except IOError: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_blue_boost failed." ) if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.blue_boost = ConfigSlider(default=0, limits=(0, 4)) config.pep.blue_boost.addNotifier(setBlueboost) else: config.pep.blue_boost = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/pep_dynamic_contrast"): def setDynamic_contrast(config): myval = int(config.value) try: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_dynamic_contrast" ) print( "[VideoEnhancement] setting dynamic_contrast to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_dynamic_contrast", "w").write("%0.8X" % myval) except IOError: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_dynamic_contrast failed." ) if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.dynamic_contrast = ConfigSlider(default=0, limits=(0, 255)) config.pep.dynamic_contrast.addNotifier(setDynamic_contrast) else: config.pep.dynamic_contrast = NoSave(ConfigNothing()) try: x = config.av.scaler_sharpness.value except KeyError: if SystemInfo["ScalerSharpness"]: def setScaler_sharpness(config): myval = int(config.value) try: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_scaler_sharpness" ) print( "[VideoEnhancement] setting scaler_sharpness to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_scaler_sharpness", "w").write("%0.8X" % myval) except IOError: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_scaler_sharpness failed." ) if not VideoEnhancement.firstRun: self.setConfiguredValues() config.av.scaler_sharpness = ConfigSlider(default=13, limits=(0, 26)) config.av.scaler_sharpness.addNotifier(setScaler_sharpness) else: config.av.scaler_sharpness = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/pep_scaler_vertical_dejagging"): def setScaler_vertical_dejagging(configElement): myval = configElement.value and "enable" or "disable" try: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_scaler_vertical_dejagging" ) print( "[VideoEnhancement] setting scaler_vertical_dejagging to: %s" % myval) open("/proc/stb/vmpeg/0/pep_scaler_vertical_dejagging", "w").write(myval) except IOError: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/pep_scaler_vertical_dejagging failed." ) if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.scaler_vertical_dejagging = ConfigBoolean( default=False, descriptions={ False: _("Disabled"), True: _("Enabled") }) config.pep.scaler_vertical_dejagging.addNotifier( setScaler_vertical_dejagging) else: config.pep.scaler_vertical_dejagging = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/smooth"): def setSmooth(configElement): myval = configElement.value and "enable" or "disable" try: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/smooth") print("[VideoEnhancement] setting smooth to: %s" % myval) open("/proc/stb/vmpeg/0/smooth", "w").write(myval) except IOError: print( "[VideoEnhancement] Write to /proc/stb/vmpeg/0/smooth failed." ) if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.smooth = ConfigBoolean(default=False, descriptions={ False: _("Disabled"), True: _("Enabled") }) config.pep.smooth.addNotifier(setSmooth) else: config.pep.smooth = NoSave(ConfigNothing()) if VideoEnhancement.firstRun: self.setConfiguredValues() VideoEnhancement.firstRun = False
def getInitConfig(self): global cur_skin self.is_atile = False if cur_skin == 'AtileHD': self.is_atile = True self.title = _("Multibox_modFHD Setup") self.skin_base_dir = "/usr/share/enigma2/%s/" % cur_skin self.default_font_file = "font_atile_Roboto.xml" self.default_color_file = "colors_Original.xml" self.default_sb_file = "sb_Original.xml" self.default_clock_file = "clock_Original.xml" self.default_infobar_file = "infobar_Original.xml" self.default_background_file = "background_Original.xml" self.default_sib_file = "sib_Original.xml" self.default_ch_se_file = "ch_se_Original.xml" self.default_ev_file = "ev_Original.xml" self.default_emcsel_file = "emcsel_Original.xml" self.default_movsel_file = "movsel_Original.xml" self.default_ul_file = "ul_Original.xml" self.color_file = "skin_user_colors.xml" self.sb_file = "skin_user_sb.xml" self.clock_file = "skin_user_clock.xml" self.infobar_file = "skin_user_infobar.xml" self.background_file = "skin_user_background.xml" self.sib_file = "skin_user_sib.xml" self.ch_se_file = "skin_user_ch_se.xml" self.ev_file = "skin_user_ev.xml" self.emcsel_file = "skin_user_emcsel.xml" self.movsel_file = "skin_user_movsel.xml" self.ul_file = "skin_user_ul.xml" # color current, choices = self.getSettings(self.default_color_file, self.color_file) self.myAtileHD_color = NoSave( ConfigSelection(default=current, choices=choices)) # sb current, choices = self.getSettings(self.default_sb_file, self.sb_file) self.myAtileHD_sb = NoSave( ConfigSelection(default=current, choices=choices)) # clock current, choices = self.getSettings(self.default_clock_file, self.clock_file) self.myAtileHD_clock = NoSave( ConfigSelection(default=current, choices=choices)) # infobar current, choices = self.getSettings(self.default_infobar_file, self.infobar_file) self.myAtileHD_infobar = NoSave( ConfigSelection(default=current, choices=choices)) # background current, choices = self.getSettings(self.default_background_file, self.background_file) self.myAtileHD_background = NoSave( ConfigSelection(default=current, choices=choices)) # sib current, choices = self.getSettings(self.default_sib_file, self.sib_file) self.myAtileHD_sib = NoSave( ConfigSelection(default=current, choices=choices)) # ch_se current, choices = self.getSettings(self.default_ch_se_file, self.ch_se_file) self.myAtileHD_ch_se = NoSave( ConfigSelection(default=current, choices=choices)) # ev current, choices = self.getSettings(self.default_ev_file, self.ev_file) self.myAtileHD_ev = NoSave( ConfigSelection(default=current, choices=choices)) # emcsel current, choices = self.getSettings(self.default_emcsel_file, self.emcsel_file) self.myAtileHD_emcsel = NoSave( ConfigSelection(default=current, choices=choices)) # movsel current, choices = self.getSettings(self.default_movsel_file, self.movsel_file) self.myAtileHD_movsel = NoSave( ConfigSelection(default=current, choices=choices)) # ul current, choices = self.getSettings(self.default_ul_file, self.ul_file) self.myAtileHD_ul = NoSave( ConfigSelection(default=current, choices=choices)) # myatile myatile_active = self.getmyAtileState() self.myAtileHD_active = NoSave(ConfigYesNo(default=myatile_active)) self.myAtileHD_fake_entry = NoSave(ConfigNothing())
def createConfig(self, *args): config.pep = ConfigSubsection() config.pep.configsteps = NoSave( ConfigSelection(choices=[1, 5, 10, 25], default=1)) if os_path.exists("/proc/stb/vmpeg/0/pep_contrast"): def setContrast(config): myval = int(config.value * 256) try: print "--> setting contrast to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_contrast", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_contrast." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.contrast = ConfigSlider(default=128, limits=(0, 255)) config.pep.contrast.addNotifier(setContrast) else: config.pep.contrast = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_saturation"): def setSaturation(config): myval = int(config.value * 256) try: print "--> setting saturation to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_saturation", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_saturaion." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.saturation = ConfigSlider(default=128, limits=(0, 255)) config.pep.saturation.addNotifier(setSaturation) else: config.pep.saturation = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_hue"): def setHue(config): myval = int(config.value * 256) try: print "--> setting hue to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_hue", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_hue." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.hue = ConfigSlider(default=128, limits=(0, 255)) config.pep.hue.addNotifier(setHue) else: config.pep.hue = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_brightness"): def setBrightness(config): myval = int(config.value * 256) try: print "--> setting brightness to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_brightness", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_brightness." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.brightness = ConfigSlider(default=128, limits=(0, 255)) config.pep.brightness.addNotifier(setBrightness) else: config.pep.brightness = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_block_noise_reduction"): def setBlock_noise_reduction(config): myval = int(config.value) try: print "--> setting block_noise_reduction to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_block_noise_reduction", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_block_noise_reduction." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.block_noise_reduction = ConfigSlider(default=0, limits=(0, 5)) config.pep.block_noise_reduction.addNotifier( setBlock_noise_reduction) else: config.pep.block_noise_reduction = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_mosquito_noise_reduction"): def setMosquito_noise_reduction(config): myval = int(config.value) try: print "--> setting mosquito_noise_reduction to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_mosquito_noise_reduction", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_mosquito_noise_reduction." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.mosquito_noise_reduction = ConfigSlider(default=0, limits=(0, 5)) config.pep.mosquito_noise_reduction.addNotifier( setMosquito_noise_reduction) else: config.pep.mosquito_noise_reduction = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_digital_contour_removal"): def setDigital_contour_removal(config): myval = int(config.value) try: print "--> setting digital_contour_removal to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_digital_contour_removal", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_digital_contour_removal." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.digital_contour_removal = ConfigSlider(default=0, limits=(0, 5)) config.pep.digital_contour_removal.addNotifier( setDigital_contour_removal) else: config.pep.digital_contour_removal = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_split"): def setSplitMode(config): try: print "--> setting splitmode to:", str(config.value) f = open("/proc/stb/vmpeg/0/pep_split", "w") f.write(str(config.value)) f.close() except IOError: print "couldn't write pep_split." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.split = ConfigSelection(choices={ "off": _("Off"), "left": _("Left"), "right": _("Right") }, default="off") config.pep.split.addNotifier(setSplitMode) else: config.pep.split = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_sharpness"): def setSharpness(config): myval = int(config.value * 256) try: print "--> setting sharpness to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_sharpness", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_sharpness." if not VideoEnhancement.firstRun: self.setConfiguredValues() if getBoxType() in ('gbquad', 'gbquadplus', 'gbuhdquad'): config.pep.sharpness = ConfigSlider(default=256, limits=(0, 256)) else: config.pep.sharpness = ConfigSlider(default=0, limits=(0, 256)) config.pep.sharpness.addNotifier(setSharpness) else: config.pep.sharpness = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_auto_flesh"): def setAutoflesh(config): myval = int(config.value) try: print "--> setting auto_flesh to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_auto_flesh", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_auto_flesh." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.auto_flesh = ConfigSlider(default=0, limits=(0, 4)) config.pep.auto_flesh.addNotifier(setAutoflesh) else: config.pep.auto_flesh = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_green_boost"): def setGreenboost(config): myval = int(config.value) try: print "--> setting green_boost to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_green_boost", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_green_boost." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.green_boost = ConfigSlider(default=0, limits=(0, 4)) config.pep.green_boost.addNotifier(setGreenboost) else: config.pep.green_boost = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_blue_boost"): def setBlueboost(config): myval = int(config.value) try: print "--> setting blue_boost to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_blue_boost", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_blue_boost." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.blue_boost = ConfigSlider(default=0, limits=(0, 4)) config.pep.blue_boost.addNotifier(setBlueboost) else: config.pep.blue_boost = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_dynamic_contrast"): def setDynamic_contrast(config): myval = int(config.value) try: print "--> setting dynamic_contrast to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_dynamic_contrast", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_dynamic_contrast." if not VideoEnhancement.firstRun: self.setConfiguredValues() if getBoxType() in ('gbquad', 'gbquadplus', 'gbuhdquad'): config.pep.dynamic_contrast = ConfigSlider(default=3, limits=(0, 255)) else: config.pep.dynamic_contrast = ConfigSlider(default=0, limits=(0, 255)) config.pep.dynamic_contrast.addNotifier(setDynamic_contrast) else: config.pep.dynamic_contrast = NoSave(ConfigNothing()) try: x = config.av.scaler_sharpness.value except KeyError: if os_path.exists("/proc/stb/vmpeg/0/pep_scaler_sharpness"): def setScaler_sharpness(config): myval = int(config.value) try: print "--> setting scaler_sharpness to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_scaler_sharpness", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_scaler_sharpness." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.av.scaler_sharpness = ConfigSlider(default=13, limits=(0, 26)) config.av.scaler_sharpness.addNotifier(setScaler_sharpness) else: config.av.scaler_sharpness = NoSave(ConfigNothing()) if os_path.exists( "/proc/stb/video/hdmi_colorspace") and os_path.exists( "/proc/stb/video/hdmi_colorspace_choices"): def setColour_space(config): myval = config.value try: print "--> setting color_soace to:", myval f = open("/proc/stb/video/hdmi_colorspace", "w") f.write(myval) f.close() except IOError: print "couldn't write color_soace." if not VideoEnhancement.firstRun: self.setConfiguredValues() file = open("/proc/stb/video/hdmi_colorspace_choices", "r") modes = file.readline().split() file.close() config.pep.color_space = ConfigSelection(modes, modes[0]) config.pep.color_space.addNotifier(setColour_space) else: config.pep.color_space = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_scaler_vertical_dejagging"): def setScaler_vertical_dejagging(configElement): myval = configElement.value and "enable" or "disable" try: print "--> setting scaler_vertical_dejagging to: %s" % myval open("/proc/stb/vmpeg/0/pep_scaler_vertical_dejagging", "w").write(myval) except IOError: print "couldn't write pep_scaler_vertical_dejagging." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.scaler_vertical_dejagging = ConfigBoolean( default=False, descriptions={ False: _("Disabled"), True: _("Enabled") }) config.pep.scaler_vertical_dejagging.addNotifier( setScaler_vertical_dejagging) else: config.pep.scaler_vertical_dejagging = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/smooth"): def setSmooth(configElement): myval = configElement.value and "enable" or "disable" try: print "--> setting smooth to: %s" % myval open("/proc/stb/vmpeg/0/smooth", "w").write(myval) except IOError: print "couldn't write smooth." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.smooth = ConfigBoolean(default=False, descriptions={ False: _("Disabled"), True: _("Enabled") }) config.pep.smooth.addNotifier(setSmooth) else: config.pep.smooth = NoSave(ConfigNothing()) if VideoEnhancement.firstRun: self.setConfiguredValues() VideoEnhancement.firstRun = False
def createConfig(self): self.mountusingEntry = None self.sharenameEntry = None self.mounttypeEntry = None self.activeEntry = None self.ipEntry = None self.sharedirEntry = None self.optionsEntry = None self.usernameEntry = None self.passwordEntry = None self.hdd_replacementEntry = None self.mountusing = [] self.mountusing.append(("fstab", _("FSTAB (mount using linux)"))) self.mountusing.append(("enigma2", _("Enigma2 (mount using enigma2)"))) self.mountusing.append(("old_enigma2", _("Enigma2 old format (mount using linux)"))) self.sharetypelist = [] self.sharetypelist.append(("nfs", _("NFS share"))) self.sharetypelist.append(("cifs", _("CIFS share"))) if self.mountinfo.has_key('mountusing'): mountusing = self.mountinfo['mountusing'] if mountusing is False: mountusing = "fstab" else: mountusing = "fstab" if self.mountinfo.has_key('mounttype'): mounttype = self.mountinfo['mounttype'] if mounttype is False: mounttype = "nfs" else: mounttype = "nfs" if self.mountinfo.has_key('active'): active = self.mountinfo['active'] if active == 'True': active = True if active == 'False': active = False else: active = True if self.mountinfo.has_key('ip'): if self.mountinfo['ip'] is False: ip = [192, 168, 0, 0] else: ip = self.convertIP(self.mountinfo['ip']) else: ip = [192, 168, 0, 0] if self.mountinfo.has_key('sharename'): sharename = self.mountinfo['sharename'] else: sharename = "Sharename" if self.mountinfo.has_key('sharedir'): sharedir = self.mountinfo['sharedir'] else: sharedir = "/export/hdd" if self.mountinfo.has_key('options'): options = self.mountinfo['options'] else: options = "rw,nolock,tcp" if self.mountinfo.has_key('username'): username = self.mountinfo['username'] else: username = "" if self.mountinfo.has_key('password'): password = self.mountinfo['password'] else: password = "" if self.mountinfo.has_key('hdd_replacement'): hdd_replacement = self.mountinfo['hdd_replacement'] if hdd_replacement == 'True': hdd_replacement = True if hdd_replacement == 'False': hdd_replacement = False else: hdd_replacement = False if sharename is False: sharename = "Sharename" if sharedir is False: sharedir = "/export/hdd" if mounttype == "nfs": defaultOptions = "rw,nolock,tcp" else: defaultOptions = "rw" if username is False: username = "" if password is False: password = "" self.mountusingConfigEntry = NoSave(ConfigSelection(self.mountusing, default = mountusing )) self.activeConfigEntry = NoSave(ConfigEnableDisable(default = active)) self.ipConfigEntry = NoSave(ConfigIP(default = ip)) self.sharenameConfigEntry = NoSave(ConfigText(default = sharename, visible_width = 50, fixed_size = False)) self.sharedirConfigEntry = NoSave(ConfigText(default = sharedir, visible_width = 50, fixed_size = False)) self.optionsConfigEntry = NoSave(ConfigText(default = defaultOptions, visible_width = 50, fixed_size = False)) if options is not False: self.optionsConfigEntry.value = options self.usernameConfigEntry = NoSave(ConfigText(default = username, visible_width = 50, fixed_size = False)) self.passwordConfigEntry = NoSave(ConfigPassword(default = password, visible_width = 50, fixed_size = False)) self.mounttypeConfigEntry = NoSave(ConfigSelection(self.sharetypelist, default = mounttype )) self.hdd_replacementConfigEntry = NoSave(ConfigYesNo(default = hdd_replacement))
def InitAVSwitch(): config.av = ConfigSubsection() if model == "vuduo" or BoxInfo.getItem("brand") == "ixuss": config.av.yuvenabled = ConfigBoolean(default=False) else: config.av.yuvenabled = ConfigBoolean(default=True) colorformat_choices = {"cvbs": _("CVBS")} # when YUV, Scart or S-Video is not support by HW, don't let the user select it if BoxInfo.getItem("yuv"): colorformat_choices["yuv"] = _("YPbPr") if BoxInfo.getItem("scart"): colorformat_choices["rgb"] = _("RGB") if BoxInfo.getItem("svideo"): colorformat_choices["svideo"] = _("S-Video") config.av.colorformat = ConfigSelection(choices=colorformat_choices, default="cvbs") config.av.aspectratio = ConfigSelection(choices={ "4_3_letterbox": _("4:3 Letterbox"), "4_3_panscan": _("4:3 PanScan"), "16_9": _("16:9"), "16_9_always": _("16:9 always"), "16_10_letterbox": _("16:10 Letterbox"), "16_10_panscan": _("16:10 PanScan"), "16_9_letterbox": _("16:9 Letterbox") }, default="16_9") config.av.aspect = ConfigSelection(choices={ "4_3": _("4:3"), "16_9": _("16:9"), "16_10": _("16:10"), "auto": _("Automatic") }, default="auto") policy2_choices = { # TRANSLATORS: (aspect ratio policy: black bars on top/bottom) in doubt, keep english term. "letterbox": _("Letterbox"), # TRANSLATORS: (aspect ratio policy: cropped content on left/right) in doubt, keep english term "panscan": _("Pan&scan"), # TRANSLATORS: (aspect ratio policy: scale as close to fullscreen as possible) "scale": _("Just scale") } try: print("[AVSwitch] Read /proc/stb/video/policy2_choices") if "full" in open("/proc/stb/video/policy2_choices").read(): # TRANSLATORS: (aspect ratio policy: display as fullscreen, even if the content aspect ratio does not match the screen ratio) policy2_choices.update({"full": _("Full screen")}) except: print("[AVSwitch] Read /proc/stb/video/policy2_choices failed.") try: print("[AVSwitch] Read /proc/stb/video/policy2_choices") if "auto" in open("/proc/stb/video/policy2_choices").read(): # TRANSLATORS: (aspect ratio policy: automatically select the best aspect ratio mode) policy2_choices.update({"auto": _("Auto")}) except: print("[AVSwitch] Read /proc/stb/video/policy2_choices failed.") config.av.policy_169 = ConfigSelection(choices=policy2_choices, default="scale") policy_choices = { # TRANSLATORS: (aspect ratio policy: black bars on left/right) in doubt, keep english term. "pillarbox": _("Pillarbox"), # TRANSLATORS: (aspect ratio policy: cropped content on left/right) in doubt, keep english term "panscan": _("Pan&scan"), # TRANSLATORS: (aspect ratio policy: scale as close to fullscreen as possible) "scale": _("Just scale") } try: print("[AVSwitch] Read /proc/stb/video/policy_choices") if "nonlinear" in open("/proc/stb/video/policy_choices").read(): # TRANSLATORS: (aspect ratio policy: display as fullscreen, with stretching the left/right) policy_choices.update({"nonlinear": _("Nonlinear")}) except: print("[AVSwitch] Read /proc/stb/video/policy_choices failed.") try: print("[AVSwitch] Read /proc/stb/video/policy_choices") if "full" in open("/proc/stb/video/policy_choices").read(): # TRANSLATORS: (aspect ratio policy: display as fullscreen, even if the content aspect ratio does not match the screen ratio) policy_choices.update({"full": _("Full screen")}) except: print("[AVSwitch] Read /proc/stb/video/policy_choices failed.") try: print("[AVSwitch] Read /proc/stb/video/policy_choices") if "auto" in open("/proc/stb/video/policy_choices").read(): # TRANSLATORS: (aspect ratio policy: automatically select the best aspect ratio mode) policy_choices.update({"auto": _("Auto")}) except: print("[AVSwitch] Read /proc/stb/video/policy_choices failed.") config.av.policy_43 = ConfigSelection(choices=policy_choices, default="scale") config.av.tvsystem = ConfigSelection(choices={ "pal": _("PAL"), "ntsc": _("NTSC"), "multinorm": _("multinorm") }, default="pal") config.av.wss = ConfigEnableDisable(default=True) config.av.generalAC3delay = ConfigSelectionNumber(-1000, 1000, 5, default=0) config.av.generalPCMdelay = ConfigSelectionNumber(-1000, 1000, 5, default=0) config.av.vcrswitch = ConfigEnableDisable(default=False) iAVSwitch = AVSwitch() def setColorFormat(configElement): if model == "et6x00": map = {"cvbs": 3, "rgb": 3, "svideo": 2, "yuv": 3} elif platform == "gb7356" or model.startswith('et'): map = {"cvbs": 0, "rgb": 3, "svideo": 2, "yuv": 3} else: map = {"cvbs": 0, "rgb": 1, "svideo": 2, "yuv": 3} iAVSwitch.setColorFormat(map[configElement.value]) def setAspectRatio(configElement): map = { "4_3_letterbox": 0, "4_3_panscan": 1, "16_9": 2, "16_9_always": 3, "16_10_letterbox": 4, "16_10_panscan": 5, "16_9_letterbox": 6 } iAVSwitch.setAspectRatio(map[configElement.value]) def setSystem(configElement): map = {"pal": 0, "ntsc": 1, "multinorm": 2} iAVSwitch.setSystem(map[configElement.value]) def setWSS(configElement): iAVSwitch.setAspectWSS() # this will call the "setup-val" initial config.av.colorformat.addNotifier(setColorFormat) config.av.aspectratio.addNotifier(setAspectRatio) config.av.tvsystem.addNotifier(setSystem) config.av.wss.addNotifier(setWSS) iAVSwitch.setInput("ENCODER") # init on startup if platform == "gb7356" or model in ( "et5x00", "et6x00", "ixussone", "ixusszero", "axodin", "axase3", "optimussos1", "optimussos2", "gb800seplus", "gb800ueplus", "gbultrase", "gbultraue", "gbultraueh", "twinboxlcd"): detected = False else: detected = eAVSwitch.getInstance().haveScartSwitch() BoxInfo.setItem("ScartSwitch", detected) if BoxInfo.getItem("CanDownmixAC3"): def setAC3Downmix(configElement): print("[AVSwitch] Write to /proc/stb/audio/ac3") if BoxInfo.getItem("DreamBoxAudio"): open("/proc/stb/audio/ac3", "w").write(configElement.value) else: open("/proc/stb/audio/ac3", "w").write(configElement.value and "downmix" or "passthrough") if BoxInfo.getItem("DreamBoxAudio"): choice_list = [("downmix", _("Downmix")), ("passthrough", _("Passthrough")), ("multichannel", _("convert to multi-channel PCM")), ("hdmi_best", _("use best / controlled by HDMI"))] config.av.downmix_ac3 = ConfigSelection(choices=choice_list, default="downmix") else: config.av.downmix_ac3 = ConfigYesNo(default=True) config.av.downmix_ac3.addNotifier(setAC3Downmix) if BoxInfo.getItem("CanAC3plusTranscode"): def setAC3plusTranscode(configElement): print("[AVSwitch] Write to /proc/stb/audio/ac3plus") open("/proc/stb/audio/ac3plus", "w").write(configElement.value) if BoxInfo.getItem("DreamBoxAudio"): choice_list = [("use_hdmi_caps", _("controlled by HDMI")), ("force_ac3", _("convert to AC3")), ("multichannel", _("convert to multi-channel PCM")), ("hdmi_best", _("use best / controlled by HDMI")), ("force_ddp", _("force AC3plus"))] config.av.transcodeac3plus = ConfigSelection(choices=choice_list, default="force_ac3") elif platform in ("gb7252", "gb72604"): choice_list = [("downmix", _("Downmix")), ("passthrough", _("Passthrough")), ("force_ac3", _("convert to AC3")), ("multichannel", _("convert to multi-channel PCM")), ("force_dts", _("convert to DTS"))] config.av.transcodeac3plus = ConfigSelection(choices=choice_list, default="force_ac3") else: choice_list = [("use_hdmi_caps", _("controlled by HDMI")), ("force_ac3", _("convert to AC3"))] config.av.transcodeac3plus = ConfigSelection(choices=choice_list, default="force_ac3") config.av.transcodeac3plus.addNotifier(setAC3plusTranscode) if BoxInfo.getItem("CanDownmixDTS"): def setDTSDownmix(configElement): print("[AVSwitch] Write to /proc/stb/audio/dts") open("/proc/stb/audio/dts", "w").write(configElement.value and "downmix" or "passthrough") config.av.downmix_dts = ConfigYesNo(default=True) config.av.downmix_dts.addNotifier(setDTSDownmix) if BoxInfo.getItem("CanDTSHD"): def setDTSHD(configElement): print("[AVSwitch] Write to /proc/stb/audio/dtshd") open("/proc/stb/audio/dtshd", "w").write(configElement.value) if model in ("dm7080", "dm820"): choice_list = [("use_hdmi_caps", _("controlled by HDMI")), ("force_dts", _("convert to DTS"))] config.av.dtshd = ConfigSelection(choices=choice_list, default="use_hdmi_caps") else: choice_list = [("downmix", _("Downmix")), ("force_dts", _("convert to DTS")), ("use_hdmi_caps", _("controlled by HDMI")), ("multichannel", _("convert to multi-channel PCM")), ("hdmi_best", _("use best / controlled by HDMI"))] config.av.dtshd = ConfigSelection(choices=choice_list, default="downmix") config.av.dtshd.addNotifier(setDTSHD) if BoxInfo.getItem("CanWMAPRO"): def setWMAPRO(configElement): print("[AVSwitch] Write to /proc/stb/audio/wmapro") open("/proc/stb/audio/wmapro", "w").write(configElement.value) choice_list = [("downmix", _("Downmix")), ("passthrough", _("Passthrough")), ("multichannel", _("convert to multi-channel PCM")), ("hdmi_best", _("use best / controlled by HDMI"))] config.av.wmapro = ConfigSelection(choices=choice_list, default="downmix") config.av.wmapro.addNotifier(setWMAPRO) if BoxInfo.getItem("CanDownmixAAC"): def setAACDownmix(configElement): print("[AVSwitch] Write to /proc/stb/audio/aac") if BoxInfo.getItem("DreamBoxAudio") or platform in ("gb7252", "gb72604"): open("/proc/stb/audio/aac", "w").write(configElement.value) else: open("/proc/stb/audio/aac", "w").write(configElement.value and "downmix" or "passthrough") if BoxInfo.getItem("DreamBoxAudio"): choice_list = [("downmix", _("Downmix")), ("passthrough", _("Passthrough")), ("multichannel", _("convert to multi-channel PCM")), ("hdmi_best", _("use best / controlled by HDMI"))] config.av.downmix_aac = ConfigSelection(choices=choice_list, default="downmix") elif platform in ("gb7252", "gb72604"): choice_list = [("downmix", _("Downmix")), ("passthrough", _("Passthrough")), ("multichannel", _("convert to multi-channel PCM")), ("force_ac3", _("convert to AC3")), ("force_dts", _("convert to DTS")), ("use_hdmi_cacenter", _("use_hdmi_cacenter")), ("wide", _("wide")), ("extrawide", _("extrawide"))] config.av.downmix_aac = ConfigSelection(choices=choice_list, default="downmix") else: config.av.downmix_aac = ConfigYesNo(default=True) config.av.downmix_aac.addNotifier(setAACDownmix) if BoxInfo.getItem("CanDownmixAACPlus"): def setAACDownmixPlus(configElement): print("[AVSwitch] Write to /proc/stb/audio/aacplus") open("/proc/stb/audio/aacplus", "w").write(configElement.value) choice_list = [("downmix", _("Downmix")), ("passthrough", _("Passthrough")), ("multichannel", _("convert to multi-channel PCM")), ("force_ac3", _("convert to AC3")), ("force_dts", _("convert to DTS")), ("use_hdmi_cacenter", _("use_hdmi_cacenter")), ("wide", _("wide")), ("extrawide", _("extrawide"))] config.av.downmix_aacplus = ConfigSelection(choices=choice_list, default="downmix") config.av.downmix_aacplus.addNotifier(setAACDownmixPlus) if BoxInfo.getItem("CanAACTranscode"): def setAACTranscode(configElement): print("[AVSwitch] Write to /proc/stb/audio/aac_transcode") open("/proc/stb/audio/aac_transcode", "w").write(configElement.value) choice_list = [("off", _("off")), ("ac3", _("AC3")), ("dts", _("DTS"))] config.av.transcodeaac = ConfigSelection(choices=choice_list, default="off") config.av.transcodeaac.addNotifier(setAACTranscode) else: config.av.transcodeaac = ConfigNothing() if BoxInfo.getItem("CanBTAudio"): def setBTAudio(configElement): print("[AVSwitch] Write to /proc/stb/audio/btaudio") open("/proc/stb/audio/btaudio", "w").write("on" if configElement.value else "off") config.av.btaudio = ConfigOnOff(default=False) config.av.btaudio.addNotifier(setBTAudio) else: config.av.btaudio = ConfigNothing() if BoxInfo.getItem("CanBTAudioDelay"): def setBTAudioDelay(configElement): print("[AVSwitch] Write to /proc/stb/audio/btaudio_delay") open("/proc/stb/audio/btaudio_delay", "w").write(format(configElement.value * 90)) config.av.btaudiodelay = ConfigSelectionNumber(-1000, 1000, 5, default=0) config.av.btaudiodelay.addNotifier(setBTAudioDelay) else: config.av.btaudiodelay = ConfigNothing() if BoxInfo.getItem("CanChangeOsdAlpha"): def setAlpha(config): print("[AVSwitch] Write to /proc/stb/video/alpha") open("/proc/stb/video/alpha", "w").write(str(config.value)) config.av.osd_alpha = ConfigSlider(default=255, limits=(0, 255)) config.av.osd_alpha.addNotifier(setAlpha) if BoxInfo.getItem("ScalerSharpness"): def setScaler_sharpness(config): myval = int(config.value) try: print("--> setting scaler_sharpness to: %0.8X" % myval) print( "[AVSwitch] Write to /proc/stb/vmpeg/0/pep_scaler_sharpness" ) open("/proc/stb/vmpeg/0/pep_scaler_sharpness", "w").write("%0.8X" % myval) print("[AVSwitch] Write to /proc/stb/vmpeg/0/pep_apply") open("/proc/stb/vmpeg/0/pep_apply", "w").write("1") except IOError: print("[AVSwitch] couldn't write pep_scaler_sharpness") if platform == "gb7356": config.av.scaler_sharpness = ConfigSlider(default=5, limits=(0, 26)) else: config.av.scaler_sharpness = ConfigSlider(default=13, limits=(0, 26)) config.av.scaler_sharpness.addNotifier(setScaler_sharpness) else: config.av.scaler_sharpness = NoSave(ConfigNothing()) if BoxInfo.getItem("HasMultichannelPCM"): def setMultichannelPCM(configElement): print("[AVSwitch] Write to /proc/stb/audio/multichannel_pcm") open(BoxInfo.getItem("HasMultichannelPCM"), "w").write(configElement.value and "enable" or "disable") config.av.multichannel_pcm = ConfigYesNo(default=False) config.av.multichannel_pcm.addNotifier(setMultichannelPCM) if BoxInfo.getItem("HasAutoVolume"): def setAutoVolume(configElement): print("[AVSwitch] Write to /proc/stb/audio/avl") open("/proc/stb/audio/avl", "w").write(configElement.value) config.av.autovolume = ConfigSelection(default="none", choices=[("none", _("off")), ("hdmi", _("HDMI")), ("spdif", _("SPDIF")), ("dac", _("DAC"))]) config.av.autovolume.addNotifier(setAutoVolume) if BoxInfo.getItem("HasAutoVolumeLevel"): def setAutoVolumeLevel(configElement): print("[AVSwitch] Write to /proc/stb/audio/autovolumelevel") open("/proc/stb/audio/autovolumelevel", "w").write(configElement.value and "enabled" or "disabled") config.av.autovolumelevel = ConfigYesNo(default=False) config.av.autovolumelevel.addNotifier(setAutoVolumeLevel) if BoxInfo.getItem("Has3DSurround"): def set3DSurround(configElement): print("[AVSwitch] Write to /proc/stb/audio/3d_surround") open("/proc/stb/audio/3d_surround", "w").write(configElement.value) config.av.surround_3d = ConfigSelection(default="none", choices=[("none", _("off")), ("hdmi", _("HDMI")), ("spdif", _("SPDIF")), ("dac", _("DAC"))]) config.av.surround_3d.addNotifier(set3DSurround) if BoxInfo.getItem("Has3DSpeaker"): def set3DSpeaker(configElement): print( "[AVSwitch] Write to /proc/stb/audio/3d_surround_speaker_position" ) open("/proc/stb/audio/3d_surround_speaker_position", "w").write(configElement.value) config.av.speaker_3d = ConfigSelection(default="center", choices=[("center", _("center")), ("wide", _("wide")), ("extrawide", _("extra wide"))]) config.av.speaker_3d.addNotifier(set3DSpeaker) if BoxInfo.getItem("Has3DSurroundSpeaker"): def set3DSurroundSpeaker(configElement): print("[AVSwitch] Write to /proc/stb/audio/3dsurround") open("/proc/stb/audio/3dsurround", "w").write(configElement.value) config.av.surround_3d_speaker = ConfigSelection( default="disabled", choices=[("disabled", _("off")), ("center", _("center")), ("wide", _("wide")), ("extrawide", _("extra wide"))]) config.av.surround_3d_speaker.addNotifier(set3DSurroundSpeaker) if BoxInfo.getItem("Has3DSurroundSoftLimiter"): def set3DSurroundSoftLimiter(configElement): print("[AVSwitch] Write to /proc/stb/audio/3dsurround_softlimiter") open("/proc/stb/audio/3dsurround_softlimiter", "w").write(configElement.value and "enabled" or "disabled") config.av.surround_softlimiter_3d = ConfigYesNo(default=False) config.av.surround_softlimiter_3d.addNotifier(set3DSurroundSoftLimiter) if BoxInfo.getItem("HDMIAudioSource"): def setHDMIAudioSource(configElement): print("[AVSwitch] Write to /proc/stb/hdmi/audio_source") open(BoxInfo.getItem("HDMIAudioSource"), "w").write(configElement.value) config.av.hdmi_audio_source = ConfigSelection(default="pcm", choices=[ ("pcm", _("PCM")), ("spdif", _("SPDIF")) ]) config.av.hdmi_audio_source.addNotifier(setHDMIAudioSource) def setVolumeStepsize(configElement): eDVBVolumecontrol.getInstance().setVolumeSteps(int( configElement.value)) config.av.volume_stepsize = ConfigSelectionNumber(1, 10, 1, default=5) config.av.volume_stepsize.addNotifier(setVolumeStepsize)
def buildMy_rec(self, device): mypath = SkinPath() device2 = re.sub('[0-9]', '', device) devicetype = path.realpath('/sys/block/' + device2 + '/device') d2 = device name = _('HARD DISK: ') mypixmap = '' + LinkNeoBoot + '/images/dev_hdd.png' model = open('/sys/block/' + device2 + '/device/model').read() model = str(model).replace('\n', '') des = '' if devicetype.find('usb') != -1: name = _('USB: ') mypixmap = '' + LinkNeoBoot + '/images/dev_usb.png' if devicetype.find('usb1') != -1: name = _('USB1: ') mypixmap = '' + LinkNeoBoot + '/images/dev_usb.png' if devicetype.find('usb2') != -1: name = _('USB2: ') mypixmap = '' + LinkNeoBoot + '/images/dev_usb.png' if devicetype.find('card') != -1: name = _('CARD: ') mypixmap = '' + LinkNeoBoot + '/images/dev_sd.png' if devicetype.find('mmc') != -1: name = _('MMC: ') mypixmap = '' + LinkNeoBoot + '/images/dev_sd.png' name = name + model f = open('/proc/mounts', 'r') for line in f.readlines(): if line.find(device) != -1: parts = line.strip().split() d1 = parts[1] dtype = parts[2] break continue else: d1 = _('None') dtype = _('unavailable') f.close() size = Harddisk(device).diskSize() if float(size) / 1024 / 1024 >= 1: des = _('Size: ') + str(round(float(size) / 1024 / 1024, 2)) + _('TB') elif size / 1024 >= 1: des = _('Size: ') + str(round(float(size) / 1024, 2)) + _('GB') elif size >= 1: des = _('Size: ') + str(size) + _('MB') else: des = _('Size: ') + _('unavailable') item = NoSave( ConfigSelection(default='/media/' + device, choices=[('/media/' + device, '/media/' + device), ('/media/hdd', '/media/hdd'), ('/media/hdd2', '/media/hdd2'), ('/media/hdd3', '/media/hdd3'), ('/media/usb', '/media/usb'), ('/media/usb1', '/media/usb1'), ('/media/usb2', '/media/usb2'), ('/media/usb3', '/media/usb3'), ('/media/usb3', '/media/cf'), ('/media/usb3', '/media/card'), ('/media/cf', '/media/cf'), ('/media/mmc', '/media/mmc'), ('/media/card', '/media/card')])) if dtype == 'Linux': dtype = 'ext2', 'ext3', 'ext4' else: dtype = 'auto' item.value = d1.strip() text = name + ' ' + des + ' /dev/' + device res = getConfigListEntry(text, item, device, dtype) if des != '' and self.list.append(res): pass
from Components.Sources.StaticText import StaticText from Components.config import config, getConfigListEntry, ConfigSubsection, ConfigText, ConfigYesNo, ConfigDirectory, NoSave from Components.ConfigList import ConfigListScreen from Components.ActionMap import ActionMap from Components.Pixmap import Pixmap from Components.Sources.Boolean import Boolean config.mediaplayer.repeat = ConfigYesNo(default=False) config.mediaplayer.savePlaylistOnExit = ConfigYesNo(default=True) config.mediaplayer.saveDirOnExit = ConfigYesNo(default=False) config.mediaplayer.defaultDir = ConfigDirectory() config.mediaplayer.sortPlaylists = ConfigYesNo(default=False) config.mediaplayer.alwaysHideInfoBar = ConfigYesNo(default=True) config.mediaplayer.onMainMenu = ConfigYesNo(default=False) config.mediaplayer.useAlternateUserAgent = NoSave(ConfigYesNo(default=False)) config.mediaplayer.alternateUserAgent = NoSave( ConfigText(default="Enigma2 HbbTV/1.1.1 (+PVR+RTSP+DL;openLD;;;)")) class DirectoryBrowser(Screen, HelpableScreen): def __init__(self, session, currDir): Screen.__init__(self, session) # for the skin: first try MediaPlayerDirectoryBrowser, then FileBrowser, this allows individual skinning self.skinName = ["MediaPlayerDirectoryBrowser", "FileBrowser"] HelpableScreen.__init__(self) self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("Use"))
def initConfig(self): streamtypechoices = [('1', 'DVB(1)'), ('4097', 'IPTV(4097)')] if os.path.exists("/usr/bin/gstplayer"): streamtypechoices.append(('5001', 'GStreamer(5001)')) if os.path.exists("/usr/bin/exteplayer3"): streamtypechoices.append(('5002', 'ExtePlayer(5002)')) if os.path.exists("/usr/bin/apt-get"): streamtypechoices.append(('8193', 'DreamOS GStreamer(8193)')) if self.editmode is False: self.protocolCfg = NoSave( ConfigSelection(default=self.protocol, choices=[('http://', _('http://')), ('https://', _('https://'))])) self.serverCfg = NoSave( ConfigText(default=self.server, fixed_size=False)) self.portCfg = NoSave(ConfigNumber(default=self.port)) self.usernameCfg = NoSave( ConfigText(default=self.username, fixed_size=False)) self.passwordCfg = NoSave( ConfigText(default=self.password, fixed_size=False)) self.outputCfg = NoSave( ConfigSelection(default=self.output, choices=[('ts', 'ts'), ('m3u8', 'm3u8')])) else: self.name = str(glob.current_playlist['playlist_info']['name']) self.protocol = str( glob.current_playlist['playlist_info']['protocol']) self.domain = str(glob.current_playlist['playlist_info']['domain']) self.port = str(glob.current_playlist['playlist_info']['port']) self.username = str( glob.current_playlist['playlist_info']['username']) self.password = str( glob.current_playlist['playlist_info']['password']) self.output = str(glob.current_playlist['playlist_info']['output']) self.liveType = str( glob.current_playlist['player_info']['livetype']) self.vodType = str(glob.current_playlist['player_info']['vodtype']) self.catchupType = str( glob.current_playlist['player_info']['catchuptype']) self.epgType = str(glob.current_playlist['player_info']['epgtype']) self.epgshift = str( glob.current_playlist['player_info']['epgshift']) self.epgquickshift = str( glob.current_playlist['player_info']['epgquickshift']) self.showlive = glob.current_playlist['player_info']['showlive'] self.showvod = glob.current_playlist['player_info']['showvod'] self.showseries = glob.current_playlist['player_info'][ 'showseries'] self.showcatchup = glob.current_playlist['player_info'][ 'showcatchup'] self.nameCfg = NoSave( ConfigText(default=self.name, fixed_size=False)) self.protocolCfg = NoSave( ConfigSelection(default=self.protocol, choices=[('http://', _('http://')), ('https://', _('https://'))])) self.serverCfg = NoSave( ConfigText(default=self.domain, fixed_size=False)) self.portCfg = NoSave(ConfigNumber(default=self.port)) self.usernameCfg = NoSave( ConfigText(default=self.username, fixed_size=False)) self.passwordCfg = NoSave( ConfigText(default=self.password, fixed_size=False)) self.outputCfg = NoSave( ConfigSelection(default=self.output, choices=[('ts', 'ts'), ('m3u8', 'm3u8')])) self.liveTypeCfg = NoSave( ConfigSelection(default=self.liveType, choices=streamtypechoices)) self.vodTypeCfg = NoSave( ConfigSelection(default=self.vodType, choices=streamtypechoices)) self.catchupTypeCfg = NoSave( ConfigSelection(default=self.catchupType, choices=streamtypechoices)) self.epgTypeCfg = NoSave( ConfigSelection(default=self.epgType, choices=[('0', _('Off')), ('1', _('Quick')), ('2', _('Full'))])) self.epgShiftCfg = NoSave( ConfigSelectionNumber(min=-12, max=12, stepwidth=1, default=self.epgshift)) self.epgQuickShiftCfg = NoSave( ConfigSelectionNumber(min=-12, max=12, stepwidth=1, default=self.epgquickshift)) self.showliveCfg = NoSave(ConfigYesNo(default=self.showlive)) self.showvodCfg = NoSave(ConfigYesNo(default=self.showvod)) self.showseriesCfg = NoSave(ConfigYesNo(default=self.showseries)) self.showcatchupCfg = NoSave(ConfigYesNo(default=self.showcatchup)) self.createSetup()
from Plugins.Plugin import PluginDescriptor from Components.NimManager import nimmanager from menu import AutoBouquetsMaker_Menu from scanner.main import AutoBouquetsMakerautostart from Components.config import config, configfile, ConfigSubsection, ConfigYesNo, ConfigSelection, ConfigText, ConfigNumber, NoSave, ConfigClock, getConfigListEntry config.autobouquetsmaker = ConfigSubsection() config.autobouquetsmaker.level = ConfigSelection(default = "simple", choices = [("simple", _("simple")), ("expert", _("expert"))]) config.autobouquetsmaker.providers = ConfigText("", False) config.autobouquetsmaker.bouquetsorder = ConfigText("", False) config.autobouquetsmaker.schedule = ConfigYesNo(default = False) config.autobouquetsmaker.scheduletime = ConfigClock(default = 0) # 1:00 config.autobouquetsmaker.repeattype = ConfigSelection(default = "daily", choices = [("daily", _("Daily")), ("weekly", _("Weekly")), ("monthly", _("30 Days"))]) config.autobouquetsmaker.retry = ConfigNumber(default = 30) config.autobouquetsmaker.retrycount = NoSave(ConfigNumber(default = 0)) config.autobouquetsmaker.nextscheduletime = NoSave(ConfigNumber(default = 0)) config.autobouquetsmaker.lastlog = ConfigText(default=' ', fixed_size=False) config.autobouquetsmaker.keepallbouquets = ConfigYesNo(default = True) config.autobouquetsmaker.keepbouquets = ConfigText("", False) config.autobouquetsmaker.hidesections = ConfigText("", False) config.autobouquetsmaker.addprefix = ConfigYesNo(default = False) def main(session, **kwargs): session.open(AutoBouquetsMaker_Menu) def AutoBouquetsMakerSetup(menuid, **kwargs): if menuid == "scan": return [(_("AutoBouquetsMaker"), main, "autobouquetsmakermaker", 10)] else: return []
def buildMy_rec(self, device): device2 = '' try: if device.find('1') > 1: device2 = device.replace('1', '') except: device2 = '' try: if device.find('2') > 1: device2 = device.replace('2', '') except: device2 = '' try: if device.find('3') > 1: device2 = device.replace('3', '') except: device2 = '' try: if device.find('4') > 1: device2 = device.replace('4', '') except: device2 = '' try: if device.find('5') > 1: device2 = device.replace('5', '') except: device2 = '' try: if device.find('6') > 1: device2 = device.replace('6', '') except: device2 = '' try: if device.find('7') > 1: device2 = device.replace('7', '') except: device2 = '' try: if device.find('8') > 1: device2 = device.replace('8', '') except: device2 = '' try: if device.find('p1') > 1: device2 = device.replace('p1', '') except: device2 = '' try: if device.find('p2') > 1: device2 = device.replace('p2', '') except: device2 = '' try: if device.find('p3') > 1: device2 = device.replace('p3', '') except: device2 = '' try: if device.find('p4') > 1: device2 = device.replace('p4', '') except: device2 = '' try: if device.find('p5') > 1: device2 = device.replace('p5', '') except: device2 = '' try: if device.find('p6') > 1: device2 = device.replace('p6', '') except: device2 = '' try: if device.find('p7') > 1: device2 = device.replace('p7', '') except: device2 = '' try: if device.find('p8') > 1: device2 = device.replace('p8', '') except: device2 = '' devicetype = path.realpath('/sys/block/' + device2 + '/device') d2 = device name = 'USB: ' mypixmap = '/usr/lib/enigma2/python/OPENDROID/icons/dev_usb.png' if device2.startswith('mmcblk'): if getBoxType() in ('wetekplay', 'wetekplayplus' ) or getMachineBuild() in ('h3', 'h5'): model = file('/sys/block/mmcblk0/device/name').read() else: try: model = file('/sys/block/' + device2 + '/device/name').read() except: model = 'Unknown' mypixmap = '/usr/lib/enigma2/python/OPENDROID/icons/dev_mmc.png' name = 'MMC: ' else: model = file('/sys/block/' + device2 + '/device/model').read() model = str(model).replace('\n', '') des = '' if devicetype.find('/devices/pci') != -1: name = _('HARD DISK: ') mypixmap = '/usr/lib/enigma2/python/OPENDROID/icons/dev_hdd.png' name = name + model f = open('/proc/mounts', 'r') for line in f.readlines(): if line.find(device) != -1: parts = line.strip().split() d1 = parts[1] dtype = parts[2] break continue else: d1 = _('None') dtype = _('unavailable') f.close() f = open('/proc/partitions', 'r') for line in f.readlines(): if line.find(device) != -1: parts = line.strip().split() size = int(parts[2]) if float(size) / 1024 / 1024 / 1024 > 1: des = _('Size: ') + str( round(float(size) / 1024 / 1024 / 1024, 2)) + _('TB') elif size / 1024 / 1024 > 1: des = _('Size: ') + str(size / 1024 / 1024) + _('GB') else: des = _('Size: ') + str(size / 1024) + _('MB') else: try: size = file('/sys/block/' + device2 + '/' + device + '/size').read() size = str(size).replace('\n', '') size = int(size) except: size = 0 if float(size) / 2 / 1024 / 1024 / 1024 > 1: des = _('Size: ') + str( round(float(size) / 2 / 1024 / 1024 / 1024, 2)) + _('TB') elif size / 2 / 1024 / 1024 > 1: des = _('Size: ') + str(size / 2 / 1024 / 1024) + _('GB') else: des = _('Size: ') + str(size / 2 / 1024) + _('MB') f.close() item = NoSave( ConfigSelection(default='/media/' + device, choices=[('/media/' + device, '/media/' + device), ('/media/hdd', '/media/hdd'), ('/media/hdd2', '/media/hdd2'), ('/media/hdd3', '/media/hdd3'), ('/media/usb', '/media/usb'), ('/media/usb2', '/media/usb2'), ('/media/usb3', '/media/usb3'), ('/media/mmc', '/media/mmc'), ('/media/mmc2', '/media/mmc2'), ('/media/mmc3', '/media/mmc3'), ('/usr', '/usr')])) if dtype == 'Linux': dtype = 'ext3' else: dtype = 'auto' item.value = d1.strip() text = name + ' ' + des + ' /dev/' + device res = getConfigListEntry(text, item, device, dtype) if des != '' and self.list.append(res): pass
config.plugins.extrafancontrol.alt_timestart = ConfigClock( default=((21 * 60 + 30) * 60)) config.plugins.extrafancontrol.alt_timeend = ConfigClock( default=((7 * 60 + 0) * 60)) config.plugins.extrafancontrol.hddwatch = ConfigSelection(choices=hddwatchlist, default="none") config.plugins.extrafancontrol.hdddevice = ConfigText(default="all") config.plugins.extrafancontrol.hddsleep = ConfigYesNo(default=False) config.plugins.extrafancontrol.hddtemp = ConfigInteger(0, limits=(0, 80)) config.plugins.extrafancontrol.interval = ConfigSelection(choices=intervallist, default="120") config.plugins.extrafancontrol.interval_tempwatcher = ConfigSelection( choices=[("30", "30"), ("45", "45")] + intervallist, default="60") config.plugins.extrafancontrol.menuhdd = ConfigYesNo(default=False) config.plugins.extrafancontrol.alt_auto = ConfigYesNo(default=default_auto) config.plugins.extrafancontrol.warning = NoSave(ConfigNothing()) try: config.plugins.extrafancontrol.fanspeed = config.usage.fanspeed isSetPMW = False except: isSetPMW = True config.plugins.extrafancontrol.fanspeed = ConfigSlider(default=127, increment=8, limits=(0, 255)) config.plugins.extrafancontrol.altfanspeed = ConfigSlider(default=127, increment=8, limits=(0, 255)) config.plugins.extrafancontrol.standbyfanspeed = ConfigSlider(default=127, increment=8, limits=(0, 255)) config.plugins.extrafancontrol.timeset = ConfigSelection(choices=timsetlist,
def createConfig(self): self.sharenameEntry = None self.mounttypeEntry = None self.activeEntry = None self.ipEntry = None self.hostEntry = None self.sharedirEntry = None self.optionsEntry = None self.usernameEntry = None self.passwordEntry = None self.hdd_replacementEntry = None self.sharetypelist = [("nfs", _("NFS share")), ("cifs", _("CIFS share"))] mounttype = self.mountinfo.get('mounttype') if not mounttype: mounttype = "nfs" active = self.mountinfo.get('active', 'True') == 'True' # Not that "host" takes precedence over "ip" host = self.mountinfo.get('host', "") if not host: # In case host is something funky like False or None host = '' try: ip = convertIP(self.mountinfo['ip']) except Exception as ex: print("[NWB] Invalid IP", ex) ip = [0, 0, 0, 0] sharename = self.mountinfo.get('sharename', "Sharename") sharedir = self.mountinfo.get('sharedir', "/media/hdd") username = self.mountinfo.get('username', "") password = self.mountinfo.get('password', "") hdd_replacement = self.mountinfo.get('hdd_replacement', False) if hdd_replacement == 'True': hdd_replacement = True else: hdd_replacement = False if sharename is False: sharename = "Sharename" if sharedir is False: sharedir = "/media/hdd" if mounttype == "nfs": defaultOptions = "rw,nolock,soft" else: defaultOptions = "rw" if username is False: username = "" if password is False: password = "" options = self.mountinfo.get('options', defaultOptions) self.activeConfigEntry = NoSave(ConfigEnableDisable(default=active)) self.ipConfigEntry = NoSave(ConfigIP(default=ip)) self.hostConfigEntry = NoSave( ConfigText(default=host, visible_width=50, fixed_size=False)) self.sharenameConfigEntry = NoSave( ConfigText(default=sharename, visible_width=50, fixed_size=False)) self.sharedirConfigEntry = NoSave( ConfigText(default=sharedir, visible_width=50, fixed_size=False)) self.optionsConfigEntry = NoSave( ConfigText(default=defaultOptions, visible_width=50, fixed_size=False)) if options is not False: self.optionsConfigEntry.value = options self.usernameConfigEntry = NoSave( ConfigText(default=username, visible_width=50, fixed_size=False)) self.passwordConfigEntry = NoSave( ConfigPassword(default=password, visible_width=50, fixed_size=False)) self.mounttypeConfigEntry = NoSave( ConfigSelection(self.sharetypelist, default=mounttype)) self.hdd_replacementConfigEntry = NoSave( ConfigYesNo(default=hdd_replacement))
def buildMy_rec(self, device): try: if device.find('1') > 1: device2 = device.replace('1', '') except: device2 = '' try: if device.find('2') > 1: device2 = device.replace('2', '') except: device2 = '' try: if device.find('3') > 1: device2 = device.replace('3', '') except: device2 = '' try: if device.find('4') > 1: device2 = device.replace('4', '') except: device2 = '' try: if device.find('5') > 1: device2 = device.replace('5', '') except: device2 = '' try: if device.find('6') > 1: device2 = device.replace('6', '') except: device2 = '' try: if device.find('7') > 1: device2 = device.replace('7', '') except: device2 = '' try: if device.find('8') > 1: device2 = device.replace('8', '') except: device2 = '' try: if device.find('p1') > 1: device2 = device.replace('p1', '') except: device2 = '' try: if device.find('p2') > 1: device2 = device.replace('p2', '') except: device2 = '' try: if device.find('p3') > 1: device2 = device.replace('p3', '') except: device2 = '' try: if device.find('p4') > 1: device2 = device.replace('p4', '') except: device2 = '' try: if device.find('p5') > 1: device2 = device.replace('p5', '') except: device2 = '' try: if device.find('p6') > 1: device2 = device.replace('p6', '') except: device2 = '' try: if device.find('p7') > 1: device2 = device.replace('p7', '') except: device2 = '' try: if device.find('p8') > 1: device2 = device.replace('p8', '') except: device2 = '' try: devicetype = path.realpath('/sys/block/' + device2 + '/device') except: devicetype = '' d2 = device model = '-?-' name = 'USB: ' mypixmap = '/usr/lib/enigma2/python/Plugins/Extensions/LDteam/images/icons/dev_usbstick.png' if 'sdhci' in devicetype or device2.startswith('mmcblk'): name = 'MMC: ' try: model = file('/sys/block/' + device2 + '/device/name').read() model = str(model).replace('\n', '') mypixmap = '/usr/lib/enigma2/python/Plugins/Extensions/LDteam/images/icons/dev_mmc.png' except: pass else: try: model = file('/sys/block/' + device2 + '/device/model').read() model = str(model).replace('\n', '') except: pass des = '' print "test:" if devicetype.find('/devices/pci') != -1 or devicetype.find( 'ahci') != -1 or devicetype.find( '/devices/platform/strict-ahci') != -1: name = _("HARD DISK: ") mypixmap = '/usr/lib/enigma2/python/Plugins/Extensions/LDteam/images/icons/dev_hdd.png' name = name + model f = open('/proc/mounts', 'r') for line in f.readlines(): if line.find(device) != -1: parts = line.strip().split() d1 = parts[1] dtype = parts[2] break continue else: d1 = _("None") dtype = _("unavailable") f.close() f = open('/proc/partitions', 'r') for line in f.readlines(): if line.find(device) != -1: parts = line.strip().split() size = int(parts[2]) if (((float(size) / 1024) / 1024) / 1024) > 1: des = _("Size: ") + str( round((( (float(size) / 1024) / 1024) / 1024), 2)) + _("TB") elif ((size / 1024) / 1024) > 1: des = _("Size: ") + str((size / 1024) / 1024) + _("GB") else: des = _("Size: ") + str(size / 1024) + _("MB") else: try: size = file('/sys/block/' + device2 + '/' + device + '/size').read() size = str(size).replace('\n', '') size = int(size) except: size = 0 if ((((float(size) / 2) / 1024) / 1024) / 1024) > 1: des = _("Size: ") + str( round(((((float(size) / 2) / 1024) / 1024) / 1024), 2)) + _("TB") elif (((size / 2) / 1024) / 1024) > 1: des = _("Size: ") + str( ((size / 2) / 1024) / 1024) + _("GB") else: des = _("Size: ") + str((size / 2) / 1024) + _("MB") f.close() item = NoSave( ConfigSelection(default='/media/' + device, choices=[('/media/' + device, '/media/' + device), ('/media/hdd', '/media/hdd'), ('/media/hdd2', '/media/hdd2'), ('/media/hdd3', '/media/hdd3'), ('/media/usb', '/media/usb'), ('/media/usb2', '/media/usb2'), ('/media/usb3', '/media/usb3'), ('/media/mmc', '/media/mmc'), ('/media/mmc2', '/media/mmc2'), ('/media/mmc3', '/media/mmc3'), ('/media/cf', '/media/cf'), ('/media/cf2', '/media/cf2'), ('/media/cf3', '/media/cf3'), ('/media/uSDextra', '/media/uSDextra'), ('/media/net', '/media/net'), ('/media/upnp', '/media/upnp'), ('/media/downloads', '/media/downloads'), ('/media/music', '/media/music'), ('/media/personal', '/media/personal'), ('/media/photo', '/media/photo'), ('/media/video', '/media/video'), ('/usr', '/usr')])) if dtype == 'Linux': dtype = 'ext2' or 'ext3' or 'ext4' elif dtype == 'vfat': dtype = 'vfat' or 'fat' or 'fat16' or 'fat32' else: dtype = 'auto' item.value = d1.strip() text = name + ' ' + des + ' /dev/' + device res = getConfigListEntry(text, item, device, dtype) if des != '' and self.list.append(res): pass
adapter_choices = [("main", _("Main Picture"))] if SystemInfo.get("NumVideoDecoders", 1) > 1: adapter_choices.append(("pip", _("Picture in Picture"))) adapter_choices.append(("pip_hidden", _("Picture in Picture (hidden)"))) if len(nimmanager.nim_slots) > 1: adapter_choices.append(("record", _("Fake recording"))) config.plugins.epgrefresh.adapter = ConfigSelection(choices=adapter_choices, default="main") config.plugins.epgrefresh.show_in_extensionsmenu = ConfigYesNo(default=False) config.plugins.epgrefresh.show_run_in_extensionsmenu = ConfigYesNo( default=True) config.plugins.epgrefresh.show_help = ConfigYesNo(default=True) config.plugins.epgrefresh.wakeup_time = ConfigInteger(default=-1) config.plugins.epgrefresh.showadvancedoptions = NoSave( ConfigYesNo(default=False)) # convert previous parameters config.plugins.epgrefresh.background = ConfigYesNo(default=False) if config.plugins.epgrefresh.background.value: config.plugins.epgrefresh.adapter.value = "pip_hidden" config.plugins.epgrefresh.background.value = False config.plugins.epgrefresh.save() config.plugins.epgrefresh.interval = ConfigNumber(default=2) if config.plugins.epgrefresh.interval.value != 2: config.plugins.epgrefresh.interval_seconds.value = config.plugins.epgrefresh.interval.value * 60 config.plugins.epgrefresh.interval.value = 2 config.plugins.epgrefresh.save() #pragma mark - Help try:
def __init__(self, session, title="", list=[], keys=None, selection=0, skin_name=[], extEntry=None): Screen.__init__(self, session) if isinstance(skin_name, str): skin_name = [skin_name] self.skinName = skin_name + ["ChoiceBox"] if title: title = _(title) # [iq try: if skin_name[0] == "ExtensionsList": from Components.Network import iNetwork from Components.config import ConfigIP, NoSave self.local_ip = NoSave( ConfigIP( default=iNetwork.getAdapterAttribute("eth0", "ip"))) if self.local_ip.getText() is not None: self["text"] = Label("IP: getting...\n" + "Local IP: " + self.local_ip.getText()) else: self["text"] = Label("IP: getting...\n" + "Local IP: getting...") else: if len(title) < 55: Screen.setTitle(self, title) self["text"] = Label("") else: self["text"] = Label(title) except: # iq] if len(title) < 55: Screen.setTitle(self, title) self["text"] = Label("") else: self["text"] = Label(title) self.list = [] self.extEntry = extEntry # [iq] self.summarylist = [] if keys is None: self.__keys = [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "red", "green", "yellow", "blue" ] + (len(list) - 10) * [""] else: self.__keys = keys + (len(list) - len(keys)) * [""] self.keymap = {} pos = 0 for x in list: strpos = str(self.__keys[pos]) self.list.append(ChoiceEntryComponent(key=strpos, text=x)) if self.__keys[pos] != "": self.keymap[self.__keys[pos]] = list[pos] self.summarylist.append((self.__keys[pos], x[0])) pos += 1 self["list"] = ChoiceList(list=self.list, selection=selection) self["summary_list"] = StaticText() self["summary_selection"] = StaticText() self.updateSummary(selection) # self["actions"] = NumberActionMap(["WizardActions", "InputActions", "ColorActions", "DirectionActions"], self["actions"] = NumberActionMap( [ "WizardActions", "InputActions", "ColorActions", "DirectionActions", "InfobarChannelSelection" ], { "ok": self.go, "back": self.cancel, "1": self.keyNumberGlobal, "2": self.keyNumberGlobal, "3": self.keyNumberGlobal, "4": self.keyNumberGlobal, "5": self.keyNumberGlobal, "6": self.keyNumberGlobal, "7": self.keyNumberGlobal, "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, "0": self.keyNumberGlobal, "red": self.keyRed, "green": self.keyGreen, "yellow": self.keyYellow, "blue": self.keyBlue, "up": self.up, "down": self.down, # [iq "openSatellites": self.extEntryReady, "menu": self.extEntryGo, # iq] }, -1) # [iq self.extEntryExecuted = -1 try: if skin_name[0] == "ExtensionsList": self.StaticIPTimer = enigma.eTimer() self.StaticIPTimer.callback.append(self.iptimeout) self.iptimeout() except: pass
from Components.config import config, ConfigYesNo, NoSave, ConfigSubsection, ConfigText, ConfigSelection, ConfigPassword from Components.Network import iNetwork from Plugins.Plugin import PluginDescriptor from Tools.Directories import resolveFilename, SCOPE_SKIN_IMAGE from Tools.LoadPixmap import LoadPixmap from Wlan import iWlan, iStatus, getWlanConfigName plugin_path = eEnv.resolve( "${libdir}/enigma2/python/Plugins/SystemPlugins/WirelessLan") list = ["Unencrypted", "WEP", "WPA", "WPA/WPA2", "WPA2"] weplist = ["ASCII", "HEX"] config.plugins.wlan = ConfigSubsection() config.plugins.wlan.essid = NoSave(ConfigText(default="", fixed_size=False)) config.plugins.wlan.hiddenessid = NoSave(ConfigYesNo(default=False)) config.plugins.wlan.encryption = NoSave(ConfigSelection(list, default="WPA2")) config.plugins.wlan.wepkeytype = NoSave( ConfigSelection(weplist, default="ASCII")) config.plugins.wlan.psk = NoSave(ConfigPassword(default="", fixed_size=False)) class WlanStatus(Screen): skin = """ <screen name="WlanStatus" position="center,center" size="560,400" title="Wireless network status" > <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" /> <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" /> <widget source="LabelBSSID" render="Label" position="10,60" size="200,25" valign="left" font="Regular;20" transparent="1" foregroundColor="#FFFFFF" /> <widget source="LabelESSID" render="Label" position="10,100" size="200,25" valign="center" font="Regular;20" transparent="1" foregroundColor="#FFFFFF" />
profile("LOAD:skin") from skin import readSkin profile("LOAD:Tools") from Tools.Directories import InitFallbackFiles, resolveFilename, SCOPE_PLUGINS, SCOPE_CURRENT_SKIN from Components.config import config, configfile, ConfigText, ConfigYesNo, ConfigInteger, NoSave InitFallbackFiles() profile("config.misc") config.misc.radiopic = ConfigText( default=resolveFilename(SCOPE_CURRENT_SKIN, "radio.mvi")) config.misc.isNextRecordTimerAfterEventActionAuto = ConfigYesNo(default=False) config.misc.useTransponderTime = ConfigYesNo(default=True) config.misc.startCounter = ConfigInteger(default=0) # number of e2 starts... config.misc.standbyCounter = NoSave( ConfigInteger(default=0)) # number of standby config.misc.epgcache_filename = ConfigText(default="/hdd/epg.dat") def setEPGCachePath(configElement): eEPGCache.getInstance().setCacheFile(configElement.value) #demo code for use of standby enter leave callbacks #def leaveStandby(): # print "!!!!!!!!!!!!!!!!!leave standby" #def standbyCountChanged(configElement): # print "!!!!!!!!!!!!!!!!!enter standby num", configElement.value # from Screens.Standby import inStandby # inStandby.onClose.append(leaveStandby)
def InitOsd(): SystemInfo["CanChange3DOsd"] = (access('/proc/stb/fb/3dmode', R_OK) or access('/proc/stb/fb/primary/3d', R_OK)) and True or False def languageNotifier(configElement): language.activateLanguage(configElement.value) config.osd = ConfigSubsection() config.osd.language = ConfigText(default="en_GB") config.osd.language.addNotifier(languageNotifier) config.osd.dst_left = ConfigSelectionNumber(default=0, stepwidth=1, min=0, max=720, wraparound=False) config.osd.dst_width = ConfigSelectionNumber(default=720, stepwidth=1, min=0, max=720, wraparound=False) config.osd.dst_top = ConfigSelectionNumber(default=0, stepwidth=1, min=0, max=576, wraparound=False) config.osd.dst_height = ConfigSelectionNumber(default=576, stepwidth=1, min=0, max=576, wraparound=False) config.osd.alpha = ConfigSelectionNumber(default=255, stepwidth=1, min=0, max=255, wraparound=False) config.av.osd_alpha = NoSave(ConfigNumber(default=255)) config.osd.threeDmode = ConfigSelection( [("off", _("Off")), ("auto", _("Auto")), ("sidebyside", _("Side by Side")), ("topandbottom", _("Top and Bottom"))], "auto") config.osd.threeDznorm = ConfigSlider(default=50, increment=1, limits=(0, 100)) config.osd.show3dextensions = ConfigYesNo(default=False) def set3DMode(configElement): if SystemInfo["CanChange3DOsd"] and getBoxType() not in ('spycat'): print '[UserInterfacePositioner] Setting 3D mode:', configElement.value file3d = fileCheck('/proc/stb/fb/3dmode') or fileCheck( '/proc/stb/fb/primary/3d') f = open(file3d, "w") f.write(configElement.value) f.close() config.osd.threeDmode.addNotifier(set3DMode) def set3DZnorm(configElement): if SystemInfo["CanChange3DOsd"] and getBoxType() not in ('spycat'): print '[UserInterfacePositioner] Setting 3D depth:', configElement.value f = open("/proc/stb/fb/znorm", "w") f.write('%d' % int(configElement.value)) f.close() config.osd.threeDznorm.addNotifier(set3DZnorm)
profile('config.misc') config.misc.boxtype = ConfigText(default=boxtype) config.misc.blackradiopic = ConfigText( default=resolveFilename(SCOPE_ACTIVE_SKIN, 'black.mvi')) radiopic = resolveFilename(SCOPE_ACTIVE_SKIN, 'radio.mvi') if os.path.exists(resolveFilename(SCOPE_CONFIG, 'radio.mvi')): radiopic = resolveFilename(SCOPE_CONFIG, 'radio.mvi') config.misc.radiopic = ConfigText(default=radiopic) config.misc.nextWakeup = ConfigText(default='-1,-1,-1,0,0,-1,0') config.misc.SyncTimeUsing = ConfigSelection(default='0', choices=[('0', _('Transponder Time')), ('1', _('NTP'))]) config.misc.NTPserver = ConfigText(default='pool.ntp.org', fixed_size=False) config.misc.startCounter = ConfigInteger(default=0) config.misc.standbyCounter = NoSave(ConfigInteger(default=0)) config.misc.DeepStandby = NoSave(ConfigYesNo(default=False)) config.misc.query_restart = ConfigYesNo(default=False) config.misc.query_restart_full = ConfigYesNo(default=False) config.misc.fadeShowMenu = ConfigYesNo(default=False) config.misc.enableAnimation = ConfigYesNo(default=False) config.misc.enableAnimationInfobar = ConfigYesNo(default=False) config.misc.enableAnimationInfobarMovie = ConfigYesNo(default=False) config.misc.enableAnimationMenuScreens = ConfigYesNo(default=False) config.misc.enableAnimationChSelection = ConfigYesNo(default=False) def queryRestart(configElement): config.misc.query_restart.value = True
profile("LOAD:skin") from skin import readSkin profile("LOAD:Tools") from Tools.Directories import InitFallbackFiles, resolveFilename, SCOPE_PLUGINS, SCOPE_CURRENT_SKIN from Components.config import config, configfile, ConfigText, ConfigYesNo, ConfigInteger, NoSave InitFallbackFiles() profile("config.misc") config.misc.radiopic = ConfigText( default=resolveFilename(SCOPE_CURRENT_SKIN, "radio.mvi")) config.misc.blackradiopic = ConfigText( default=resolveFilename(SCOPE_CURRENT_SKIN, "black.mvi")) config.misc.useTransponderTime = ConfigYesNo(default=True) config.misc.startCounter = ConfigInteger(default=0) # number of e2 starts... config.misc.standbyCounter = NoSave( ConfigInteger(default=0)) # number of standby config.misc.DeepStandby = NoSave( ConfigYesNo(default=False)) # detect deepstandby config.misc.RestartUI = ConfigYesNo( default=False) # detect user interface restart config.misc.epgcache_filename = ConfigText(default="/hdd/epg.dat") def setEPGCachePath(configElement): enigma.eEPGCache.getInstance().setCacheFile(configElement.value) #demo code for use of standby enter leave callbacks #def leaveStandby(): # print "!!!!!!!!!!!!!!!!!leave standby"
def localeInit(): gettext.bindtextdomain(PluginLanguageDomain, resolveFilename(SCOPE_PLUGINS, PluginLanguagePath)) def _(txt): if gettext.dgettext(PluginLanguageDomain, txt): return gettext.dgettext(PluginLanguageDomain, txt) else: return gettext.gettext(txt) language.addCallback(localeInit()) ################################################# config.plugins.DVDBackup = ConfigSubsection() config.plugins.DVDBackup.device = NoSave(ConfigText(default="/dev/sr0", fixed_size=False)) config.plugins.DVDBackup.directory = ConfigText(default="/media/hdd", fixed_size=False) config.plugins.DVDBackup.name = NoSave(ConfigText(default=_("Name of DVD"), fixed_size=False)) config.plugins.DVDBackup.log = ConfigYesNo(default=True) config.plugins.DVDBackup.show_message = ConfigYesNo(default=True) config.plugins.DVDBackup.create_iso = ConfigSelection(default = "no", choices = [("no", _("no")),("genisoimage", _("with genisoimage (slower)")),("dd", _("with dd (faster)"))]) cfg = config.plugins.DVDBackup ################################################# SESSION = None def isCdromMount(file=None): if file: try: f = open('/proc/mounts', 'r')
def createSetup(self): self.changePin = None self.reloadLists = None self.list = [] self.list.append( getConfigListEntry(_("Protect services"), config.ParentalControl.servicepinactive)) if config.ParentalControl.servicepinactive.value: self.changePin = getConfigListEntry(_("Change service PINs"), NoSave(ConfigNothing())) self.list.append(self.changePin) self.list.append( getConfigListEntry(_("Remember service PIN"), config.ParentalControl.storeservicepin)) if config.ParentalControl.storeservicepin.value != "never": self.list.append( getConfigListEntry(_("Hide parental locked services"), config.ParentalControl.hideBlacklist)) self.list.append( getConfigListEntry(_("Protect on epg age"), config.ParentalControl.age)) self.reloadLists = getConfigListEntry(_("Reload blacklists"), NoSave(ConfigNothing())) self.list.append(self.reloadLists) self.list.append( getConfigListEntry(_("Protect setup"), config.ParentalControl.setuppinactive)) if config.ParentalControl.setuppinactive.value: if not self.changePin: self.changePin = getConfigListEntry(_("Change setup PIN"), NoSave(ConfigNothing())) self.list.append(self.changePin) self.list.append( getConfigListEntry( _("Protect main menu"), config.ParentalControl.config_sections.main_menu)) if not config.ParentalControl.config_sections.main_menu.value: self.list.append( getConfigListEntry( _("Protect timer menu"), config.ParentalControl.config_sections.timer_menu)) self.list.append( getConfigListEntry( _("Protect plugin browser"), config.ParentalControl.config_sections.plugin_browser)) self.list.append( getConfigListEntry( _("Protect configuration"), config.ParentalControl.config_sections.configuration)) self.list.append( getConfigListEntry( _("Protect standby menu"), config.ParentalControl.config_sections.standby_menu)) self.list.append( getConfigListEntry( _("Protect hdf toolbox"), config.ParentalControl.config_sections.hdftoolbox)) self.list.append( getConfigListEntry( _("Protect movie list"), config.ParentalControl.config_sections.movie_list)) self.list.append( getConfigListEntry( _("Protect context menus"), config.ParentalControl.config_sections.context_menus)) self["config"].list = self.list self["config"].setList(self.list)
def __init__(self): logger.info("...") auto_lang_list = Autoselect639Language( ).getTranslatedChoicesDictAndSortedListAndDefaults()[1] config.plugins.moviecockpit = ConfigSubsection() config.plugins.moviecockpit.timer_autoclean = ConfigYesNo( default=False) config.plugins.moviecockpit.cover_auto_download = ConfigYesNo( default=False) config.plugins.moviecockpit.cover_fallback = ConfigYesNo(default=True) config.plugins.moviecockpit.cover_replace_existing = ConfigYesNo( default=False) config.plugins.moviecockpit.cover_language = ConfigSelection( default=language.getActiveLanguage()[:2], choices=auto_lang_list) config.plugins.moviecockpit.cover_size = ConfigSelection( default="w500", choices=["w92", "w185", "w500", "original"]) config.plugins.moviecockpit.backdrop_size = ConfigSelection( default="w1280", choices=["w300", "w780", "w1280", "original"]) config.plugins.moviecockpit.cover_source = ConfigSelection( default="tvs_id", choices=choices_cover_source) config.plugins.moviecockpit.fake_entry = NoSave(ConfigNothing()) config.plugins.moviecockpit.extmenu_settings = ConfigYesNo( default=True) config.plugins.moviecockpit.extmenu_plugin = ConfigYesNo(default=True) config.plugins.moviecockpit.epglang = ConfigSelection( default=language.getActiveLanguage(), choices=langListEPG()) config.plugins.moviecockpit.sublang1 = ConfigSelection( default=language.lang[language.getActiveLanguage()][1], choices=auto_lang_list) config.plugins.moviecockpit.sublang2 = ConfigSelection( default=language.lang[language.getActiveLanguage()][1], choices=auto_lang_list) config.plugins.moviecockpit.sublang3 = ConfigSelection( default=language.lang[language.getActiveLanguage()][1], choices=auto_lang_list) config.plugins.moviecockpit.audlang1 = ConfigSelection( default=language.lang[language.getActiveLanguage()][1], choices=auto_lang_list) config.plugins.moviecockpit.audlang2 = ConfigSelection( default=language.lang[language.getActiveLanguage()][1], choices=auto_lang_list) config.plugins.moviecockpit.audlang3 = ConfigSelection( default=language.lang[language.getActiveLanguage()][1], choices=auto_lang_list) config.plugins.moviecockpit.autosubs = ConfigYesNo(default=False) config.plugins.moviecockpit.autoaudio = ConfigYesNo(default=False) config.plugins.moviecockpit.autoaudio_ac3 = ConfigYesNo(default=False) config.plugins.moviecockpit.list_start_home = ConfigYesNo(default=True) config.plugins.moviecockpit.list_dirs_inline = ConfigYesNo( default=True) config.plugins.moviecockpit.movie_description_delay = ConfigNumber( default=200) config.plugins.moviecockpit.list_show_mount_points = ConfigYesNo( default=False) config.plugins.moviecockpit.movie_watching_percent = ConfigSelectionNumber( 0, 30, 1, default=10) config.plugins.moviecockpit.movie_finished_percent = ConfigSelectionNumber( 50, 100, 1, default=90) config.plugins.moviecockpit.movie_date_format = ConfigSelection( default="%d.%m.%Y %H:%M", choices=choices_date) config.plugins.moviecockpit.movie_ignore_first_marks = ConfigYesNo( default=True) config.plugins.moviecockpit.movie_resume_at_last_pos = ConfigYesNo( default=True) config.plugins.moviecockpit.movie_start_position = ConfigSelection( default="event_start", choices=[("beginning", _("beginning")), ("first_mark", _("first mark")), ("event_start", _("event start"))]) config.plugins.moviecockpit.trashcan_enable = ConfigYesNo(default=True) config.plugins.moviecockpit.trashcan_clean = ConfigYesNo(default=True) config.plugins.moviecockpit.trashcan_retention = ConfigNumber( default=3) config.plugins.moviecockpit.trashcan_show = ConfigYesNo(default=True) config.plugins.moviecockpit.trashcan_info = ConfigSelection( default="CS", choices=choices_dir_info) config.plugins.moviecockpit.directories_show = ConfigYesNo( default=True) config.plugins.moviecockpit.directories_info = ConfigSelection( default="CS", choices=choices_dir_info) config.plugins.moviecockpit.color = ConfigSelection( default="#bababa", choices=choices_color_selection) config.plugins.moviecockpit.color_sel = ConfigSelection( default="#ffffff", choices=choices_color_selection) config.plugins.moviecockpit.recording_color = ConfigSelection( default="#ff1616", choices=choices_color_recording) config.plugins.moviecockpit.recording_color_sel = ConfigSelection( default="#ff3838", choices=choices_color_recording) config.plugins.moviecockpit.selection_color = ConfigSelection( default="#cccc00", choices=choices_color_mark) config.plugins.moviecockpit.selection_color_sel = ConfigSelection( default="#ffff00", choices=choices_color_mark) config.plugins.moviecockpit.list_sort = ConfigSelection( default="0", choices=choices_sort) config.plugins.moviecockpit.list_style = ConfigNumber(default=3) config.plugins.moviecockpit.launch_key = ConfigSelection( default="showMovies", choices=choices_launch_key) config.plugins.moviecockpit.layout_screen = ConfigSelection( default="layout_screen_default.xml", choices=choices_layout_screen) config.plugins.moviecockpit.layout_button = ConfigSelection( default="layout_button_default.xml", choices=choices_layout_button) config.plugins.moviecockpit.list_bouquet_keys = ConfigSelection( default="", choices=choices_bouquet_keys) config.plugins.moviecockpit.list_skip_size = ConfigSelectionNumber( 1, 10, 1, default=5) config.plugins.moviecockpit.debug_log_level = ConfigSelection( default="INFO", choices=log_levels.keys()) config.plugins.moviecockpit.debug_log_path = ConfigDirectory( default="/media/hdd") config.plugins.moviecockpit.bookmarks = ConfigSet([], []) if not config.plugins.moviecockpit.bookmarks.value: config.plugins.moviecockpit.bookmarks.value = initBookmarks() config.plugins.moviecockpit.bookmarks.save() config.plugins.cachecockpit = ConfigSubsection() config.plugins.cachecockpit.fake_entry = NoSave(ConfigNothing()) config.plugins.cachecockpit.archive_enable = ConfigYesNo(default=False) config.plugins.cachecockpit.archive_source_dir = ConfigDirectory( default="/media/hdd/movie") config.plugins.cachecockpit.archive_target_dir = ConfigDirectory( default="/media/hdd/movie") config.plugins.cachecockpit.debug_log_path = ConfigDirectory( default="/media/hdd") config.plugins.cachecockpit.debug_log_level = ConfigSelection( default="INFO", choices=log_levels.keys()) checkList(config.plugins.moviecockpit.epglang) checkList(config.plugins.moviecockpit.sublang1) checkList(config.plugins.moviecockpit.sublang2) checkList(config.plugins.moviecockpit.sublang3) checkList(config.plugins.moviecockpit.audlang1) checkList(config.plugins.moviecockpit.audlang2) checkList(config.plugins.moviecockpit.audlang3)
file('/etc/cron/crontabs/root.tmp', 'w').writelines([l for l in file('/etc/cron/crontabs/root').readlines() if myline not in l]) rename('/etc/cron/crontabs/root.tmp','/etc/cron/crontabs/root') rc = system('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) def closeRecursive(self): self.close(True) 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")),('Sunday', _("Sunday"))])) config.crontimers.dayofmonth = NoSave(ConfigInteger(default=1, limits=(1, 31))) class CronTimersConfig(Screen, ConfigListScreen): def __init__(self, session): Screen.__init__(self, session) Screen.setTitle(self, _("Cron Manager")) self.skinName = "Setup" self.onChangedEntry = [ ] self.list = [] ConfigListScreen.__init__(self, self.list, session = self.session, on_change = self.changedEntry)
def createSetup(self, initial=False): self.reloadLists = None self.list = [] if config.ParentalControl.servicepin[ 0].value or config.ParentalControl.servicepinactive.value or config.ParentalControl.setuppinactive.value or not initial: if config.ParentalControl.servicepin[0].value: pin_entry_text = _("Change PIN") + _( ": 0000 - default (disabled)") else: pin_entry_text = _("Set PIN") self.changePin = getConfigListEntry(pin_entry_text, NoSave(ConfigNothing())) self.list.append(self.changePin) self.list.append( getConfigListEntry(_("Protect services"), config.ParentalControl.servicepinactive)) if config.ParentalControl.servicepinactive.value: self.list.append( getConfigListEntry(_("Remember service PIN"), config.ParentalControl.storeservicepin)) if config.ParentalControl.storeservicepin.value != "never": self.list.append( getConfigListEntry( _("Hide parentel locked services"), config.ParentalControl.hideBlacklist)) self.list.append( getConfigListEntry(_("Protect on epg age"), config.ParentalControl.age)) self.reloadLists = getConfigListEntry(_("Reload blacklists"), NoSave(ConfigNothing())) self.list.append(self.reloadLists) self.list.append( getConfigListEntry(_("Protect Screens"), config.ParentalControl.setuppinactive)) if config.ParentalControl.setuppinactive.value: self.list.append( getConfigListEntry( _("Protect main menu"), config.ParentalControl.config_sections.main_menu)) self.list.append( getConfigListEntry( _("Protect timer menu"), config.ParentalControl.config_sections.timer_menu)) self.list.append( getConfigListEntry( _("Protect plugin browser"), config.ParentalControl.config_sections.plugin_browser)) self.list.append( getConfigListEntry( _("Protect configuration"), config.ParentalControl.config_sections.configuration)) self.list.append( getConfigListEntry( _("Protect standby menu"), config.ParentalControl.config_sections.standby_menu)) self.list.append( getConfigListEntry( _("Protect software update screen"), config. ParentalControl.config_sections.software_update)) self.list.append( getConfigListEntry( _("Protect manufacturer reset screen"), config. ParentalControl.config_sections.manufacturer_reset)) self.list.append( getConfigListEntry( _("Protect movie list"), config.ParentalControl.config_sections.movie_list)) self.list.append( getConfigListEntry( _("Protect context menus"), config.ParentalControl.config_sections.context_menus)) if config.usage.menu_sort_mode.value == "user": self.list.append( getConfigListEntry( _("Protect menu sort"), config.ParentalControl.config_sections.menu_sort)) else: self.changePin = getConfigListEntry( _("Enable parental protection"), NoSave(ConfigNothing())) self.list.append(self.changePin) self["config"].list = self.list self["config"].setList(self.list)
def __init__(self, session, iface, plugin_path): self.skin = setupNfs.skin self.session = session Screen.__init__(self, session) self.container = eConsoleAppContainer() self.container.appClosed.append(self.runFinished) self.container.dataAvail.append(self.dataAvail) if isRunning('portmap') and isRunning('nfsd'): isEnabled = True else: isEnabled = False self.activeConfigEntry = NoSave(ConfigEnableDisable(default = isEnabled)) self["nfsdLabel"] = Label() self["portmapLabel"] = Label() self["ButtonGreen"] = Pixmap() self["ButtonGreentext"] = Button(_("save and start/restart NFS-Server")) self["ButtonRed"] = Pixmap() self["ButtonRedtext"] = Label(_("Close")) self["ButtonYellow"] = Pixmap() self["ButtonYellowtext"] = Label(_("New Entry")) self["ButtonBlue"] = Pixmap() self["ButtonBluetext"] = Label(_("Remove Entry")) self.startingUp = False self.goingDown = False self.cmdlist = [] self.run = 0 self.exportlist = [] data = self.readExports() if data is not None: for line in data: exportDir = line[0] client = line[1] options = line[2] options = options.replace('(', '') options = options.replace(')', '') self.exportlist.append((exportDir, client, options)) else: self.exportlist.append(('/media/hdd', '*', 'rw,no_root_squash,sync')) self["exportlist"] = List(self.exportlist) self.hideList = self["exportlist"].list self.createSetup() ConfigListScreen.__init__(self, self.list, session = session) self.activeConfigEntry.addNotifier(self.toggleServer) self["actions"] = ActionMap(["OkCancelActions", "ColorActions"], { "cancel" : self.cancel, "ok" : self.editExportEntry, "green" : self.green, "red" : self.cancel, "yellow" : self.newExportEntry, "blue" : self.deleteExportEntry }, -2)
profile("LOAD:skin") from skin import readSkin, SkinError profile("LOAD:Tools") from Tools.Directories import InitFallbackFiles, resolveFilename, SCOPE_CURRENT_SKIN, SCOPE_PLUGINS, SCOPE_CONFIG from Components.config import config, configfile, ConfigText, ConfigYesNo, ConfigInteger, ConfigSelection, NoSave, ConfigSubsection InitFallbackFiles() profile("config.misc") config.misc.radiopic = ConfigText( default=resolveFilename(SCOPE_CURRENT_SKIN, "radio.mvi")) config.misc.isNextRecordTimerAfterEventActionAuto = ConfigYesNo(default=False) config.misc.useTransponderTime = ConfigYesNo(default=True) config.misc.startCounter = ConfigInteger(default=0) # number of e2 starts... config.misc.standbyCounter = NoSave( ConfigInteger(default=0)) # number of standby config.misc.epgcache_filename = ConfigText( default=resolveFilename(SCOPE_CONFIG, "epg.db")) config.misc.epgcache_timespan = ConfigSelection(default="28", choices=[("7", _("7 days")), ("14", _("14 days")), ("21", _("21 days")), ("28", _("28 days"))]) config.misc.epgcache_outdated_timespan = ConfigInteger(default=0, limits=(0, 96)) config.misc.record_io_buffer = ConfigInteger(default=192512 * 5) config.misc.record_dmx_buffer = ConfigInteger(default=1024 * 1024) config.misc.prev_wakeup_time = ConfigInteger(default=0) #config.misc.prev_wakeup_time_type is only valid when wakeup_time is not 0 config.misc.prev_wakeup_time_type = ConfigInteger( default=0) # 0 = RecordTimer, 1 = SleepTimer, 2 = Plugin