Beispiel #1
0
def MPcallbackFunc(answer):
	if EMsession is None:
		return
	answer = answer and answer[1]
	if answer == "PLAYMOVIES":
		if InfoBar_instance:
			InfoBar_instance.showMovies()
	elif answer == "RADIO":
		if config.usage.e1like_radio_mode.value:
			askBM = []
			askBM.append((_("TV-mode"), "TM"))
			askBM.append((_("Radio-mode"), "RM"))
			askBM.append((_("Nothing"), "NO"))
			EMsession.openWithCallback(TvRadioCallback, ChoiceBox, title="EasyMedia...", list = askBM)
		else:
			if InfoBar_instance:
				InfoBar_instance.showRadio()
	elif answer == "BOOKMARKS":
		tmpBookmarks = config.movielist.videodirs
		myBookmarks = tmpBookmarks and tmpBookmarks.value[:] or []
		if len(myBookmarks)>0:
			askBM = []
			for s in myBookmarks:
				askBM.append((s, s))
			EMsession.openWithCallback(BookmarksCallback, ChoiceBox, title=_("Select bookmark..."), list = askBM)
	elif answer == "PICTURES":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/PicturePlayer/plugin.pyo"):
			from Plugins.Extensions.PicturePlayer.plugin import picshow
			EMsession.open(picshow)
		else:
			EMsession.open(MessageBox, text = _('Picture-player is not installed!'), type = MessageBox.TYPE_ERROR)
	elif answer == "MUSIC":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/MerlinMusicPlayer/plugin.pyo") and (config.plugins.easyMedia.music.value == "merlinmp"):
			from Plugins.Extensions.MerlinMusicPlayer.plugin import MerlinMusicPlayerFileList
			servicelist = None
			EMsession.open(MerlinMusicPlayerFileList, servicelist)
		elif fileExists("/usr/lib/enigma2/python/Plugins/Extensions/MediaPlayer/plugin.pyo") and (config.plugins.easyMedia.music.value == "mediaplayer"):
			from Plugins.Extensions.MediaPlayer.plugin import MediaPlayer
			EMsession.open(MediaPlayer)
		else:
			EMsession.open(MessageBox, text = _('No Music-Player installed!'), type = MessageBox.TYPE_ERROR)
	elif answer == "FILES":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/Tuxcom/plugin.pyo") and (config.plugins.easyMedia.files.value == "tuxcom"):
			from Plugins.Extensions.Tuxcom.plugin import TuxComStarter
			EMsession.open(TuxComStarter)
		elif fileExists("/usr/lib/enigma2/python/Plugins/Extensions/DreamExplorer/plugin.pyo") and (config.plugins.easyMedia.files.value == "dreamexplorer"):
			from Plugins.Extensions.DreamExplorer.plugin import DreamExplorerII
			EMsession.open(DreamExplorerII)
		elif fileExists("/usr/lib/enigma2/python/Plugins/Extensions/Filebrowser/plugin.pyo") and (config.plugins.easyMedia.files.value == "filebrowser"):
			from Plugins.Extensions.Filebrowser.plugin import FilebrowserScreen
			EMsession.open(FilebrowserScreen)
		else:
			EMsession.open(MessageBox, text = _('No File-Manager installed!'), type = MessageBox.TYPE_ERROR)
	elif answer == "WEATHER":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/WeatherPlugin/plugin.pyo"):
			from Plugins.Extensions.WeatherPlugin.plugin import WeatherPlugin
			EMsession.open(WeatherPlugin)
		else:
			EMsession.open(MessageBox, text = _('Weather Plugin is not installed!'), type = MessageBox.TYPE_ERROR)
	elif answer == "DVD":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/DVDPlayer/plugin.pyo"):
			from Plugins.Extensions.DVDPlayer.plugin import DVDPlayer
			EMsession.open(DVDPlayer)
		else:
			EMsession.open(MessageBox, text = _('DVDPlayer Plugin is not installed!'), type = MessageBox.TYPE_ERROR)
	elif answer == "MYTUBE":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/MyTube/plugin.pyo"):
			from Plugins.Extensions.MyTube.plugin import *
			MyTubeMain(EMsession)
		else:
			EMsession.open(MessageBox, text = _('MyTube Plugin is not installed!'), type = MessageBox.TYPE_ERROR)
	elif answer == "INTERNETRADIO":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/InternetRadio/plugin.pyo"):
			from Plugins.Extensions.InternetRadio.InternetRadioScreen import InternetRadioScreen
			EMsession.open(InternetRadioScreen)
		else:
			EMsession.open(MessageBox, text = _('SHOUTcast Plugin is not installed!'), type = MessageBox.TYPE_ERROR)
	elif answer == "ZDF":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/ZDFMediathek/plugin.pyo"):
			from Plugins.Extensions.ZDFMediathek.plugin import ZDFMediathek
			EMsession.open(ZDFMediathek)
		else:
			EMsession.open(MessageBox, text = _('ZDFmediathek Plugin is not installed!'), type = MessageBox.TYPE_ERROR)
	elif answer == "VLC":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/VlcPlayer/plugin.pyo"):
			from Plugins.Extensions.VlcPlayer.plugin import *
			main(EMsession)
		else:
			EMsession.open(MessageBox, text = _('VLC Player is not installed!'), type = MessageBox.TYPE_ERROR)
	elif answer == "IDREAM":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/MerlinMusicPlayer/plugin.pyo"):
			from Plugins.Extensions.MerlinMusicPlayer.plugin import iDreamMerlin
			servicelist = None
			EMsession.open(iDreamMerlin, servicelist)
		else:
			EMsession.open(MessageBox, text = _('Merlin iDream is not installed!'), type = MessageBox.TYPE_ERROR)
	elif answer == "MYVIDEO":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/MyVideoPlayer/plugin.pyo"):
			from Plugins.Extensions.MyVideoPlayer.plugin import Vidtype
			EMsession.open(Vidtype)
		else:
			EMsession.open(MessageBox, text = _('MyVideo Player is not installed!'), type = MessageBox.TYPE_ERROR)
	elif answer == "VIDEODB":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/VideoDB/plugin.pyo"):
			from Plugins.Extensions.VideoDB.plugin import main as vdbmain
			vdbmain(EMsession)
		else:
			EMsession.open(MessageBox, text = _('VideoDB is not installed!'), type = MessageBox.TYPE_ERROR)
	elif answer == "TIMERS":
		from Screens.TimerEdit import TimerEditList
		EMsession.open(TimerEditList)
	elif answer is not None and "++++" in answer:
		plugToRun = answer[4:]
		try:
			inpf = open(("/usr/lib/enigma2/python/Plugins/Extensions/EasyMedia/" + plugToRun + ".plug"), 'rb')
			runPlug = pickle.load(inpf)
			inpf.close()	
			runPlug(session = EMsession)
		except: EMsession.open(MessageBox, text = (plugToRun + " not found!"), type = MessageBox.TYPE_WARNING)
