Exemplo n.º 1
0
def getTranscoding():
    if BoxInfo.getItem("transcoding") or BoxInfo.getItem("multitranscoding"):
        return True
    elif os.path.isfile("/proc/stb/encoder/0/bitrate"):
        return isPluginInstalled("TranscodingSetup") or isPluginInstalled(
            "TransCodingSetup") or isPluginInstalled("MultiTransCodingSetup")
    return False
Exemplo n.º 2
0
def PartnerboxInit(self, filterRef):
    self.filterRef = filterRef
    self.isTMBD = isPluginInstalled("TMBD")
    self.AutoTimer = isPluginInstalled("AutoTimer")
    self.partnerboxentry = None
    partnerboxfunctions.remote_timer_list = []
    if int(config.plugins.Partnerbox.entriescount.value) >= 1:
        try:
            self.partnerboxentry = config.plugins.Partnerbox.Entries[0]
            partnerboxfunctions.CurrentIP = self.partnerboxentry.ip.value
        except:
            self.partnerboxentry = None
        self.setRedbutton()
Exemplo n.º 3
0
 def run8(self):
     self.runed = "8"
     if config.easysetup.hdmicec.value is True and isPluginInstalled(
             "HdmiCEC"):
         self.session.openWithCallback(self.run9, HdmiCECSetupScreen)
     else:
         self.run9()
Exemplo n.º 4
0
    def openMenu(self):
        if self.movemode:
            # TRANSLATORS: there is no need to translate this string, as it was reused from e2 core
            moveString = _("disable move mode")
        else:
            # TRANSLATORS: there is no need to translate this string, as it was reused from e2 core
            moveString = _("enable move mode")

        list = [
            (moveString, self.toggleMoveMode),
            (_("move extensions"),
             boundFunction(self.openMover,
                           PluginDescriptor.WHERE_EXTENSIONSMENU)),
            (_("move movie extensions"),
             boundFunction(self.openMover, PluginDescriptor.WHERE_MOVIELIST)),
            (_("move event extensions"),
             boundFunction(self.openMover, PluginDescriptor.WHERE_EVENTINFO)),
        ]

        if isPluginInstalled("PluginHider"):
            list.insert(0, (_("hide selected plugin"), self.hidePlugin))

        if pluginSortHelp:
            list.insert(
                0,
                (_("Help"), boundFunction(pluginSortHelp.open, self.session)))

        self.session.openWithCallback(
            self.menuCallback,
            ChoiceBox,
            list=list,
        )
Exemplo n.º 5
0
 def Qnetwork(self):
     self.sublist = []
     if isPluginInstalled("NetworkWizard"):
         self.sublist.append(
             QuickSubMenuEntryComponent(
                 "Network Wizard", _("Configure your Network"),
                 _("Use the Networkwizard to configure your Network. The wizard will help you to setup your network"
                   )))
     if len(
             self.adapters
     ) > 1:  # show only adapter selection if more as 1 adapter is installed
         self.sublist.append(
             QuickSubMenuEntryComponent(
                 "Network Adapter Selection", _("Select Lan/Wlan"),
                 _("Setup your network interface. If no Wlan stick is used, you only can select Lan"
                   )))
     if not self.activeInterface == None:  # show only if there is already a adapter up
         self.sublist.append(
             QuickSubMenuEntryComponent(
                 "Network Interface", _("Setup interface"),
                 _("Setup network. Here you can setup DHCP, IP, DNS")))
     self.sublist.append(
         QuickSubMenuEntryComponent(
             "Network Restart", _("Restart network to with current setup"),
             _("Restart network and remount connections")))
     self.sublist.append(
         QuickSubMenuEntryComponent(
             "Network Services", _("Setup Network Services"),
             _("Setup Network Services (Samba, Ftp, NFS, ...)")))
     self["sublist"].l.setList(self.sublist)
 def runTMBD(self):
     if isPluginInstalled("TMBD"):
         from Plugins.Extensions.TMBD.plugin import TMBD
         description = _("TMBD Details")
         description = _("TMBD details for event")
         description = _("Query details from the Internet Movie Database")
         cur = self["list"].getCurrent()
         if cur[0] is not None:
             name2 = cur[0].getEventName() or ''
             name3 = name2.split("(")[0].strip()
             eventname = name3.replace('"',
                                       '').replace('', '').replace('.', '')
             eventname = eventname.replace('', '')
             try:
                 tmbdsearch = config.plugins.tmbd.profile.value
             except:
                 tmbdsearch = None
             if tmbdsearch is not None:
                 if config.plugins.tmbd.profile.value == "0":
                     self.session.open(TMBD, eventname, False)
                 else:
                     try:
                         from Plugins.Extensions.TMBD.plugin import KinoRu
                         self.session.open(KinoRu, eventname, False)
                     except:
                         pass
             else:
                 self.session.open(TMBD, eventname, False)
Exemplo n.º 7
0
	def openExtensionmanager(self):
		if isPluginInstalled("SoftwareManager"):
			try:
				from Plugins.SystemPlugins.SoftwareManager.plugin import PluginManager
			except ImportError:
				self.session.open(MessageBox, _("The software management extension is not installed!\nPlease install it."), type=MessageBox.TYPE_INFO, timeout=10)
			else:
				self.session.openWithCallback(self.PluginDownloadBrowserClosed, PluginManager)
 def GoToTmbd(self):
     if isPluginInstalled("TMBD"):
         self.runTMBD()
     else:
         self.session.openWithCallback(
             self.doInstall, MessageBox,
             _('The TMBD plugin is not installed!\nDo you want to install it?'
               ), MessageBox.TYPE_YESNO)
Exemplo n.º 9
0
 def keyl(self):
     try:
         if isPluginInstalled("TimeSleep"):
             from Plugins.Extensions.TimeSleep.plugin import timesleep
             timesleep(self, False)
         else:
             InfoBarSeek.seekBackManual(self)
     except:
         InfoBarSeek.seekBackManual(self)
Exemplo n.º 10
0
def autostart(session):
    global resolutionlabel
    if not isPluginInstalled("AutoResolution"):
        if resolutionlabel is None:
            resolutionlabel = session.instantiateDialog(AutoVideoModeLabel)
        AutoVideoMode(session)
    else:
        config.av.autores.setValue(False)
        config.av.autores.save()
        configfile.save()
Exemplo n.º 11
0
	def softcamInfo(self):
		ppanelFilename = "/etc/ppanels/%s.xml" % config.misc.softcams.value
		if "oscam" in config.misc.softcams.value.lower() and isfile('/usr/lib/enigma2/python/Screens/OScamInfo.py'):
			from Screens.OScamInfo import OscamInfoMenu
			self.session.open(OscamInfoMenu)
		elif "cccam" in config.misc.softcams.lower() and isfile('/usr/lib/enigma2/python/Screens/CCcamInfo.py'):
			from Screens.CCcamInfo import CCcamInfoMain
			self.session.open(CCcamInfoMain)
		elif isfile(ppanelFilename) and isPluginInstalled("PPanel"):
			from Plugins.Extensions.PPanel.ppanel import PPanel
			self.session.open(PPanel, name="%s PPanel" % config.misc.softcams.value, node=None, filename=ppanelFilename, deletenode=None)
Exemplo n.º 12
0
 def softcamInfo(self):
     ppanelFilename = "/etc/ppanels/%s.xml" % config.misc.softcams.value
     if "oscam" or "ncam" in config.misc.softcams.value.lower():
         from Screens.OScamInfo import OscamInfoMenu
         self.session.open(OscamInfoMenu)
     elif isfile(ppanelFilename) and isPluginInstalled("PPanel"):
         from Plugins.Extensions.PPanel.ppanel import PPanel
         self.session.open(PPanel,
                           name="%s PPanel" % config.misc.softcams.value,
                           node=None,
                           filename=ppanelFilename,
                           deletenode=None)
Exemplo n.º 13
0
	def menu(self):
		options = [
			(_("Import from Timer"), self.importFromTimer),
			(_("Import from EPG"), self.importFromEPG),
		]
		try:
			cur = self['list'].getCurrent()
			event = cur[0]
		except:
			event = None
		if event:
			options.append((_("Zap to selected service"), self.zapToSelectedService))
		if autoTimerAvailable:
			options.extend((
				(_("Import from AutoTimer"), self.importFromAutoTimer),
				(_("Save search as AutoTimer"), self.addAutoTimer),
				(_("Export selected as AutoTimer"), self.exportAutoTimer),
			))
		if isPluginInstalled("TMBD"):
			options.append((_("Search for TMDb info"), self.opentmdb))
		if isPluginInstalled("IMDb"):
			options.append((_("Open selected in IMDb"), self.openImdb))
		history = config.plugins.epgsearch.history.value
		if len(history) > 0:
			options.append((_("Clear history"), self.ClearHistory))
		options.append((_("Timers list"), self.openTimerslist))

		keys = ["menu"]
		keys = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "red", "green", "yellow", "blue"][:len(options)] + (len(options) - 14) * [""] + keys
		options.append((_("Setup"), self.setup))

		self.session.openWithCallback(
			self.menuCallback,
			ChoiceBox,
			list=options,
			keys=keys
		)
