def okbuttonClick(self): selection = self["menu"].getCurrent() if selection is not None: if selection[1] == "radio": InfoBar.showRadio(InfoBar.instance) self.exit() if selection[1] == "tv": InfoBar.showTv(InfoBar.instance) self.exit() elif selection[1] == "pvr": InfoBar.showMoviePlayer(InfoBar.instance) elif selection[1] == "bmc": InfoBar.showMediaCenter(InfoBar.instance) elif selection[1] == "emc": try: from Plugins.Extensions.EnhancedMovieCenter.plugin import showMoviesNew open(showMoviesNew(InfoBar.instance)) except Exception as e: print('[EMCPlayer] showMovies exception:\n' + str(e)) elif selection[1] == "MediaPortal": InfoBar.showPORTAL(InfoBar.instance) elif selection[1] == "MediaPlayer": InfoBar.showMediaPlayer(InfoBar.instance) elif selection[1] == "AZPlay": try: from Plugins.Extensions.AZPlay.plugin import main open(main(self.session)) except Exception as e: print('[AZPlay] exception:\n' + str(e)) elif selection[1] == "teletext": self.InfoBarTeletextPlugin()
def okbuttonClick(self): selection = self["menu"].getCurrent() if selection is not None: if selection[1] == "radio": InfoBar.showRadio(InfoBar.instance) self.exit() if selection[1] == "tv": InfoBar.showTv(InfoBar.instance) self.exit() elif selection[1] == "pvr": InfoBar.showMovies(InfoBar.instance) elif selection[1] == "bmc": InfoBar.showMediaCenter(InfoBar.instance) elif selection[1] == "emc": try: from Plugins.Extensions.EnhancedMovieCenter.plugin import showMoviesNew open(showMoviesNew(InfoBar.instance)) except Exception as e: print('[EMCPlayer] showMovies exception:\n' + str(e)) elif selection[1] == "MediaPortal": InfoBar.showPORTAL(InfoBar.instance) elif selection[1] == "MediaPlayer": InfoBar.showMediaPlayer(InfoBar.instance) elif selection[1] == "AZPlay": try: from Plugins.Extensions.AZPlay.plugin import main open(main(self.session)) except Exception as e: print('[AZPlay] exception:\n' + str(e)) elif selection[1] == "teletext": self.InfoBarTeletextPlugin()
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__.func_code.co_varnames: if twinPaths.has_key( plugin.path[plugin.path.rfind("Plugins"):]): 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 twinPaths.has_key( plugin.path[plugin.path.rfind("Plugins"):]): 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 " + selected[1] + " import *" exec "self.session.open(" + ",".join(selected[2:]) + ")" except: print "[ButtonSetup] error during executing module %s, screen %s" % ( selected[1], selected[2]) elif selected[0] == "Setup": exec "from Screens.Setup import *" exec "self.session.open(Setup, \"" + 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] == "Kodi": if os.path.isfile( "/usr/lib/enigma2/python/Plugins/Extensions/Kodi/plugin.pyo" ): from Plugins.Extensions.Kodi.plugin import KodiMainScreen self.session.open(KodiMainScreen) elif selected[0] == "Bluetooth": if os.path.isfile( "/usr/lib/enigma2/python/Plugins/SystemPlugins/BluetoothSetup/plugin.pyo" ): from Plugins.SystemPlugins.BluetoothSetup.plugin import BluetoothSetup self.session.open(BluetoothSetup) elif selected[0] == "YoutubeTV": if os.path.isfile( "/usr/lib/enigma2/python/Plugins/Extensions/Chromium/plugin.pyo" ): from Plugins.Extensions.Chromium.youtube import YoutubeTVWindow self.session.open(YoutubeTVWindow)
def execButtonSetup(self, selected): if selected: selected = selected[1].split("/") if selected[0] == "Plugins": twinPlugins = [] twinPaths = {} 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[24:] in twinPaths: twinPaths[plugin.path[24:]] += 1 else: twinPaths[plugin.path[24:]] = 1 if plugin.path[24:] + "/" + str(twinPaths[ plugin.path[24:]]) == "/".join(selected): self.runPlugin(plugin) break twinPlugins.append(plugin.name) elif selected[0] == "MenuPlugin": for plugin in plugins.getPluginsForMenu(selected[1]): if plugin[2] == selected[2]: self.runPlugin(plugin[1]) break elif selected[0] == "Infobar": if hasattr(self, selected[1]): exec "self." + selected[1] + "()" else: return 0 elif selected[0] == "Module": try: exec "from %s import %s" % (selected[1], selected[2]) exec "self.session.open(%s)" % ",".join(selected[2:]) except: print "[ButtonSetup] error during executing module %s, screen %s" % ( selected[1], selected[2]) elif selected[0] == "Setup": from Screens.Setup import Setup exec "self.session.open(Setup, \"%s\")" % selected[1] elif selected[0] == "Zap": 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() 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": if os.path.isfile( "/usr/lib/enigma2/python/Plugins/Extensions/LDteam/ScriptRunner.pyo" ): from Plugins.Extensions.LDteam.ScriptRunner import ScriptRunner self.session.open(ScriptRunner) elif selected[0] == "Kodi": if os.path.isfile( "/usr/lib/enigma2/python/Plugins/Extensions/Kodi/plugin.pyo" ): from Plugins.Extensions.Kodi.plugin import KodiMainScreen self.session.open(KodiMainScreen) elif selected[0] == "Bluetooth": if os.path.isfile( "/usr/lib/enigma2/python/Plugins/SystemPlugins/BluetoothSetup/plugin.pyo" ): from Plugins.SystemPlugins.BluetoothSetup.plugin import BluetoothSetup self.session.open(BluetoothSetup) elif selected[0] == "YoutubeTV": if os.path.isfile( "/usr/lib/enigma2/python/Plugins/Extensions/Chromium/plugin.pyo" ): from Plugins.Extensions.Chromium.youtube import YoutubeTVWindow self.session.open(YoutubeTVWindow)
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__.func_code.co_varnames: if twinPaths.has_key(plugin.path[24:]): twinPaths[plugin.path[24:]] += 1 else: twinPaths[plugin.path[24:]] = 1 if plugin.path[24:] + '/' + str(twinPaths[plugin.path[24:]]) == '/'.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 twinPaths.has_key(plugin.path[24:]): twinPaths[plugin.path[24:]] += 1 else: twinPaths[plugin.path[24:]] = 1 if plugin.path[24:] + '/' + str(twinPaths[plugin.path[24:]]) == '/'.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 ' + selected[1] + ' import *' exec 'self.session.open(' + ','.join(selected[2:]) + ')' except: print '[ButtonSetup] error during executing module %s, screen %s' % (selected[1], selected[2]) elif selected[0] == 'Setup': exec 'from Screens.Setup import *' exec 'self.session.open(Setup, "' + 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) 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) return
def execHotkey(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__.func_code.co_varnames: if twinPaths.has_key(plugin.path[24:]): twinPaths[plugin.path[24:]] += 1 else: twinPaths[plugin.path[24:]] = 1 if plugin.path[24:] + "/" + str(twinPaths[plugin.path[24:]])== "/".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 twinPaths.has_key(plugin.path[24:]): twinPaths[plugin.path[24:]] += 1 else: twinPaths[plugin.path[24:]] = 1 if plugin.path[24:] + "/" + str(twinPaths[plugin.path[24:]])== "/".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 " + selected[1] + " import *" exec "self.session.open(" + ",".join(selected[2:]) + ")" except: print "[Hotkey] error during executing module %s, screen %s" % (selected[1], selected[2]) elif selected[0] == "Setup": exec "from Screens.Setup import *" exec "self.session.open(Setup, \"" + selected[1] + "\")" elif selected[0].startswith("Zap"): if selected[0] == "ZapPanic": self.servicelist.history = [] 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() 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/scripts/' + 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) 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] == "Kodi": if os.path.isfile("/usr/lib/enigma2/python/Plugins/Extensions/Kodi/plugin.pyo"): from Plugins.Extensions.Kodi.plugin import KodiMainScreen self.session.open(KodiMainScreen)
def execHotkey(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__.func_code.co_varnames: if twinPaths.has_key(plugin.path[pathLen:]): twinPaths[plugin.path[pathLen:]] += 1 else: twinPaths[plugin.path[pathLen:]] = 1 if plugin.path[pathLen:] + "/" + str(twinPaths[plugin.path[pathLen:]]) == "/".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 twinPaths.has_key(plugin.path[pathLen:]): twinPaths[plugin.path[pathLen:]] += 1 else: twinPaths[plugin.path[pathLen:]] = 1 if plugin.path[pathLen:] + "/" + str(twinPaths[plugin.path[pathLen:]]) == "/".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" % (selected[1], selected[2]) exec "self.session.open(%s)" % ",".join(selected[2:]) except: print "[Hotkey] error during executing module %s, screen %s" % (selected[1], selected[2]) 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() elif selected[0] == "PPanel": ppanelFileName = '/etc/ppanels/' + selected[1] + ".xml" if os.path.isfile(ppanelFileName) and os.path.isdir(ppath + "/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/scripts/' + selected[1] + ".sh" if os.path.isfile(command) and os.path.isdir(ppath + "/Plugins/Extensions/PPanel"): from Plugins.Extensions.PPanel.ppanel import Execute self.session.open(Execute, selected[1] + " shellscript", None, command) else: os.system(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] == "Kodi": if os.path.isfile(ppath + "/Plugins/Extensions/Kodi/plugin.pyo"): from Plugins.Extensions.Kodi.plugin import KodiMainScreen self.session.open(KodiMainScreen) elif selected[0] == "DeviceManager": from Plugins.SystemPlugins.DeviceManager.HddSetup import * self.session.open(HddSetup)
def execButtonSetup(self, selected): if selected: selected = selected[1].split("/") if selected[0] == "Plugins": twinPlugins = [] twinPaths = {} 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 twinPaths.has_key(plugin.path[24:]): twinPaths[plugin.path[24:]] += 1 else: twinPaths[plugin.path[24:]] = 1 if plugin.path[24:] + "/" + str(twinPaths[plugin.path[24:]]) == "/".join(selected): self.runPlugin(plugin) break twinPlugins.append(plugin.name) elif selected[0] == "MenuPlugin": for plugin in plugins.getPluginsForMenu(selected[1]): if plugin[2] == selected[2]: self.runPlugin(plugin[1]) break elif selected[0] == "Infobar": if hasattr(self, selected[1]): exec "self." + selected[1] + "()" else: return 0 elif selected[0] == "Module": try: exec "from " + selected[1] + " import *" exec "self.session.open(" + ",".join(selected[2:]) + ")" except: print "[ButtonSetup] error during executing module %s, screen %s" % (selected[1], selected[2]) elif selected[0] == "Setup": exec "from Screens.Setup import *" exec 'self.session.open(Setup, "' + selected[1] + '")' elif selected[0] == "Zap": 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() 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": if os.path.isfile("/usr/lib/enigma2/python/Plugins/Extensions/LDteam/ScriptRunner.pyo"): from Plugins.Extensions.LDteam.ScriptRunner import ScriptRunner self.session.open(ScriptRunner) elif selected[0] == "Kodi": if os.path.isfile("/usr/lib/enigma2/python/Plugins/Extensions/Kodi/plugin.pyo"): from Plugins.Extensions.Kodi.plugin import KodiMainScreen self.session.open(KodiMainScreen)
def execButtonSetup(self, selected): if selected: selected = selected[1].split("/") if selected[0] == "Plugins": twinPlugins = [] twinPaths = {} 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 twinPaths.has_key(plugin.path[24:]): twinPaths[plugin.path[24:]] += 1 else: twinPaths[plugin.path[24:]] = 1 if plugin.path[24:] + "/" + str(twinPaths[ plugin.path[24:]]) == "/".join(selected): self.runPlugin(plugin) break twinPlugins.append(plugin.name) elif selected[0] == "MenuPlugin": for plugin in plugins.getPluginsForMenu(selected[1]): if plugin[2] == selected[2]: self.runPlugin(plugin[1]) break elif selected[0] == "Infobar": if hasattr(self, selected[1]): exec "self." + selected[1] + "()" else: return 0 elif selected[0] == "Module": try: exec "from " + selected[1] + " import *" exec "self.session.open(" + ",".join(selected[2:]) + ")" except: print "[ButtonSetup] error during executing module %s, screen %s" % ( selected[1], selected[2]) elif selected[0] == "Setup": exec "from Screens.Setup import *" exec "self.session.open(Setup, \"" + selected[1] + "\")" elif selected[0] == "Zap": 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() 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) 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))
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 x: x.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 "%s/%s" % ( 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 "%s/%s" % ( 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.%s()" % ".".join(selected[1:])) else: return 0 elif selected[0] == "Module": try: exec("from %s import %s\nself.session.open(%s)" % (selected[1], selected[2], ",".join(selected[2:]))) except Exception as err: print( "[ButtonSetup] Error: Exception raised executing module '%s', screen '%s'! (%s)" % (selected[1], selected[2], str(err))) import traceback traceback.print_exc() elif selected[0] == "Setup": from Screens.Setup import Setup # exec("self.session.open(Setup, \"%s\")" % selected[1]) # DEBUG: What is this trying to do? self.session.open(Setup, 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/%s.xml" % selected[1] if isfile(ppanelFileName) and isdir( "/usr/lib/enigma2/python/Plugins/Extensions/PPanel"): from Plugins.Extensions.PPanel.ppanel import PPanel self.session.open(PPanel, name="%s PPanel" % selected[1], node=None, filename=ppanelFileName, deletenode=None) elif selected[0] == "Shellscript": command = "/usr/script/%s.sh" % selected[1] if isfile(command) and isdir( "/usr/lib/enigma2/python/Plugins/Extensions/PPanel"): from Plugins.Extensions.PPanel.ppanel import Execute self.session.open(Execute, "%s shellscript" % selected[1], None, command) else: from Screens.Console import Console # exec("self.session.open(Console, title=_(selected[1]), cmdlist=[command])") # DEBUG: What is this trying to do? 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) ) # DEBUG: Should this be self.session.open? except Exception as err: print( "[ButtonSetup] EMCPlayer: showMovies exception: %s!" % str(err)) 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)
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__.func_code.co_varnames: if twinPaths.has_key(plugin.path[24:]): twinPaths[plugin.path[24:]] += 1 else: twinPaths[plugin.path[24:]] = 1 if plugin.path[24:] + '/' + str(twinPaths[ plugin.path[24:]]) == '/'.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 twinPaths.has_key(plugin.path[24:]): twinPaths[plugin.path[24:]] += 1 else: twinPaths[plugin.path[24:]] = 1 if plugin.path[24:] + '/' + str(twinPaths[ plugin.path[24:]]) == '/'.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 ' + selected[1] + ' import *' exec 'self.session.open(' + ','.join(selected[2:]) + ')' except: print '[ButtonSetup] error during executing module %s, screen %s' % ( selected[1], selected[2]) elif selected[0] == 'Setup': exec 'from Screens.Setup import *' exec 'self.session.open(Setup, "' + 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] == '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] == 'Kodi': if os.path.isfile( '/usr/lib/enigma2/python/Plugins/Extensions/Kodi/plugin.pyo' ): from Plugins.Extensions.Kodi.plugin import KodiMainScreen self.session.open(KodiMainScreen) elif selected[0] == 'Bluetooth': if os.path.isfile( '/usr/lib/enigma2/python/Plugins/SystemPlugins/BluetoothSetup/plugin.pyo' ): from Plugins.SystemPlugins.BluetoothSetup.plugin import BluetoothSetup self.session.open(BluetoothSetup) return