def MPcallbackFunc(answer):
    if EMsession is None:
        return
    answer = answer and answer[1]
    if answer == "PLAYMOVIES":
        if InfoBar_instance:
            InfoBar_instance.showMovies()
    elif answer == "RADIO":
        if config.usage.e1like_radio_mode.value:
            askBM = []
            askBM.append((_("TV-mode"), "TM"))
            askBM.append((_("Radio-mode"), "RM"))
            askBM.append((_("Nothing"), "NO"))
            EMsession.openWithCallback(TvRadioCallback,
                                       ChoiceBox,
                                       title="EasyMedia...",
                                       list=askBM)
        else:
            if InfoBar_instance:
                InfoBar_instance.showRadio()
    elif answer == "BOOKMARKS":
        tmpBookmarks = config.movielist.videodirs
        myBookmarks = tmpBookmarks and tmpBookmarks.value[:] or []
        if len(myBookmarks) > 0:
            askBM = []
            for s in myBookmarks:
                askBM.append((s, s))
            EMsession.openWithCallback(BookmarksCallback,
                                       ChoiceBox,
                                       title=_("Select bookmark..."),
                                       list=askBM)
    elif answer == "PICTURES":
        if fileExists(
                resolveFilename(SCOPE_PLUGINS,
                                "Extensions/PicturePlayer/plugin.pyo")):
            from Plugins.Extensions.PicturePlayer.plugin import picshow
            EMsession.open(picshow)
        else:
            EMsession.open(MessageBox,
                           text=_('Picture-player is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "MUSIC":
        if fileExists(
                resolveFilename(
                    SCOPE_PLUGINS,
                    "Extensions/MerlinMusicPlayer/plugin.pyo")) and (
                        config.plugins.easyMedia.music.value == "merlinmp"):
            from Plugins.Extensions.MerlinMusicPlayer.plugin import MerlinMusicPlayerFileList
            servicelist = None
            EMsession.open(MerlinMusicPlayerFileList, servicelist)
        elif fileExists(
                resolveFilename(
                    SCOPE_PLUGINS, "Extensions/MediaPlayer/plugin.pyo")) and (
                        config.plugins.easyMedia.music.value == "mediaplayer"):
            from Plugins.Extensions.MediaPlayer.plugin import MediaPlayer
            EMsession.open(MediaPlayer)
        else:
            EMsession.open(MessageBox,
                           text=_('No Music-Player installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "FILES":
        if fileExists(
                resolveFilename(
                    SCOPE_PLUGINS, "Extensions/Tuxcom/plugin.pyo")) and (
                        config.plugins.easyMedia.files.value == "tuxcom"):
            from Plugins.Extensions.Tuxcom.plugin import TuxComStarter
            EMsession.open(TuxComStarter)
        elif fileExists(
                resolveFilename(SCOPE_PLUGINS,
                                "Extensions/DreamExplorer/plugin.pyo")) and (
                                    config.plugins.easyMedia.files.value
                                    == "dreamexplorer"):
            from Plugins.Extensions.DreamExplorer.plugin import DreamExplorerII
            EMsession.open(DreamExplorerII)
        elif fileExists(
                resolveFilename(
                    SCOPE_PLUGINS, "Extensions/Filebrowser/plugin.pyo")) and (
                        config.plugins.easyMedia.files.value == "filebrowser"):
            from Plugins.Extensions.Filebrowser.plugin import FilebrowserScreen
            EMsession.open(FilebrowserScreen)
        else:
            EMsession.open(MessageBox,
                           text=_('No File-Manager installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "WEATHER":
        if fileExists(
                resolveFilename(SCOPE_PLUGINS,
                                "Extensions/WeatherPlugin/plugin.pyo")):
            from Plugins.Extensions.WeatherPlugin.plugin import MSNWeatherPlugin
            EMsession.open(MSNWeatherPlugin)
        else:
            EMsession.open(MessageBox,
                           text=_('Weather Plugin is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "DVD":
        if fileExists(
                resolveFilename(SCOPE_PLUGINS,
                                "Extensions/DVDPlayer/plugin.pyo")):
            from Plugins.Extensions.DVDPlayer.plugin import DVDPlayer
            EMsession.open(DVDPlayer)
        else:
            EMsession.open(MessageBox,
                           text=_('DVDPlayer Plugin is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "MYTUBE":
        if fileExists(
                resolveFilename(SCOPE_PLUGINS,
                                "Extensions/MyTube/plugin.pyo")):
            from Plugins.Extensions.MyTube.plugin import *
            MyTubeMain(EMsession)
        else:
            EMsession.open(MessageBox,
                           text=_('MyTube Plugin is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "INTERNETRADIO":
        if fileExists(
                resolveFilename(SCOPE_PLUGINS,
                                "Extensions/InternetRadio/plugin.pyo")):
            from Plugins.Extensions.InternetRadio.InternetRadioScreen import InternetRadioScreen
            EMsession.open(InternetRadioScreen)
        else:
            EMsession.open(MessageBox,
                           text=_('SHOUTcast Plugin is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "ZDF":
        if fileExists(
                resolveFilename(SCOPE_PLUGINS,
                                "Extensions/ZDFMediathek/plugin.pyo")):
            from Plugins.Extensions.ZDFMediathek.plugin import ZDFMediathek
            EMsession.open(ZDFMediathek)
        else:
            EMsession.open(MessageBox,
                           text=_('ZDFmediathek Plugin is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "VLC":
        if fileExists(
                resolveFilename(SCOPE_PLUGINS,
                                "Extensions/VlcPlayer/plugin.pyo")):
            from Plugins.Extensions.VlcPlayer.plugin import *
            main(EMsession)
        else:
            EMsession.open(MessageBox,
                           text=_('VLC Player is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "IDREAM":
        if fileExists(
                resolveFilename(SCOPE_PLUGINS,
                                "Extensions/MerlinMusicPlayer/plugin.pyo")):
            from Plugins.Extensions.MerlinMusicPlayer.plugin import iDreamMerlin
            servicelist = None
            EMsession.open(iDreamMerlin, servicelist)
        else:
            EMsession.open(MessageBox,
                           text=_('Merlin iDream is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "MYVIDEO":
        if fileExists(
                resolveFilename(SCOPE_PLUGINS,
                                "Extensions/MyVideoPlayer/plugin.pyo")):
            from Plugins.Extensions.MyVideoPlayer.plugin import Vidtype
            EMsession.open(Vidtype)
        else:
            EMsession.open(MessageBox,
                           text=_('MyVideo Player is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "VIDEODB":
        if fileExists(
                resolveFilename(SCOPE_PLUGINS,
                                "Extensions/VideoDB/plugin.pyo")):
            from Plugins.Extensions.VideoDB.plugin import main as vdbmain
            vdbmain(EMsession)
        else:
            EMsession.open(MessageBox,
                           text=_('VideoDB is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "TIMERS":
        from Screens.TimerEdit import TimerEditList
        EMsession.open(TimerEditList)
    elif answer is not None and "++++" in answer:
        plugToRun = answer[4:]
        try:
            inpf = open((resolveFilename(
                SCOPE_PLUGINS, "Extensions/EasyMedia/" + plugToRun + ".plug")),
                        'rb')
            runPlug = pickle.load(inpf)
            inpf.close()
            runPlug(session=EMsession)
        except:
            EMsession.open(MessageBox,
                           text=(plugToRun + " not found!"),
                           type=MessageBox.TYPE_WARNING)
Beispiel #3
0
def MPcallbackFunc(answer):
    if EMsession is None:
        return
    answer = answer and answer[1]
    if answer == "PLAYMOVIES":
        if InfoBar_instance:
            InfoBar_instance.showMovies()
    elif answer == "RADIO":
        if config.usage.e1like_radio_mode.value:
            askBM = []
            askBM.append((_("TV-mode"), "TM"))
            askBM.append((_("Radio-mode"), "RM"))
            askBM.append((_("Nothing"), "NO"))
            EMsession.openWithCallback(TvRadioCallback,
                                       ChoiceBox,
                                       title="EasyMedia...",
                                       list=askBM)
        else:
            if InfoBar_instance:
                InfoBar_instance.showRadio()
    elif answer == "BOOKMARKS":
        tmpBookmarks = config.movielist.videodirs
        myBookmarks = tmpBookmarks and tmpBookmarks.value[:] or []
        if len(myBookmarks) > 0:
            askBM = []
            for s in myBookmarks:
                askBM.append((s, s))
            EMsession.openWithCallback(BookmarksCallback,
                                       ChoiceBox,
                                       title=_("Select bookmark..."),
                                       list=askBM)
    elif answer == "PICTURES":
        if isPluginInstalled("PicturePlayer"):
            try:
                from Plugins.Extensions.PicturePlayer.plugin import picshow
                EMsession.open(picshow)
            except:
                pass
        else:
            EMsession.open(MessageBox,
                           text=_('Picture-player is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "MUSIC":
        if isPluginInstalled("MerlinMusicPlayer") and (
                config.plugins.easyMedia.music.value == "merlinmp"):
            try:
                from Plugins.Extensions.MerlinMusicPlayer.plugin import MerlinMusicPlayerFileList
                servicelist = None
                EMsession.open(MerlinMusicPlayerFileList, servicelist)
            except:
                pass
        elif isPluginInstalled("MediaPlayer") and (
                config.plugins.easyMedia.music.value == "mediaplayer"):
            try:
                from Plugins.Extensions.MediaPlayer.plugin import MediaPlayer
                EMsession.open(MediaPlayer)
            except:
                pass
        else:
            EMsession.open(MessageBox,
                           text=_('No Music-Player installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "FILES":
        if isPluginInstalled("FileCommander") and (
                config.plugins.easyMedia.files.value == "filecommander"):
            try:
                from Plugins.Extensions.FileCommander.plugin import start_from_pluginmenu
                start_from_pluginmenu(EMsession)
            except:
                pass
        elif isPluginInstalled("Tuxcom") and (
                config.plugins.easyMedia.files.value == "tuxcom"):
            try:
                from Plugins.Extensions.Tuxcom.plugin import TuxComStarter
                EMsession.open(TuxComStarter)
            except:
                pass
        elif isPluginInstalled("DreamExplorer") and (
                config.plugins.easyMedia.files.value == "dreamexplorer"):
            try:
                from Plugins.Extensions.DreamExplorer.plugin import DreamExplorerII
                EMsession.open(DreamExplorerII)
            except:
                pass
        elif isPluginInstalled("Filebrowser") and (
                config.plugins.easyMedia.files.value == "filebrowser"):
            try:
                from Plugins.Extensions.Filebrowser.plugin import FilebrowserScreen
                EMsession.open(FilebrowserScreen)
            except:
                pass
        else:
            EMsession.open(MessageBox,
                           text=_('No File-Manager installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "WEATHER":
        if isPluginInstalled("WeatherPlugin"):
            try:
                from Plugins.Extensions.WeatherPlugin.plugin import MSNWeatherPlugin
                EMsession.open(MSNWeatherPlugin)
            except:
                pass
        else:
            EMsession.open(MessageBox,
                           text=_('Weather Plugin is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "DVD":
        if isPluginInstalled("DVDPlayer"):
            try:
                from Plugins.Extensions.DVDPlayer.plugin import DVDPlayer
                EMsession.open(DVDPlayer)
            except:
                pass
        else:
            EMsession.open(MessageBox,
                           text=_('DVDPlayer Plugin is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "MYTUBE":
        if isPluginInstalled("MyTube"):
            try:
                from Plugins.Extensions.MyTube.plugin import MyTubeMain
                MyTubeMain(EMsession)
            except:
                pass
        else:
            EMsession.open(MessageBox,
                           text=_('MyTube Plugin is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "INTERNETRADIO":
        if isPluginInstalled(
                "SHOUTcast"
        ):  # and (config.plugins.easyMedia.music.value == "shoutcast")
            try:
                from Plugins.Extensions.SHOUTcast.plugin import SHOUTcastWidget
                EMsession.open(SHOUTcastWidget)
            except:
                pass
        elif isPluginInstalled("InternetRadio"):
            try:
                from Plugins.Extensions.InternetRadio.InternetRadioScreen import InternetRadioScreen
                EMsession.open(InternetRadioScreen)
            except:
                pass
        else:
            EMsession.open(MessageBox,
                           text=_('InternetRadio Plugin is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "ZDF":
        if isPluginInstalled("ZDFMediathek"):
            try:
                from Plugins.Extensions.ZDFMediathek.plugin import ZDFMediathek
                EMsession.open(ZDFMediathek)
            except:
                pass
        elif isPluginInstalled("QtHbbtv"):
            try:
                from Plugins.Extensions.QtHbbtv.plugin import HBBTVParser
                EMsession.open(HBBTVParser)
            except:
                pass
        else:
            EMsession.open(MessageBox,
                           text=_('ZDFmediathek Plugin is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "VLC":
        if isPluginInstalled("VlcPlayer"):
            try:
                from Plugins.Extensions.VlcPlayer.plugin import main
                main(EMsession)
            except:
                pass
        else:
            EMsession.open(MessageBox,
                           text=_('VLC Player is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "IDREAM":
        if isPluginInstalled("MerlinMusicPlayer"):
            try:
                from Plugins.Extensions.MerlinMusicPlayer.plugin import iDreamMerlin
                servicelist = None
                EMsession.open(iDreamMerlin, servicelist)
            except:
                pass
        else:
            EMsession.open(MessageBox,
                           text=_('Merlin iDream is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "MYVIDEO":
        if isPluginInstalled("MyVideoPlayer"):
            try:
                from Plugins.Extensions.MyVideoPlayer.plugin import Vidtype
                EMsession.open(Vidtype)
            except:
                pass
        else:
            EMsession.open(MessageBox,
                           text=_('MyVideo Player is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "KODI":
        if isPluginInstalled("Kodi"):
            from Plugins.Extensions.Kodi.plugin import startLauncher
            startLauncher(EMsession)
        else:
            EMsession.open(MessageBox,
                           text=_('Kodi is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "VIDEODB":
        if isPluginInstalled("VideoDB"):
            try:
                from Plugins.Extensions.VideoDB.plugin import main as vdbmain
                vdbmain(EMsession)
            except:
                pass
        else:
            EMsession.open(MessageBox,
                           text=_('VideoDB is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "TIMERS":
        from Screens.TimerEdit import TimerEditList
        EMsession.open(TimerEditList)
    elif answer is not None and "++++" in answer:
        plugToRun = answer[4:]
        try:
            inpf = open((PluginsDir + 'EasyMedia/' + plugToRun + '.plug'),
                        'rb')
            runPlug = load(inpf)
            inpf.close()
            runPlug(session=EMsession)
        except:
            EMsession.open(MessageBox,
                           text=(plugToRun + " not found!"),
                           type=MessageBox.TYPE_WARNING)