Exemplo n.º 14
0
 def okbuttonClick(self):
     selection = self["menu"].getCurrent()
     if selection is not None:
         if selection[1] == "MC_VideoPlayer":
             from .MC_VideoPlayer import MC_VideoPlayer
             self.session.open(MC_VideoPlayer)
         elif selection[1] == "MC_DVDPlayer":
             if dvdplayer:
                 self.session.open(DVDPlayer)
             else:
                 self.session.open(
                     MessageBox,
                     "Error: DVD-Player Plugin not installed ...",
                     MessageBox.TYPE_INFO)
         elif selection[1] == "MC_PictureViewer":
             from .MC_PictureViewer import MC_PictureViewer
             self.session.open(MC_PictureViewer)
         elif selection[1] == "MC_AudioPlayer":
             from .MC_AudioPlayer import MC_AudioPlayer
             self.session.open(MC_AudioPlayer)
         elif selection[1] == "MC_WebRadio":
             from .MC_AudioPlayer import MC_WebRadio
             self.session.open(MC_WebRadio)
         elif selection[1] == "MC_VLCPlayer":
             if isPluginInstalled("VlcPlayer"):
                 from .MC_VLCPlayer import MC_VLCServerlist
                 self.session.open(MC_VLCServerlist)
             else:
                 self.session.open(
                     MessageBox,
                     "Error: VLC-Player Plugin not installed ...",
                     MessageBox.TYPE_INFO)
         elif selection[1] == "MC_WeatherInfo":
             from .MC_WeatherInfo import MC_WeatherInfo
             self.session.open(MC_WeatherInfo)
         elif selection[1] == "MC_Settings":
             from .MC_Settings import MC_Settings
             self.session.open(MC_Settings)
         else:
             self.session.open(
                 MessageBox,
                 ("Error: Could not find plugin %s\ncoming soon ... :)") %
                 (selection[1]), MessageBox.TYPE_INFO)
Exemplo n.º 15
0
    def menu(self):
        options = [
            (_("Import from Timer"), self.importFromTimer),
            (_("Import from EPG"), self.importFromEPG),
            (_("Show search history"), self.showHistory),
        ]

        if autoTimerAvailable:
            options.extend((
                (_("Import from AutoTimer"), self.importFromAutoTimer),
                (_("Save search as AutoTimer"), self.addAutoTimer),
            ))
        if isPluginInstalled("IMDb"):
            options.append((_("Open selected in IMDb"), self.openImdb))
        options.append((_("Setup"), self.setup))

        self.session.openWithCallback(self.menuCallback,
                                      ChoiceBox,
                                      title=_("EPG Search setup"),
                                      list=options)
Exemplo n.º 16
0
 def startDelete(self, answer):
     if not answer or not answer[1]:
         self.close()
         return
     if answer[1] == 'no':
         return
     elif answer[1] == 'yes':
         self.removeTimer(True)
     elif answer[1] == 'yesremove':
         if isPluginInstalled("EnhancedMovieCenter"):
             if config.EMC.movie_trashcan_enable.value:
                 trashpath = config.EMC.movie_trashcan_path.value
                 self.MoveToTrash(trashpath)
         elif config.usage.movielist_trashcan.value:
             trashpath = resolveFilename(SCOPE_HDD) + '.Trash'
             self.MoveToTrash(trashpath)
         else:
             self.session.openWithCallback(
                 self.callbackRemoveRecording,
                 MessageBox,
                 _("Do you really want to delete the recording?"),
                 default=False)
Exemplo n.º 17
0
	def runTMBD(self):
		if isPluginInstalled("TMBD"):
			from Plugins.Extensions.TMBD.plugin import TMBD
			cur = self["list"].getCurrent()
			if cur[0] is not None:
				name2 = cur[0].getEventName() or ''
				name3 = name2.split("(")[0].strip()
				eventname = name3.replace('"', '').replace('Õ/Ô', '').replace('Ì/Ô', '').replace('Õ/ô', '').replace('.', '')
				eventname = eventname.replace('0+', '').replace('(0+)', '').replace('6+', '').replace('(6+)', '').replace('7+', '').replace('(7+)', '').replace('12+', '').replace('(12+)', '').replace('16+', '').replace('(16+)', '').replace('18+', '').replace('(18+)', '')
				try:
					tmbdsearch = config.plugins.tmbd.profile.value
				except:
					tmbdsearch = None
				if tmbdsearch is not None:
					if config.plugins.tmbd.profile.value == "0":
						self.session.open(TMBD, eventname, False)
					else:
						try:
							from Plugins.Extensions.TMBD.plugin import KinoRu
							self.session.open(KinoRu, eventname, False)
						except:
							pass
				else:
					self.session.open(TMBD, eventname, False)
Exemplo n.º 18
0
def getButtonSetupFunctions():
    ButtonSetupFunctions = []
    twinPlugins = []
    twinPaths = {}
    pluginlist = plugins.getPlugins(PluginDescriptor.WHERE_EVENTINFO)
    pluginlist.sort(key=lambda p: p.name)
    for plugin in pluginlist:
        if plugin.name not in twinPlugins and plugin.path and 'selectedevent' not in plugin.__call__.__code__.co_varnames:
            if plugin.path[plugin.path.rfind("Plugins"):] in twinPaths:
                twinPaths[plugin.path[plugin.path.rfind("Plugins"):]] += 1
            else:
                twinPaths[plugin.path[plugin.path.rfind("Plugins"):]] = 1
            ButtonSetupFunctions.append(
                (plugin.name,
                 plugin.path[plugin.path.rfind("Plugins"):] + "/" +
                 str(twinPaths[plugin.path[plugin.path.rfind("Plugins"):]]),
                 "EPG"))
            twinPlugins.append(plugin.name)
    pluginlist = plugins.getPlugins([
        PluginDescriptor.WHERE_PLUGINMENU,
        PluginDescriptor.WHERE_EXTENSIONSMENU, PluginDescriptor.WHERE_EVENTINFO
    ])
    pluginlist.sort(key=lambda p: p.name)
    for plugin in pluginlist:
        if plugin.name not in twinPlugins and plugin.path:
            if plugin.path[plugin.path.rfind("Plugins"):] in twinPaths:
                twinPaths[plugin.path[plugin.path.rfind("Plugins"):]] += 1
            else:
                twinPaths[plugin.path[plugin.path.rfind("Plugins"):]] = 1
            ButtonSetupFunctions.append(
                (plugin.name,
                 plugin.path[plugin.path.rfind("Plugins"):] + "/" +
                 str(twinPaths[plugin.path[plugin.path.rfind("Plugins"):]]),
                 "Plugins"))
            twinPlugins.append(plugin.name)
    ButtonSetupFunctions.append(
        (_("Show vertical Program Guide"), "Infobar/openVerticalEPG", "EPG"))
    ButtonSetupFunctions.append(
        (_("Show graphical multi EPG"), "Infobar/openGraphEPG", "EPG"))
    ButtonSetupFunctions.append(
        (_("Main Menu"), "Infobar/mainMenu", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Show help"), "Infobar/showHelp", "InfoBar"))
    ButtonSetupFunctions.append((_("Show extension selection"),
                                 "Infobar/showExtensionSelection", "InfoBar"))
    ButtonSetupFunctions.append((_("Zap down"), "Infobar/zapDown", "InfoBar"))
    ButtonSetupFunctions.append((_("Zap up"), "Infobar/zapUp", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Volume down"), "Infobar/volumeDown", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Volume up"), "Infobar/volumeUp", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Show Infobar"), "Infobar/toggleShow", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Show service list"), "Infobar/openServiceList", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Show favourites list"), "Infobar/openBouquets", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Show satellites list"), "Infobar/openSatellites", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("History back"), "Infobar/historyBack", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("History next"), "Infobar/historyNext", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Show eventinfo plugins"), "Infobar/showEventInfoPlugins", "EPG"))
    ButtonSetupFunctions.append(
        (_("Show event details"), "Infobar/openEventView", "EPG"))
    ButtonSetupFunctions.append(
        (_("Show single service EPG"), "Infobar/openSingleServiceEPG", "EPG"))
    ButtonSetupFunctions.append(
        (_("Show multi channel EPG"), "Infobar/openMultiServiceEPG", "EPG"))
    ButtonSetupFunctions.append(
        (_("Show Audioselection"), "Infobar/audioSelection", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Enable digital downmix"), "Infobar/audioDownmixOn", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Disable digital downmix"), "Infobar/audioDownmixOff", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Switch to radio mode"), "Infobar/showRadio", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Switch to TV mode"), "Infobar/showTv", "InfoBar"))
    ButtonSetupFunctions.append((_("Show servicelist or movies"),
                                 "Infobar/showServiceListOrMovies", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Show movies"), "Infobar/showMovies", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Instant record"), "Infobar/instantRecord", "InfoBar"))
    ButtonSetupFunctions.append((_("Start instant recording"),
                                 "Infobar/startInstantRecording", "InfoBar"))
    ButtonSetupFunctions.append((_("Activate timeshift End"),
                                 "Infobar/activateTimeshiftEnd", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Activate timeshift end and pause"),
         "Infobar/activateTimeshiftEndAndPause", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Start timeshift"), "Infobar/startTimeshift", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Stop timeshift"), "Infobar/stopTimeshift", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Start teletext"), "Infobar/startTeletext", "InfoBar"))
    ButtonSetupFunctions.append((_("Show subservice selection"),
                                 "Infobar/subserviceSelection", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Show subtitle selection"), "Infobar/subtitleSelection", "InfoBar"))
    ButtonSetupFunctions.append((_("Show subtitle quick menu"),
                                 "Infobar/subtitleQuickMenu", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Letterbox zoom"), "Infobar/vmodeSelection", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Seekbar"), "Infobar/seekFwdVod", "InfoBar"))
    if BoxInfo.getItem("PIPAvailable"):
        ButtonSetupFunctions.append(
            (_("Show PIP"), "Infobar/showPiP", "InfoBar"))
        ButtonSetupFunctions.append(
            (_("Swap PIP"), "Infobar/swapPiP", "InfoBar"))
        ButtonSetupFunctions.append(
            (_("Move PIP"), "Infobar/movePiP", "InfoBar"))
        ButtonSetupFunctions.append(
            (_("Toggle PIPzap"), "Infobar/togglePipzap", "InfoBar"))
        ButtonSetupFunctions.append(
            (_("Cycle PIP(zap)"), "Infobar/activePiP", "InfoBar"))
    ButtonSetupFunctions.append((_("Activate HbbTV (Redbutton)"),
                                 "Infobar/activateRedButton", "InfoBar"))
    if getHaveHDMIinHD() == 'True' or getHaveHDMIinFHD() == 'True':
        ButtonSetupFunctions.append(
            (_("Toggle HDMI-In full screen"), "Infobar/HDMIInFull", "InfoBar"))
        ButtonSetupFunctions.append(
            (_("Toggle HDMI-In PiP"), "Infobar/HDMIInPiP", "InfoBar"))
    if BoxInfo.getItem("LcdLiveTV"):
        ButtonSetupFunctions.append(
            (_("Toggle LCD LiveTV"), "Infobar/ToggleLCDLiveTV", "InfoBar"))
    if BoxInfo.getItem("canMultiBoot"):
        ButtonSetupFunctions.append(
            (_("Multiboot Image Selector"),
             "Module/Screens.MultiBootSelector/MultiBootSelector", "InfoBar"))
    ButtonSetupFunctions.append(
        (_("Hotkey Setup"), "Module/Screens.ButtonSetup/ButtonSetup", "Setup"))
    ButtonSetupFunctions.append(
        (_("Software Update"), "Module/Screens.SoftwareUpdate/SoftwareUpdate",
         "Setup"))
    if getHaveCI() == 'True':
        ButtonSetupFunctions.append((_("CI (Common Interface) Setup"),
                                     "Module/Screens.Ci/CiSelection", "Setup"))
    ButtonSetupFunctions.append(
        (_("Videosetup"), "Module/Screens.VideoMode/VideoSetup", "Setup"))
    ButtonSetupFunctions.append(
        (_("Tuner Configuration"), "Module/Screens.Satconfig/NimSelection",
         "Scanning"))
    ButtonSetupFunctions.append(
        (_("Manual Scan"), "Module/Screens.ScanSetup/ScanSetup", "Scanning"))
    ButtonSetupFunctions.append(
        (_("Automatic Scan"), "Module/Screens.ScanSetup/ScanSimple",
         "Scanning"))
    for plugin in plugins.getPluginsForMenu("scan"):
        ButtonSetupFunctions.append(
            (plugin[0], "MenuPlugin/scan/" + plugin[2], "Scanning"))
    ButtonSetupFunctions.append(
        (_("Network Settings"),
         "Module/Screens.NetworkSetup/NetworkAdapterSelection", "Setup"))
    ButtonSetupFunctions.append(
        (_("Network menu"), "Infobar/showNetworkMounts", "Setup"))
    ButtonSetupFunctions.append(
        (_("VPN"), "Module/Screens.NetworkSetup/NetworkOpenvpn", "Setup"))
    ButtonSetupFunctions.append(
        (_("Plugin Browser"), "Module/Screens.PluginBrowser/PluginBrowser",
         "Setup"))
    ButtonSetupFunctions.append(
        (_("Channel Info"), "Module/Screens.ServiceInfo/ServiceInfo", "Setup"))
    ButtonSetupFunctions.append(
        (_("SkinSelector"), "Module/Screens.SkinSelector/SkinSelector",
         "Setup"))
    if BoxInfo.getItem("LCDSKINSetup"):
        ButtonSetupFunctions.append(
            (_("LCD SkinSelector"),
             "Module/Screens.SkinSelector/LcdSkinSelector", "Setup"))
    ButtonSetupFunctions.append(
        (_("Timer"), "Module/Screens.TimerEdit/TimerEditList", "Setup"))
    ButtonSetupFunctions.append(
        (_("Open AutoTimer"), "Infobar/showAutoTimerList", "Setup"))
    for plugin in plugins.getPluginsForMenu("system"):
        if plugin[2]:
            ButtonSetupFunctions.append(
                (plugin[0], "MenuPlugin/system/" + plugin[2], "Setup"))
    ButtonSetupFunctions.append(
        (_("Standby"), "Module/Screens.Standby/Standby", "Power"))
    ButtonSetupFunctions.append(
        (_("Restart"), "Module/Screens.Standby/TryQuitMainloop/2", "Power"))
    ButtonSetupFunctions.append(
        (_("Restart enigma"), "Module/Screens.Standby/TryQuitMainloop/3",
         "Power"))
    ButtonSetupFunctions.append(
        (_("Deep standby"), "Module/Screens.Standby/TryQuitMainloop/1",
         "Power"))
    ButtonSetupFunctions.append(
        (_("SleepTimer"), "Module/Screens.SleepTimerEdit/SleepTimerEdit",
         "Power"))
    ButtonSetupFunctions.append(
        (_("PowerTimer"), "Module/Screens.PowerTimerEdit/PowerTimerEditList",
         "Power"))
    ButtonSetupFunctions.append((_("Usage Setup"), "Setup/Usage", "Setup"))
    ButtonSetupFunctions.append(
        (_("User interface settings"), "Setup/UserInterface", "Setup"))
    ButtonSetupFunctions.append(
        (_("Recording Setup"), "Setup/Recording", "Setup"))
    ButtonSetupFunctions.append(
        (_("Harddisk Setup"), "Setup/HardDisk", "Setup"))
    ButtonSetupFunctions.append(
        (_("Subtitles Settings"), "Setup/Subtitle", "Setup"))
    ButtonSetupFunctions.append(
        (_("Language"), "Module/Screens.LocaleSelection/LocaleSelection",
         "Setup"))
    ButtonSetupFunctions.append(
        (_("OscamInfo Mainmenu"), "Module/Screens.OScamInfo/OscamInfoMenu",
         "Plugins"))
    ButtonSetupFunctions.append(
        (_("CCcamInfo Mainmenu"), "Module/Screens.CCcamInfo/CCcamInfoMain",
         "Plugins"))
    ButtonSetupFunctions.append(
        (_("Movieplayer"), "Infobar/showMoviePlayer", "Plugins"))
    if os.path.isdir("/etc/ppanels"):
        for x in [x for x in os.listdir("/etc/ppanels") if x.endswith(".xml")]:
            x = x[:-4]
            ButtonSetupFunctions.append(
                (_("PPanel") + " " + x, "PPanel/" + x, "PPanels"))
    if os.path.isdir("/usr/script"):
        for x in [x for x in os.listdir("/usr/script") if x.endswith(".sh")]:
            x = x[:-3]
            ButtonSetupFunctions.append((_("Shellscript") + " " + x,
                                         "Shellscript/" + x, "Shellscripts"))
    ButtonSetupFunctions.append(
        (_("ScriptRunner"), "Module/Screens.ScriptRunner/ScriptRunner",
         "Plugins"))
    ButtonSetupFunctions.append(
        (_("QuickMenu"), "Module/Screens.QuickMenu/QuickMenu", "Plugins"))
    if isPluginInstalled("Kodi"):
        ButtonSetupFunctions.append(
            (_("Kodi MediaCenter"), "Kodi/", "Plugins"))
    if isPluginInstalled("BluetoothSetup"):
        ButtonSetupFunctions.append(
            (_("Bluetooth Setup"), "Bluetooth/", "Plugins"))
    if isPluginInstalled("Chromium"):
        ButtonSetupFunctions.append((_("Youtube TV"), "YoutubeTV/", "Plugins"))
    return ButtonSetupFunctions
Exemplo n.º 19
0
# This hack overwrites the functions seekFwdManual and seekBackManual of the InfoBarSeek class (MoviePlayer, DVDPlayer, VideoDB)


def seekbar(instance, fwd=True):
    if instance and instance.session:
        instance.session.open(Seekbar, instance, fwd)


def seekbarBack(instance):
    seekbar(instance, False)


MoviePlayer.seekFwdManual = seekbar
MoviePlayer.seekBackManual = seekbarBack

if isPluginInstalled("DVDPlayer"):
    from Plugins.Extensions.DVDPlayer.plugin import DVDPlayer
    DVDPlayer.seekFwdManual = seekbar
    DVDPlayer.seekBackManual = seekbarBack
else:
    DVDPlayer = None

if isPluginInstalled("VideoDB"):
    from Plugins.Extensions.VideoDB.Player import VideoDBPlayer
    VideoDBPlayer.seekFwdManual = seekbar
    VideoDBPlayer.seekBackManual = seekbarBack

##############################################
# This hack puts the functions seekFwdManual and seekBackManual to the maped keys to seekbarRight and seekbarLeft

DoBind = ActionMap.doBind
Exemplo n.º 20
0
    def populate(self):
        self["lab1"] = StaticText(_("Virtuosso Image Xtreme"))
        self["lab2"] = StaticText(_("By Team ViX"))
        model = None
        AboutText = ""
        self["lab3"] = StaticText(
            _("Support at") + " www.world-of-satellite.com")

        AboutText += _("Model:\t%s %s\n") % (getMachineBrand(),
                                             getMachineName())

        if about.getChipSetString() != _("unavailable"):
            if SystemInfo["HasHiSi"]:
                AboutText += _("Chipset:\tHiSilicon %s\n"
                               ) % about.getChipSetString().upper()
            elif about.getIsBroadcom():
                AboutText += _("Chipset:\tBroadcom %s\n"
                               ) % about.getChipSetString().upper()
            else:
                AboutText += _(
                    "Chipset:\t%s\n") % about.getChipSetString().upper()

        AboutText += _("CPU:\t%s %s %s\n") % (about.getCPUArch(),
                                              about.getCPUSpeedString(),
                                              about.getCpuCoresString())

        if SystemInfo["BoxInfo"]:
            BoxInfo = SystemInfo["BoxInfo"]
            AboutText += _("SoC:\t%s\n") % BoxInfo.getItem("socfamily").upper()

        tempinfo = ""
        if path.exists("/proc/stb/sensors/temp0/value"):
            with open("/proc/stb/sensors/temp0/value", "r") as f:
                tempinfo = f.read()
        elif path.exists("/proc/stb/fp/temp_sensor"):
            with open("/proc/stb/fp/temp_sensor", "r") as f:
                tempinfo = f.read()
        elif path.exists("/proc/stb/sensors/temp/value"):
            with open("/proc/stb/sensors/temp/value", "r") as f:
                tempinfo = f.read()
        if tempinfo and int(tempinfo.replace("\n", "")) > 0:
            AboutText += _("System temp:\t%s") % tempinfo.replace(
                "\n", "").replace(" ", "") + "\xb0" + "C\n"

        tempinfo = ""
        if path.exists("/proc/stb/fp/temp_sensor_avs"):
            with open("/proc/stb/fp/temp_sensor_avs", "r") as f:
                tempinfo = f.read()
        elif path.exists("/sys/devices/virtual/thermal/thermal_zone0/temp"):
            try:
                with open("/sys/devices/virtual/thermal/thermal_zone0/temp",
                          "r") as f:
                    tempinfo = f.read()
                    tempinfo = tempinfo[:-4]
            except:
                tempinfo = ""
        elif path.exists("/proc/hisi/msp/pm_cpu"):
            try:
                tempinfo = search(
                    "temperature = (\d+) degree",
                    open("/proc/hisi/msp/pm_cpu").read()).group(1)
            except:
                tempinfo = ""
        if tempinfo and int(tempinfo) > 0:
            AboutText += _("Processor temp:\t%s") % tempinfo.replace(
                "\n", "").replace(" ", "") + "\xb0" + "C\n"

        imageSubBuild = ""
        if getImageType() != "release":
            imageSubBuild = ".%s" % getImageDevBuild()
        AboutText += _("Image:\t%s.%s%s (%s)\n") % (getImageVersion(
        ), getImageBuild(), imageSubBuild, getImageType().title())

        if SystemInfo["BoxInfo"]:
            BoxInfo = SystemInfo["BoxInfo"]
            if BoxInfo.getItem(
                    "mtdbootfs") != "" and " " not in BoxInfo.getItem(
                        "mtdbootfs"):
                AboutText += _("Boot Device:\t%s\n") % BoxInfo.getItem(
                    "mtdbootfs")
        if SystemInfo["HasH9SD"]:
            if "rootfstype=ext4" in open(
                    "/sys/firmware/devicetree/base/chosen/bootargs",
                    "r").read():
                part = "        - SD card in use for Image root \n"
            else:
                part = "        - eMMC slot in use for Image root \n"
            AboutText += _("%s") % part

        if SystemInfo["canMultiBoot"]:
            slot = image = SystemInfo["MultiBootSlot"]
            part = "eMMC slot %s" % slot
            bootmode = ""
            if SystemInfo["canMode12"]:
                bootmode = "bootmode = %s" % GetCurrentImageMode()
            print("[About] HasHiSi = %s, slot = %s" %
                  (SystemInfo["HasHiSi"], slot))
            if SystemInfo["HasHiSi"] and "sda" in SystemInfo["canMultiBoot"][
                    slot]["root"]:
                if slot > 4:
                    image -= 4
                else:
                    image -= 1
                part = "SDcard slot %s (%s) " % (
                    image, SystemInfo["canMultiBoot"][slot]["root"])
            AboutText += _("Image Slot:\t%s") % "Startup " + str(
                slot) + " - " + part + " " + bootmode + "\n"

        if getMachineName() in ("ET8500") and path.exists("/proc/mtd"):
            self.dualboot = self.dualBoot()
            if self.dualboot:
                AboutText += _("ET8500 Multiboot: Installed\n")

        skinWidth = getDesktop(0).size().width()
        skinHeight = getDesktop(0).size().height()

        string = getDriverDate()
        year = string[0:4]
        month = string[4:6]
        day = string[6:8]
        driversdate = "-".join((day, month, year))

        AboutText += _("Drivers:\t%s\n") % driversdate
        AboutText += _("Kernel:\t%s\n") % about.getKernelVersionString()
        AboutText += _("GStreamer:\t%s\n") % about.getGStreamerVersionString(
        ).replace("GStreamer ", "")
        if isPluginInstalled(
                "ServiceApp"
        ) and config.plugins.serviceapp.servicemp3.replace.value == True:
            AboutText += _(
                "4097 iptv player:\t%s\n"
            ) % config.plugins.serviceapp.servicemp3.player.value
        else:
            AboutText += _("4097 iptv player:\tDefault player\n")
        AboutText += _("Python:\t%s\n") % about.getPythonVersionString()
        flashDate = about.getFlashDateString()[8:] + about.getFlashDateString(
        )[4:8] + about.getFlashDateString()[0:4]
        AboutText += _("Installed:\t%s\n") % flashDate
        lastUpdate = getEnigmaVersionString()[8:] + getEnigmaVersionString(
        )[4:8] + getEnigmaVersionString()[0:4]
        AboutText += _("Last update:\t%s\n") % lastUpdate
        AboutText += _("E2 (re)starts:\t%s\n") % config.misc.startCounter.value
        uptime = about.getBoxUptime()
        if uptime:
            AboutText += _("Uptime:\t%s\n") % uptime
        e2uptime = about.getEnigmaUptime()
        if e2uptime:
            AboutText += _("Enigma2 uptime:\t%s\n") % e2uptime
        AboutText += _("Skin:\t%s") % config.skin.primary_skin.value[0:-9] + _(
            "  (%s x %s)") % (skinWidth, skinHeight) + "\n"

        fp_version = getFPVersion()
        if fp_version is None:
            fp_version = ""
        elif fp_version != 0:
            fp_version = _("FP version:\t%s") % fp_version
            AboutText += fp_version + "\n"

        bootloader = ""
        if path.exists('/sys/firmware/devicetree/base/bolt/tag'):
            f = open('/sys/firmware/devicetree/base/bolt/tag', 'r')
            bootloader = f.readline().replace('\x00', '').replace('\n', '')
            f.close()
            AboutText += _("Bootloader:\t%s\n") % (bootloader)

        self["AboutScrollLabel"] = ScrollLabel(AboutText)
Exemplo n.º 21
0
 def ipkgCallback(self, event, param):
     if event == IpkgComponent.EVENT_DOWNLOAD:
         self.status.setText(_("Downloading"))
     elif event == IpkgComponent.EVENT_UPGRADE:
         if param in self.sliderPackages:
             self.slider.setValue(self.sliderPackages[param])
         self.package.setText(param)
         self.status.setText(
             _("Upgrading") + ": %s/%s" %
             (self.packages, self.total_packages))
         if not param in self.processed_packages:
             self.processed_packages.append(param)
             self.packages += 1
     elif event == IpkgComponent.EVENT_INSTALL:
         self.package.setText(param)
         self.status.setText(_("Installing"))
         if not param in self.processed_packages:
             self.processed_packages.append(param)
             self.packages += 1
     elif event == IpkgComponent.EVENT_REMOVE:
         self.package.setText(param)
         self.status.setText(_("Removing"))
         if not param in self.processed_packages:
             self.processed_packages.append(param)
             self.packages += 1
     elif event == IpkgComponent.EVENT_CONFIGURING:
         self.package.setText(param)
         self.status.setText(_("Configuring"))
     elif event == IpkgComponent.EVENT_MODIFIED:
         if config.plugins.softwaremanager.overwriteConfigFiles.value in (
                 "N", "Y"):
             self.ipkg.write(
                 True and
                 config.plugins.softwaremanager.overwriteConfigFiles.value)
         else:
             self["actions"].setEnabled(True)
             self.session.openWithCallback(
                 self.modificationCallback, MessageBox,
                 _("A configuration file (%s) has been modified since it was installed.\nDo you want to keep your modifications?"
                   ) % param)
     elif event == IpkgComponent.EVENT_ERROR:
         self.error += 1
         self.updating = False
     elif event == IpkgComponent.EVENT_DONE:
         if self.updating:
             self.updating = False
             self.ipkg.startCmd(IpkgComponent.CMD_UPGRADE_LIST)
         elif self.ipkg.currentCommand == IpkgComponent.CMD_UPGRADE_LIST:
             self.total_packages = None
             if getImageType() != 'release' or (
                     config.softwareupdate.updateisunstable.value == '1'
                     and config.softwareupdate.updatebeta.value):
                 self.total_packages = len(self.ipkg.getFetchedList())
                 message = _(
                     "The current update may be unstable") + "\n" + _(
                         "Are you sure you want to update your %s %s ?"
                     ) % (getMachineBrand(), getMachineName()) + "\n(" + (
                         ngettext("%s updated package available",
                                  "%s updated packages available",
                                  self.total_packages) %
                         self.total_packages) + ")"
             elif config.softwareupdate.updateisunstable.value == '0':
                 self.total_packages = len(self.ipkg.getFetchedList())
                 message = _("Do you want to update your %s %s ?") % (
                     getMachineBrand(), getMachineName()) + "\n(" + (
                         ngettext("%s updated package available",
                                  "%s updated packages available",
                                  self.total_packages) %
                         self.total_packages) + ")"
             if self.total_packages > 150:
                 message += " " + _("Reflash recommended!")
             if self.total_packages:
                 global ocram
                 ocram = ''
                 for package_tmp in self.ipkg.getFetchedList():
                     if package_tmp[0].startswith(
                             'enigma2-plugin-picons-snp'):
                         ocram = ocram + '[ocram-picons] ' + package_tmp[
                             0].split(
                                 'enigma2-plugin-picons-snp-')[1].replace(
                                     '.', ' '
                                 ) + ' updated ' + package_tmp[2].replace(
                                     '--', ' ') + '\n'
                     elif package_tmp[0].startswith(
                             'enigma2-plugin-picons-srp'):
                         ocram = ocram + '[ocram-picons] ' + package_tmp[
                             0].split(
                                 'enigma2-plugin-picons-srp-')[1].replace(
                                     '.', ' '
                                 ) + ' updated ' + package_tmp[2].replace(
                                     '--', ' ') + '\n'
                 config.softwareupdate.updatefound.setValue(True)
                 choices = [(_("View the changes"), "changes"),
                            (_("Upgrade and reboot system"), "cold")]
                 if isPluginInstalled("ViX"):
                     if not config.softwareupdate.autosettingsbackup.value and config.backupmanager.backuplocation.value:
                         choices.append(
                             (_("Perform a settings backup,") + '\n\t' +
                              _("making a backup before updating") +
                              '\n\t' + _("is strongly advised."), "backup"))
                     if not config.softwareupdate.autoimagebackup.value and config.imagemanager.backuplocation.value:
                         choices.append((_("Perform a full image backup"),
                                         "imagebackup"))
                 choices.append((_("Update channel list only"), "channels"))
                 choices.append((_("Cancel"), ""))
                 self["actions"].setEnabled(True)
                 upgrademessage = self.session.openWithCallback(
                     self.startActualUpgrade,
                     UpdateChoices,
                     text=message,
                     list=choices,
                     skin_name="SoftwareUpdateChoices",
                     var=self.trafficLight)
                 upgrademessage.setTitle(self.getTitle())
             else:
                 message = _(
                     "No updates found, Press OK to exit this screen.")
                 choices = [(_("Nothing to upgrade"), "")]
                 self["actions"].setEnabled(True)
                 upgrademessage = self.session.openWithCallback(
                     self.startActualUpgrade,
                     UpdateChoices,
                     text=message,
                     list=choices,
                     skin_name="SoftwareUpdateChoices",
                     var=self.trafficLight)
                 upgrademessage.setTitle(self.getTitle())
         elif self.channellist_only > 0:
             if self.channellist_only == 1:
                 self.setEndMessage(
                     _("Could not find installed channel list."))
             elif self.channellist_only == 2:
                 self.slider.setValue(2)
                 self.ipkg.startCmd(IpkgComponent.CMD_REMOVE,
                                    {'package': self.channellist_name})
                 self.channellist_only += 1
             elif self.channellist_only == 3:
                 self.slider.setValue(3)
                 self.ipkg.startCmd(IpkgComponent.CMD_INSTALL,
                                    {'package': self.channellist_name})
                 self.channellist_only += 1
             elif self.channellist_only == 4:
                 self.showUpdateCompletedMessage()
                 eDVBDB.getInstance().reloadBouquets()
                 eDVBDB.getInstance().reloadServicelist()
         elif self.error == 0:
             self.showUpdateCompletedMessage()
         else:
             self.activityTimer.stop()
             self.activityslider.setValue(0)
             error = _(
                 "Your %s %s might be unusable now. Please consult the manual for further assistance before rebooting your %s %s."
             ) % (getMachineBrand(), getMachineName(), getMachineBrand(),
                  getMachineName())
             if self.packages == 0:
                 if self.error != 0:
                     error = _(
                         "Problem retrieving update list.\nIf this issue persists please check/report on forum"
                     )
                 else:
                     error = _(
                         "A background update check is in progress,\nplease wait a few minutes and try again."
                     )
             if self.updating:
                 error = _(
                     "Update failed. Your %s %s does not have a working internet connection."
                 ) % (getMachineBrand(), getMachineName())
             self.status.setText(_("Error") + " - " + error)
             self["actions"].setEnabled(True)
     elif event == IpkgComponent.EVENT_LISTITEM:
         if 'enigma2-plugin-settings-' in param[
                 0] and self.channellist_only > 0:
             self.channellist_name = param[0]
             self.channellist_only = 2
     #print event, "-", param
     pass
Exemplo n.º 22
0
    def getText(self):
        service = self.source.service
        if self.type == self.AUDIO or self.type == self.AUDIO_CODEC or self.type == self.AUDIO_LANG:
            audio = service and service.audioTracks()
            if audio:
                try:
                    selectedAudio = audio.getCurrentTrack()
                    i = audio.getTrackInfo(selectedAudio)
                    languages = i.getLanguage().split('/')
                    description = i.getDescription().replace(" audio",
                                                             "") or ""
                    cnt = 0
                    language = ''
                    for lang in languages:
                        if cnt:
                            language += ' / '
                        if lang in LanguageCodes:
                            language += _(LanguageCodes[lang][0])
                        else:
                            language += lang
                        cnt += 1
                    if language == '':
                        language = _("Unknown")
                    if self.type == self.AUDIO:
                        return description + ' | ' + language
                    elif self.type == self.AUDIO_CODEC:
                        return description
                    else:
                        return language
                except:
                    pass
            return ""
        elif self.type == self.SUBTITLE or self.type == self.SUBTITLE_TYPE or self.type == self.SUBTITLE_LANG:
            subtitle = service and service.subtitle()
            selectedSubtitle = None
            enabled = False
            import Screens.InfoBar
            ######## MoviePlayer
            movieplayer = Screens.InfoBar.MoviePlayer.instance
            if movieplayer:
                selectedSubtitle = movieplayer.selected_subtitle
                enabled = movieplayer.subtitle_window.shown
            else:
                selectedSubtitle = None
                enabled = False
            ######## Infobar
            if not selectedSubtitle:
                InfoBar = Screens.InfoBar.InfoBar.instance
                if InfoBar:
                    selectedSubtitle = InfoBar.selected_subtitle
                    enabled = InfoBar.subtitle_window.shown
                else:
                    selectedSubtitle = None
                    enabled = False
            ######### for kodi & subssupport
            if not selectedSubtitle:
                try:
                    from Plugins.Extensions.Kodi.plugin import KodiVideoPlayer
                    kodi = KodiVideoPlayer.instance
                except:
                    kodi = None
                if kodi and isPluginInstalled("SubsSupport"):
                    if kodi.embeddedEnabled:
                        selectedSubtitle = kodi.selected_subtitle
                        enabled = kodi.subtitle_window.shown
                    else:
                        selectedSubtitle = kodi.getSubsPath()
                        if selectedSubtitle:
                            if self.type == self.SUBTITLE:
                                return _("External") + " | " + selectedSubtitle
                            elif self.type == self.SUBTITLE_TYPE:
                                return _("External")
                            else:
                                return selectedSubtitle
            ##############################
            if selectedSubtitle and enabled:
                subtitlelist = subtitle and subtitle.getSubtitleList()
                for x in subtitlelist:

                    if x[:4] == selectedSubtitle[:4]:
                        language = _("Unknown")
                        try:
                            if x[4] != "und":
                                if x[4] in LanguageCodes:
                                    language = _(LanguageCodes[x[4]][0])
                                else:
                                    language = x[4]
                        except:
                            pass

                        if selectedSubtitle[0] == 0:
                            description = "DVB"

                        elif selectedSubtitle[0] == 1:
                            description = _("teletext")

                        elif selectedSubtitle[0] == 2:
                            types = (_("unknown"), _("embedded"),
                                     _("SSA file"), _("ASS file"),
                                     _("SRT file"), _("VOB file"),
                                     _("PGS file"))
                            try:
                                description = types[x[2]]
                            except:
                                description = _("unknown") + ": %s" % x[2]
                        if self.type == self.SUBTITLE:
                            return description + ' | ' + language
                        elif self.type == self.SUBTITLE_TYPE:
                            return description
                        else:
                            return language
            return _("None")
Exemplo n.º 23
0
 def __init__(self):
     self.BludiscPlayer = isPluginInstalled("BludiscPlayer")
     self.DVDPlayer = isPluginInstalled("DVDPlayer")
     self.TMDb = isPluginInstalled("TMDb")
     self.IMDb = isPluginInstalled("IMDb")
     self.OFDb = isPluginInstalled("OFDb")
     self.TheTVDB = isPluginInstalled("TheTVDB")
     self.AdvancedProgramGuide = isPluginInstalled("AdvancedProgramGuide")
     self.MerlinEPG = isPluginInstalled("MerlinEPG")
     self.MerlinEPGCenter = isPluginInstalled("MerlinEPGCenter")
     self.CoolTVGuide = isPluginInstalled("CoolTVGuide")
     self.YTTrailer = isPluginInstalled("YTTrailer")
     self.pipzap = isPluginInstalled("pipzap")
Exemplo n.º 24
0
SystemInfo["LEDButtons"] = False # getBoxType() == "vuultimo", For some reason this causes a cpp crash on vuultimo (which we no longer build). The cause needs investigating or the dead code in surrounding modules that this change causes should be removed.
SystemInfo["DeepstandbySupport"] = HardwareInfo().has_deepstandby()
SystemInfo["Fan"] = fileCheck("/proc/stb/fp/fan")
SystemInfo["FanPWM"] = SystemInfo["Fan"] and fileCheck("/proc/stb/fp/fan_pwm")
SystemInfo["PowerLED"] = fileExists("/proc/stb/power/powerled")
SystemInfo["PowerLED2"] = fileExists("/proc/stb/power/powerled2")
SystemInfo["StandbyLED"] = fileExists("/proc/stb/power/standbyled")
SystemInfo["SuspendLED"] = fileExists("/proc/stb/power/suspendled")
SystemInfo["LedPowerColor"] = fileExists("/proc/stb/fp/ledpowercolor")
SystemInfo["LedStandbyColor"] = fileExists("/proc/stb/fp/ledstandbycolor")
SystemInfo["LedSuspendColor"] = fileExists("/proc/stb/fp/ledsuspendledcolor")
SystemInfo["Power24x7On"] = fileExists("/proc/stb/fp/power4x7on")
SystemInfo["Power24x7Standby"] = fileExists("/proc/stb/fp/power4x7standby")
SystemInfo["Power24x7Suspend"] = fileExists("/proc/stb/fp/power4x7suspend")
SystemInfo["WakeOnLAN"] = getBoxType() not in ("et8000", "et10000") and fileCheck("/proc/stb/power/wol") or fileCheck("/proc/stb/fp/wol")
SystemInfo["HDMICEC"] = (fileExists("/dev/hdmi_cec") or fileExists("/dev/misc/hdmi_cec0")) and isPluginInstalled("HdmiCEC")
SystemInfo["HasHDMI-CEC"] = isPluginInstalled("HdmiCEC")
SystemInfo["HasExternalPIP"] = getMachineBuild() not in ("et9x00", "et6x00", "et5x00") and fileCheck("/proc/stb/vmpeg/1/external")
SystemInfo["VideoDestinationConfigurable"] = fileExists("/proc/stb/vmpeg/0/dst_left")
SystemInfo["hasPIPVisibleProc"] = fileCheck("/proc/stb/vmpeg/1/visible")
SystemInfo["VFD_scroll_repeats"] = not SystemInfo["7segment"] and getBoxType() not in ("et8500",) and fileCheck("/proc/stb/lcd/scroll_repeats")
SystemInfo["VFD_scroll_delay"] = not SystemInfo["7segment"] and getBoxType() not in ("et8500",) and fileCheck("/proc/stb/lcd/scroll_delay")
SystemInfo["VFD_initial_scroll_delay"] = not SystemInfo["7segment"] and getBoxType() not in ("et8500",) and fileCheck("/proc/stb/lcd/initial_scroll_delay")
SystemInfo["VFD_final_scroll_delay"] = not SystemInfo["7segment"] and getBoxType() not in ("et8500",) and fileCheck("/proc/stb/lcd/final_scroll_delay")
SystemInfo["LcdLiveTV"] = fileCheck("/proc/stb/fb/sd_detach") or fileCheck("/proc/stb/lcd/live_enable")
SystemInfo["LCDMiniTV"] = fileExists("/proc/stb/lcd/mode")
SystemInfo["LCDMiniTVPiP"] = SystemInfo["LCDMiniTV"] and getBoxType() != "gb800ueplus"
SystemInfo["LcdPowerOn"] = fileExists("/proc/stb/power/vfd")
SystemInfo["FastChannelChange"] = False
SystemInfo["3DMode"] = fileCheck("/proc/stb/fb/3dmode") or fileCheck("/proc/stb/fb/primary/3d")
SystemInfo["3DZNorm"] = fileCheck("/proc/stb/fb/znorm") or fileCheck("/proc/stb/fb/primary/zoffset")
Exemplo n.º 25
0
def autostart(reason, *args, **kwargs):
    if reason == 0:
        if hasattr(PluginComponent, 'pluginSort_baseAddPlugin'):
            print(
                "[PluginSort] Something went wrong as our autostart handler was called multiple times for startup, printing traceback and ignoring."
            )
            import traceback
            import sys
            traceback.print_stack(limit=5, file=sys.stdout)
        else:
            PluginComponent.pluginSort_baseAddPlugin = PluginComponent.addPlugin
            PluginComponent.addPlugin = PluginComponent_addPlugin

            # we use a copy for installed plugins because we might change the 'where'-lists
            plugins.installedPluginList = plugins.pluginList[:]

            def PluginComponent__setattr__(self, key, value):
                if key == 'installedPluginList':
                    return
                else:
                    self.__dict__[key] = value

            PluginComponent.__setattr__ = PluginComponent__setattr__

            if hasattr(plugins, 'pluginHider_baseGetPlugins'):
                pluginlist = plugins.pluginHider_baseGetPlugins([
                    PluginDescriptor.WHERE_PLUGINMENU,
                    PluginDescriptor.WHERE_EXTENSIONSMENU,
                    PluginDescriptor.WHERE_MOVIELIST,
                    PluginDescriptor.WHERE_EVENTINFO
                ])
            else:
                pluginlist = plugins.getPlugins([
                    PluginDescriptor.WHERE_PLUGINMENU,
                    PluginDescriptor.WHERE_EXTENSIONSMENU,
                    PluginDescriptor.WHERE_MOVIELIST,
                    PluginDescriptor.WHERE_EVENTINFO
                ])

            # "fix" weight of plugins already added to list, future ones will be fixed automatically
            fixed = []
            for plugin in pluginlist:
                if plugin in fixed:
                    continue  # skip double entries

                # create individual entries for multiple wheres, this is potentially harmful!
                if len(plugin.where) > 1:
                    # remove all entries except for a potential autostart one (highly unlikely to mix autostart with one of the above, but you never know :D)
                    if PluginDescriptor.WHERE_AUTOSTART in plugin.where:
                        plugin.where.remove(PluginDescriptor.WHERE_AUTOSTART)
                        hadAutostart = True
                    else:
                        hadAutostart = False
                    plugins.removePlugin(plugin)
                    plugins.addPlugin(
                        plugin
                    )  # this is our own addPlugin now, which automatically creates copies

                    # HACK: re-add autostart entry to internal list inside PluginComponent
                    if hadAutostart:
                        plugin.where = [PluginDescriptor.WHERE_AUTOSTART]
                        plugins.pluginList.append(plugin)

                # we're keeping the entry, just fix the weight
                else:
                    newWeight = pluginWeights.get(plugin)
                    print(
                        "[PluginSort] Fixing weight for %s (was %d, now %d)" %
                        (plugin.name, plugin.weight, newWeight))
                    plugin.weight = newWeight

                fixed.append(plugin)

            # let movieepg fix extensions list sorting if installed, else do this ourselves
            if not isPluginInstalled("MovieEPG"):

                def InfoBarPlugins_getPluginList(self, *args, **kwargs):
                    l = InfoBarPlugins.pluginSort_baseGetPluginList(
                        self, *args, **kwargs)
                    try:
                        l.sort(key=lambda e: (e[0][1].args[0].weight, e[2]))
                    except Exception as e:
                        print("[PluginSort] Failed to sort extensions", e)
                    return l

                InfoBarPlugins.pluginSort_baseGetPluginList = InfoBarPlugins.getPluginList
                InfoBarPlugins.getPluginList = InfoBarPlugins_getPluginList

            PluginBrowser.PluginBrowser = SortingPluginBrowser
    else:
        if hasattr(PluginComponent, 'pluginSort_baseAddPlugin'):
            PluginComponent.addPlugin = PluginComponent.pluginSort_baseAddPlugin
            del PluginComponent.pluginSort_baseAddPlugin
        if hasattr(InfoBarPlugins, 'pluginSort_baseGetPluginList'):
            InfoBarPlugins.getPluginList = InfoBarPlugins.pluginSort_baseGetPluginList
            del InfoBarPlugins.pluginSort_baseGetPluginList
        PluginBrowser.PluginBrowser = OriginalPluginBrowser
Exemplo n.º 26
0
from Screens.PluginBrowser import PluginDownloadBrowser, PluginFilter, PluginBrowser
from Screens.RestartNetwork import RestartNetwork
from Screens.Satconfig import NimSelection
from Screens.ScanSetup import ScanSimple, ScanSetup
from Screens.Screen import Screen
from Screens.ShowSoftcamPackages import ShowSoftcamPackages
from Screens.Setup import Setup
from Screens.SkinSelector import LcdSkinSelector, SkinSelector
from Screens.SoftcamSetup import SoftcamSetup
from Screens.VideoMode import VideoSetup

from Tools.LoadPixmap import LoadPixmap
from Tools.Directories import isPluginInstalled


NETWORKBROWSER = isPluginInstalled("NetworkBrowser")

AUDIOSYNC = isPluginInstalled("AudioSync")

VIDEOENH = isPluginInstalled("VideoEnhancement") and exists("/proc/stb/vmpeg/0/pep_apply")

DFLASH = isPluginInstalled("dFlash")

DBACKUP = isPluginInstalled("dBackup")

POSSETUP = isPluginInstalled("PositionerSetup")

SATFINDER = isPluginInstalled("Satfinder")

def isFileSystemSupported(filesystem):
	try:
Exemplo n.º 27
0
def _isPluginInstalled(p, plugin="plugin"):
    return isPluginInstalled(p, plugin)
Exemplo n.º 28
0
    def __init__(self, session):
        self.session = session
        Screen.__init__(self, session)

        self["key_red"] = StaticText(_("Cansel"))
        self["key_green"] = StaticText(_("OK"))
        self["key_yellow"] = StaticText("")
        self["key_blue"] = StaticText("")

        list = []
        list.append(
            getConfigListEntry(_("Primary Prime Time:"),
                               config.plugins.PrimeTimeManager.Time1))
        list.append(
            getConfigListEntry(_("Secondary Prime Time:"),
                               config.plugins.PrimeTimeManager.Time2))
        list.append(
            getConfigListEntry(
                _("Show duration or end time:"),
                config.plugins.PrimeTimeManager.DurationOrEndTime))
        list.append(
            getConfigListEntry(_("Remove favorite on timer deletion:"),
                               config.plugins.PrimeTimeManager.RemoveFavorite))
        list.append(
            getConfigListEntry(_("\"View live\" type:"),
                               config.plugins.PrimeTimeManager.ViewLiveType))
        list.append(
            getConfigListEntry(_("\"View live\" event only in Prime Time:"),
                               config.plugins.PrimeTimeManager.ViewLive))
        list.append(
            getConfigListEntry(
                _("Check conflicts timers after \"Accept\":"),
                config.plugins.PrimeTimeManager.CheckConflictOnAccept))
        list.append(
            getConfigListEntry(
                _("Check conflicts timers after exit:"),
                config.plugins.PrimeTimeManager.CheckConflictOnExit))
        list.append(
            getConfigListEntry(_("Prime Time Manager in E-menu:"),
                               config.plugins.PrimeTimeManager.ExtMenu))
        list.append(
            getConfigListEntry(_("Red Button function:"),
                               config.plugins.PrimeTimeManager.RedButton))
        list.append(
            getConfigListEntry(_("Exit from Multi EPG on selected service:"),
                               config.plugins.PrimeTimeManager.CloseMultiEPG))
        list.append(
            getConfigListEntry(
                _("'Timer Edit' key menu - show conflict timer:"),
                config.plugins.PrimeTimeManager.TimerEditKeyMenu))
        if isPluginInstalled("AutoTimer"):
            list.append(
                getConfigListEntry(
                    _("Use AutoTimer plugin instead remove favorites:"),
                    config.plugins.PrimeTimeManager.UseAutotimer))

        ConfigListScreen.__init__(self, list)

        self["actions"] = ActionMap(["SetupActions", "ColorActions"], {
            "red": self.exit,
            "green": self.save,
            "cancel": self.exit
        }, -1)

        self.setTitle(_("Prime Time Settings") + ": " + plugin_version)
Exemplo n.º 29
0
SystemInfo["Fan"] = fileCheck("/proc/stb/fp/fan")
SystemInfo["FanPWM"] = SystemInfo["Fan"] and fileCheck("/proc/stb/fp/fan_pwm")
SystemInfo["PowerLed"] = fileExists("/proc/stb/power/powerled")
SystemInfo["PowerLed2"] = fileExists("/proc/stb/power/powerled2")
SystemInfo["StandbyPowerLed"] = fileExists("/proc/stb/power/standbyled")
SystemInfo["SuspendPowerLed"] = fileExists("/proc/stb/power/suspendled")
SystemInfo["LedPowerColor"] = fileExists("/proc/stb/fp/ledpowercolor")
SystemInfo["LedStandbyColor"] = fileExists("/proc/stb/fp/ledstandbycolor")
SystemInfo["LedSuspendColor"] = fileExists("/proc/stb/fp/ledsuspendledcolor")
SystemInfo["Power4x7On"] = fileExists("/proc/stb/fp/power4x7on")
SystemInfo["Power4x7Standby"] = fileExists("/proc/stb/fp/power4x7standby")
SystemInfo["Power4x7Suspend"] = fileExists("/proc/stb/fp/power4x7suspend")
SystemInfo["LEDButtons"] = model == "vuultimo"
SystemInfo["WakeOnLAN"] = fileCheck("/proc/stb/power/wol") or fileCheck("/proc/stb/fp/wol")
SystemInfo["HDMICEC"] = fileExists("/dev/hdmi_cec") or fileExists("/dev/misc/hdmi_cec0")
SystemInfo["SABSetup"] = isPluginInstalled("SABnzbd")
SystemInfo["SeekStatePlay"] = False
SystemInfo["StatePlayPause"] = False
SystemInfo["StandbyState"] = False
SystemInfo["GraphicLCD"] = model in ("vuultimo", "xpeedlx3", "et10000", "mutant2400", "quadbox2400", "sezammarvel", "atemionemesis", "mbultra", "beyonwizt4", "osmio4kplus")
SystemInfo["Blindscan"] = isPluginInstalled("Blindscan")
SystemInfo["Satfinder"] = isPluginInstalled("Satfinder")
SystemInfo["HasExternalPIP"] = getMachineBuild() not in ("et9x00", "et6x00", "et5x00") and fileCheck("/proc/stb/vmpeg/1/external")
SystemInfo["hasPIPVisibleProc"] = fileCheck("/proc/stb/vmpeg/1/visible")
SystemInfo["VideoDestinationConfigurable"] = fileExists("/proc/stb/vmpeg/0/dst_left")
SystemInfo["GBWOL"] = fileExists("/usr/bin/gigablue_wol")
SystemInfo["VFD_scroll_repeats"] = fileCheck("/proc/stb/lcd/scroll_repeats")
SystemInfo["VFD_scroll_delay"] = fileCheck("/proc/stb/lcd/scroll_delay")
SystemInfo["VFD_initial_scroll_delay"] = fileCheck("/proc/stb/lcd/initial_scroll_delay")
SystemInfo["VFD_final_scroll_delay"] = fileCheck("/proc/stb/lcd/final_scroll_delay")
SystemInfo["LCDMiniTV"] = fileExists("/proc/stb/lcd/mode")
Exemplo n.º 30
0
 def execButtonSetup(self, selected):
     if selected:
         selected = selected[1].split("/")
         if selected[0] == "Plugins":
             twinPlugins = []
             twinPaths = {}
             pluginlist = plugins.getPlugins(
                 PluginDescriptor.WHERE_EVENTINFO)
             pluginlist.sort(key=lambda p: p.name)
             for plugin in pluginlist:
                 if plugin.name not in twinPlugins and plugin.path and 'selectedevent' not in plugin.__call__.__code__.co_varnames:
                     if plugin.path[plugin.path.rfind("Plugins"
                                                      ):] in twinPaths:
                         twinPaths[plugin.path[plugin.path.rfind("Plugins"
                                                                 ):]] += 1
                     else:
                         twinPaths[
                             plugin.path[plugin.path.rfind("Plugins"):]] = 1
                     if plugin.path[
                             plugin.path.rfind("Plugins"):] + "/" + str(
                                 twinPaths[plugin.path[plugin.path.rfind(
                                     "Plugins"):]]) == "/".join(selected):
                         self.runPlugin(plugin)
                         return
                     twinPlugins.append(plugin.name)
             pluginlist = plugins.getPlugins([
                 PluginDescriptor.WHERE_PLUGINMENU,
                 PluginDescriptor.WHERE_EXTENSIONSMENU
             ])
             pluginlist.sort(key=lambda p: p.name)
             for plugin in pluginlist:
                 if plugin.name not in twinPlugins and plugin.path:
                     if plugin.path[plugin.path.rfind("Plugins"
                                                      ):] in twinPaths:
                         twinPaths[plugin.path[plugin.path.rfind("Plugins"
                                                                 ):]] += 1
                     else:
                         twinPaths[
                             plugin.path[plugin.path.rfind("Plugins"):]] = 1
                     if plugin.path[
                             plugin.path.rfind("Plugins"):] + "/" + str(
                                 twinPaths[plugin.path[plugin.path.rfind(
                                     "Plugins"):]]) == "/".join(selected):
                         self.runPlugin(plugin)
                         return
                     twinPlugins.append(plugin.name)
         elif selected[0] == "MenuPlugin":
             for plugin in plugins.getPluginsForMenu(selected[1]):
                 if plugin[2] == selected[2]:
                     self.runPlugin(plugin[1])
                     return
         elif selected[0] == "Infobar":
             if hasattr(self, selected[1]):
                 exec("self." + ".".join(selected[1:]) + "()")
             else:
                 return 0
         elif selected[0] == "Module":
             try:
                 exec("from %s import %s;self.session.open(%s)" %
                      (selected[1], selected[2], ",".join(selected[2:])))
             except:
                 print(
                     "[ButtonSetup] error during executing module %s, screen %s"
                     % (selected[1], selected[2]))
                 import traceback
                 traceback.print_exc()
         elif selected[0] == "Setup":
             from Screens.Setup import Setup
             exec("self.session.open(Setup, \"%s\")" % selected[1])
         elif selected[0].startswith("Zap"):
             if selected[0] == "ZapPanic":
                 self.servicelist.history = []
                 self.pipShown() and self.showPiP()
             self.servicelist.servicelist.setCurrent(
                 eServiceReference("/".join(selected[1:])))
             self.servicelist.zap(enable_pipzap=True)
             if hasattr(self, "lastservice"):
                 self.lastservice = eServiceReference("/".join(
                     selected[1:]))
                 self.close()
             else:
                 self.show()
             from Screens.MovieSelection import defaultMoviePath
             moviepath = defaultMoviePath()
             if moviepath:
                 config.movielist.last_videodir.value = moviepath
         elif selected[0] == "PPanel":
             ppanelFileName = '/etc/ppanels/' + selected[1] + ".xml"
             if os.path.isfile(ppanelFileName) and os.path.isdir(
                     '/usr/lib/enigma2/python/Plugins/Extensions/PPanel'):
                 from Plugins.Extensions.PPanel.ppanel import PPanel
                 self.session.open(PPanel,
                                   name=selected[1] + ' PPanel',
                                   node=None,
                                   filename=ppanelFileName,
                                   deletenode=None)
         elif selected[0] == "Shellscript":
             command = '/usr/script/' + selected[1] + ".sh"
             if os.path.isfile(command) and os.path.isdir(
                     '/usr/lib/enigma2/python/Plugins/Extensions/PPanel'):
                 from Plugins.Extensions.PPanel.ppanel import Execute
                 self.session.open(Execute, selected[1] + " shellscript",
                                   None, command)
             else:
                 from Screens.Console import Console
                 exec("self.session.open(Console,_(selected[1]),[command])")
         elif selected[0] == "EMC":
             try:
                 from Plugins.Extensions.EnhancedMovieCenter.plugin import showMoviesNew
                 from Screens.InfoBar import InfoBar
                 open(showMoviesNew(InfoBar.instance))
             except Exception as e:
                 print('[EMCPlayer] showMovies exception:\n' + str(e))
         elif selected[0] == "ScriptRunner":
             from Screens.ScriptRunner import ScriptRunner
             self.session.open(ScriptRunner)
         elif selected[0] == "QuickMenu":
             from Screens.QuickMenu import QuickMenu
             self.session.open(QuickMenu)
         elif selected[0] == "Kodi":
             if isPluginInstalled("Kodi"):
                 from Plugins.Extensions.Kodi.plugin import KodiMainScreen
                 self.session.open(KodiMainScreen)
         elif selected[0] == "Bluetooth":
             if isPluginInstalled("BluetoothSetup"):
                 from Plugins.SystemPlugins.BluetoothSetup.plugin import BluetoothSetup
                 self.session.open(BluetoothSetup)
         elif selected[0] == "YoutubeTV":
             if isPluginInstalled("Chromium"):
                 from Plugins.Extensions.Chromium.youtube import YoutubeTVWindow
                 self.session.open(YoutubeTVWindow)