1 #######################################################################
3 # EasyMedia for Dreambox-Enigma2
4 # Coded by Vali (c)2010-2011
6 # This plugin is licensed under the Creative Commons
7 # Attribution-NonCommercial-ShareAlike 3.0 Unported License.
8 # To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/
9 # or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
11 # Alternatively, this plugin may be distributed and executed on hardware which
12 # is licensed by Dream Multimedia GmbH.
14 # This plugin is NOT free software. It is open source, you are allowed to
15 # modify it (if you keep the license), but it may not be commercially
16 # distributed other than under the conditions noted above.
18 #######################################################################
20 from Screens.Screen import Screen
21 from Screens.MessageBox import MessageBox
22 from Screens.InfoBarGenerics import InfoBarPlugins
23 from Screens.InfoBar import InfoBar
24 from Screens.ChoiceBox import ChoiceBox
25 from Plugins.Plugin import PluginDescriptor
26 from Components.ActionMap import ActionMap
27 from Components.MenuList import MenuList
28 from Components.Label import Label
29 from Components.ConfigList import ConfigListScreen
30 from Components.PluginComponent import plugins
31 from Components.PluginList import *
32 from Components.Sources.StaticText import StaticText
33 from Components.config import config, getConfigListEntry, ConfigSubsection, ConfigSelection
34 from Tools.Directories import fileExists, pathExists, resolveFilename, SCOPE_PLUGINS
35 from Tools.LoadPixmap import LoadPixmap
36 from Tools.HardwareInfo import HardwareInfo
37 from enigma import RT_HALIGN_LEFT, eListboxPythonMultiContent, gFont, getDesktop
39 from os import system as os_system
40 from os import listdir as os_listdir
44 EMbaseInfoBarPlugins__init__ = None
45 EMStartOnlyOneTime = False
47 InfoBar_instance = None
51 config.plugins.easyMedia = ConfigSubsection()
52 config.plugins.easyMedia.music = ConfigSelection(default="mediaplayer", choices = [("no", _("Disabled")), ("mediaplayer", _("MediaPlayer")), ("merlinmp", _("MerlinMusicPlayer"))])
53 config.plugins.easyMedia.files = ConfigSelection(default="dreamexplorer", choices = [("no", _("Disabled")), ("filebrowser", _("Filebrowser")), ("dreamexplorer", _("DreamExplorer")), ("tuxcom", _("TuxCom"))])
54 config.plugins.easyMedia.videodb = ConfigSelection(default="no", choices = [("no", _("Disabled")), ("yes", _("Enabled"))])
55 config.plugins.easyMedia.bookmarks = ConfigSelection(default="no", choices = [("no", _("Disabled")), ("yes", _("Enabled"))])
56 config.plugins.easyMedia.pictures = ConfigSelection(default="yes", choices = [("no", _("Disabled")), ("yes", _("Enabled"))])
57 config.plugins.easyMedia.mytube = ConfigSelection(default="no", choices = [("no", _("Disabled")), ("yes", _("Enabled"))])
58 config.plugins.easyMedia.vlc = ConfigSelection(default="no", choices = [("no", _("Disabled")), ("yes", _("Enabled"))])
59 config.plugins.easyMedia.dvd = ConfigSelection(default="no", choices = [("no", _("Disabled")), ("yes", _("Enabled"))])
60 config.plugins.easyMedia.weather = ConfigSelection(default="yes", choices = [("no", _("Disabled")), ("yes", _("Enabled"))])
61 config.plugins.easyMedia.iradio = ConfigSelection(default="no", choices = [("no", _("Disabled")), ("yes", _("Enabled"))])
62 config.plugins.easyMedia.idream = ConfigSelection(default="no", choices = [("no", _("Disabled")), ("yes", _("Enabled"))])
63 config.plugins.easyMedia.zdfmedia = ConfigSelection(default="no", choices = [("no", _("Disabled")), ("yes", _("Enabled"))])
64 config.plugins.easyMedia.radio = ConfigSelection(default="yes", choices = [("no", _("Disabled")), ("yes", _("Enabled"))])
65 config.plugins.easyMedia.myvideo = ConfigSelection(default="no", choices = [("no", _("Disabled")), ("yes", _("Enabled"))])
66 config.plugins.easyMedia.timers = ConfigSelection(default="no", choices = [("no", _("Disabled")), ("yes", _("Enabled"))])
70 def Plugins(**kwargs):
71 return [PluginDescriptor(where = PluginDescriptor.WHERE_SESSIONSTART, fnc = EasyMediaAutostart),
72 PluginDescriptor(name="EasyMedia", description=_("Not easy way to start EasyMedia"), where = PluginDescriptor.WHERE_PLUGINMENU, fnc=notEasy),]
76 def EasyMediaAutostart(reason, **kwargs):
77 global EMbaseInfoBarPlugins__init__
78 if "session" in kwargs:
80 EMsession = kwargs["session"]
81 if EMbaseInfoBarPlugins__init__ is None:
82 EMbaseInfoBarPlugins__init__ = InfoBarPlugins.__init__
83 InfoBarPlugins.__init__ = InfoBarPlugins__init__
84 InfoBarPlugins.pvr = pvr
88 def InfoBarPlugins__init__(self):
89 global EMStartOnlyOneTime
90 if not EMStartOnlyOneTime:
91 EMStartOnlyOneTime = True
92 global InfoBar_instance
93 InfoBar_instance = self
94 self["EasyMediaActions"] = ActionMap(["EasyMediaActions"],
95 {"video_but": self.pvr}, -1)
97 InfoBarPlugins.__init__ = InfoBarPlugins.__init__
98 InfoBarPlugins.pvr = None
99 EMbaseInfoBarPlugins__init__(self)
104 self.session.openWithCallback(MPcallbackFunc, EasyMedia)
108 def notEasy(session, **kwargs):
109 session.openWithCallback(MPcallbackFunc, EasyMedia)
113 def MPanelEntryComponent(key, text, cell):
114 sz_w = getDesktop(0).size().width()
129 res.append((eListboxPythonMultiContent.TYPE_TEXT, wx, wy, 300, ih, 0, RT_HALIGN_LEFT, text[0]))
131 bpng = LoadPixmap('/usr/lib/enigma2/python/Plugins/Extensions/EasyMedia/key-' + str(cell) + ".png")
133 res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 0, 5, 5, psy, bpng))
134 png = LoadPixmap(EasyMedia.EMiconspath + key + '.png')
136 res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 25, 5, psx, psy, png))
138 png = LoadPixmap(EasyMedia.EMiconspath + 'default.png')
140 res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 25, 5, psx, psy, png))
145 class MPanelList(MenuList):
146 def __init__(self, list, selection = 0, enableWrapAround=True):
147 sz_w = getDesktop(0).size().width()
155 MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent)
156 self.l.setFont(0, gFont("Regular", fs))
157 self.l.setItemHeight(ih)
158 self.selection = selection
159 def postWidgetCreate(self, instance):
160 MenuList.postWidgetCreate(self, instance)
161 self.moveToIndex(self.selection)
165 def BookmarksCallback(choice):
166 choice = choice and choice[1]
168 config.movielist.last_videodir.value = choice
169 config.movielist.last_videodir.save()
171 InfoBar_instance.showMovies()
175 def TvRadioCallback(choice):
176 choice = choice and choice[1]
179 InfoBar_instance.showTv()
182 InfoBar_instance.showRadio()
186 class ConfigEasyMedia(ConfigListScreen, Screen):
188 <screen name="ConfigEasyMedia" position="center,center" size="600,410" title="EasyMedia settings...">
189 <widget name="config" position="5,5" scrollbarMode="showOnDemand" size="590,380"/>
190 <eLabel font="Regular;20" foregroundColor="#00ff4A3C" halign="center" position="20,388" size="140,26" text="Cancel"/>
191 <eLabel font="Regular;20" foregroundColor="#0056C856" halign="center" position="165,388" size="140,26" text="Save"/>
192 <eLabel font="Regular;20" foregroundColor="#00f3ca09" halign="center" position="310,388" size="140,26" text="Plugins"/>
194 def __init__(self, session):
195 Screen.__init__(self, session)
196 self.setTitle(_("EasyMedia settings..."))
197 self.session = session
199 list.append(getConfigListEntry(_("Video database:"), config.plugins.easyMedia.videodb))
200 list.append(getConfigListEntry(_("Music player:"), config.plugins.easyMedia.music))
201 list.append(getConfigListEntry(_("Files browser:"), config.plugins.easyMedia.files))
202 list.append(getConfigListEntry(_("Show bookmarks:"), config.plugins.easyMedia.bookmarks))
203 list.append(getConfigListEntry(_("Timer:"), config.plugins.easyMedia.timers))
204 list.append(getConfigListEntry(_("PicturePlayer:"), config.plugins.easyMedia.pictures))
205 list.append(getConfigListEntry(_("Show tv/radio switch:"), config.plugins.easyMedia.radio))
206 list.append(getConfigListEntry(_("YouTube player:"), config.plugins.easyMedia.mytube))
207 list.append(getConfigListEntry(_("VLC player:"), config.plugins.easyMedia.vlc))
208 list.append(getConfigListEntry(_("DVD player:"), config.plugins.easyMedia.dvd))
209 list.append(getConfigListEntry(_("Weather plugin:"), config.plugins.easyMedia.weather))
210 list.append(getConfigListEntry(_("InternetRadio player:"), config.plugins.easyMedia.iradio))
211 list.append(getConfigListEntry(_("Show Merlin-iDream:"), config.plugins.easyMedia.idream))
212 list.append(getConfigListEntry(_("ZDFmediathek player:"), config.plugins.easyMedia.zdfmedia))
213 list.append(getConfigListEntry(_("MyVideo player:"), config.plugins.easyMedia.myvideo))
214 ConfigListScreen.__init__(self, list)
215 self["actions"] = ActionMap(["OkCancelActions", "ColorActions"], {"green": self.save, "red": self.exit, "cancel": self.exit, "yellow": self.plug}, -1)
218 for x in self["config"].list:
223 for x in self["config"].list:
228 self.session.open(AddPlug)
232 class AddPlug(Screen):
234 <screen name="AddPlug" position="center,center" size="440,420" title="EasyMedia...">
235 <widget source="pluginlist" render="Listbox" position="10,10" size="420,400" scrollbarMode="showOnDemand">
236 <convert type="TemplatedMultiContent">
239 MultiContentEntryText(pos = (120, 5), size = (320, 25), font = 0, text = 1), # index 1 is the plugin.name
240 MultiContentEntryText(pos = (120, 26), size = (320, 17), font = 1, text = 2), # index 2 is the plugin.description
241 MultiContentEntryPixmapAlphaTest(pos = (10, 5), size = (100, 40), png = 3), # index 3 is the icon
245 "fonts": [gFont("Regular", 20), gFont("Regular", 14)],
251 def __init__(self, session):
252 Screen.__init__(self, session)
253 self.setTitle(_("Add/remove plugin"))
254 plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
255 self.session = session
257 self["pluginlist"] = PluginList(self.list)
260 self["actions"] = ActionMap(["WizardActions"],
265 self.onExecBegin.append(self.checkWarnings)
266 self.onShown.append(self.updateList)
268 def checkWarnings(self):
269 if len(plugins.warnings):
270 text = _("Some plugins are not available:\n")
271 for (pluginname, error) in plugins.warnings:
272 text += _("%s (%s)\n") % (pluginname, error)
273 plugins.resetWarnings()
274 self.session.open(MessageBox, text = text, type = MessageBox.TYPE_WARNING)
276 def updateList(self):
277 self.pluginlist = plugins.getPlugins(PluginDescriptor.WHERE_PLUGINMENU)
278 self.list = [PluginEntryComponent(plugin) for plugin in self.pluginlist]
279 self["pluginlist"].setList(self.list)
282 plugin = self["pluginlist"].getCurrent()[0]
285 if not fileExists("/usr/lib/enigma2/python/Plugins/Extensions/EasyMedia/" + plugin.name + ".plug"):
287 outf = open(("/usr/lib/enigma2/python/Plugins/Extensions/EasyMedia/" + plugin.name + ".plug"), 'wb')
288 pickle.dump(plugin, outf)
290 self.session.open(MessageBox, text = (plugin.name + _(" added to EasyMedia")), type = MessageBox.TYPE_INFO)
291 except: self.session.open(MessageBox, text = "Write Error!", type = MessageBox.TYPE_WARNING)
293 order = 'rm -f \"' + '/usr/lib/enigma2/python/Plugins/Extensions/EasyMedia/' + plugin.name + '.plug' + '\"'
296 self.session.open(MessageBox, text = (plugin.name + _(" removed from EasyMedia")), type = MessageBox.TYPE_INFO)
297 except: self.session.open(MessageBox, text = "Write Error!", type = MessageBox.TYPE_WARNING)
301 class EasyMediaSummary(Screen):
302 if "800se" in HardwareInfo().get_device_name():
304 <screen position="0,0" size="96,64" id="2">
305 <eLabel text="EasyMedia:" foregroundColor="#fcc000" position="0,0" size="96,24" font="Regular;16"/>
306 <widget name="text1" position="0,24" size="96,40" font="Regular;18"/>
310 <screen position="0,0" size="132,64">
311 <eLabel text="EasyMedia:" position="0,0" size="132,24" font="Regular;14"/>
312 <widget name="text1" position="0,24" size="132,40" font="Regular;16"/>
314 def __init__(self, session, parent):
315 Screen.__init__(self, session)
316 self["text1"] = Label()
317 self.onLayoutFinish.append(self.layoutEnd)
320 self["text1"].setText(_("Movies"))
322 def setText(self, text, line):
323 self["text1"].setText(text)
327 class EasyMedia(Screen):
328 sz_w = getDesktop(0).size().width()
331 <screen flags="wfNoBorder" position="0,0" size="550,1080" title="Easy Media">
332 <ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyMedia/bg2.png" position="0,0" size="750,576"/>
333 <ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyMedia/bg2.png" position="0,576" size="750,503"/>
334 <widget name="list" position="60,30" size="450,1080" scrollbarMode="showNever" transparent="1" zPosition="2"/>
338 <screen flags="wfNoBorder" position="0,0" size="450,720" title="Easy Media">
339 <ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyMedia/bg.png" position="0,0" size="450,576"/>
340 <ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyMedia/bg.png" position="0,576" size="450,145"/>
341 <widget name="list" position="60,30" size="350,660" scrollbarMode="showNever" transparent="1" zPosition="2"/>
345 <screen flags="wfNoBorder" position="-20,0" size="450,576" title="Easy Media">
346 #<ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyMedia/bg.png" position="0,0" size="450,576"/>
347 <widget name="list" position="70,48" size="320,480" scrollbarMode="showNever" transparent="1" zPosition="2"/>
351 <screen position="center,center" size="320,440" title="Easy Media">
352 <widget name="list" position="10,10" size="300,420" scrollbarMode="showOnDemand" />
354 if pathExists('/usr/lib/enigma2/python/Plugins/Extensions/EasyMedia/icons/'):
355 EMiconspath = '/usr/lib/enigma2/python/Plugins/Extensions/EasyMedia/icons/'
357 EMiconspath = '/usr/lib/enigma2/python/Plugins/Extensions/EasyMedia/'
358 def __init__(self, session):
359 Screen.__init__(self, session)
360 self.session = session
364 self["key_pvr"] = StaticText(" ")
365 self["key_yellow"] = StaticText(" ")
366 self["key_green"] = StaticText(" ")
367 self["key_red"] = StaticText(" ")
368 self["key_blue"] = StaticText(" ")
370 self.__keys.append("movies")
371 MPaskList.append((_("Movies"), "PLAYMOVIES"))
372 if config.plugins.easyMedia.bookmarks.value != "no":
373 self.__keys.append("bookmarks")
374 MPaskList.append((_("Bookmarks"), "BOOKMARKS"))
375 if config.plugins.easyMedia.timers.value != "no":
376 self.__keys.append("timers")
377 MPaskList.append((_("Timer"), "TIMERS"))
378 if config.plugins.easyMedia.videodb.value != "no":
379 self.__keys.append("videodb")
380 MPaskList.append((_("VideoDB"), "VIDEODB"))
381 if config.plugins.easyMedia.pictures.value != "no":
382 self.__keys.append("pictures")
383 MPaskList.append((_("Pictures"), "PICTURES"))
384 if config.plugins.easyMedia.music.value != "no":
385 self.__keys.append("music")
386 MPaskList.append((_("Music"), "MUSIC"))
387 if config.plugins.easyMedia.radio.value != "no":
388 self.__keys.append("radio")
389 if config.usage.e1like_radio_mode.value:
390 MPaskList.append((_("Tv/Radio"), "RADIO"))
392 MPaskList.append((_("Radio"), "RADIO"))
393 if config.plugins.easyMedia.dvd.value != "no":
394 self.__keys.append("dvd")
395 MPaskList.append((_("DVD Player"), "DVD"))
396 if config.plugins.easyMedia.weather.value != "no":
397 self.__keys.append("weather")
398 MPaskList.append((_("Weather"), "WEATHER"))
399 if config.plugins.easyMedia.files.value != "no":
400 self.__keys.append("files")
401 MPaskList.append((_("Files"), "FILES"))
402 if config.plugins.easyMedia.iradio.value != "no":
403 self.__keys.append("internetradio")
404 MPaskList.append((_("InternetRadio"), "INTERNETRADIO"))
405 if config.plugins.easyMedia.idream.value != "no":
406 self.__keys.append("idream")
407 MPaskList.append((_("iDream"), "IDREAM"))
408 if config.plugins.easyMedia.mytube.value != "no":
409 self.__keys.append("mytube")
410 MPaskList.append((_("MyTube Player"), "MYTUBE"))
411 if config.plugins.easyMedia.vlc.value != "no":
412 self.__keys.append("vlc")
413 MPaskList.append((_("VLC Player"), "VLC"))
414 if config.plugins.easyMedia.zdfmedia.value != "no":
415 self.__keys.append("zdf")
416 MPaskList.append((_("ZDFmediathek"), "ZDF"))
417 if config.plugins.easyMedia.myvideo.value != "no":
418 self.__keys.append("myvideo")
419 MPaskList.append((_("MyVideo"), "MYVIDEO"))
420 plist = os_listdir("/usr/lib/enigma2/python/Plugins/Extensions/EasyMedia")
421 plist = [x[:-5] for x in plist if x.endswith('.plug')]
423 for onePlug in plist:
425 inpf = open(("/usr/lib/enigma2/python/Plugins/Extensions/EasyMedia/" + onePlug + ".plug"), 'rb')
426 binPlug = pickle.load(inpf)
428 self.__keys.append(binPlug.name)
429 MPaskList.append((binPlug.name, ("++++" + binPlug.name)))
433 strpos = str(self.__keys[pos])
434 self.list.append(MPanelEntryComponent(key = strpos, text = x, cell = pos))
435 if pos==0: self["key_pvr"].setText(MPaskList[0][0])
436 elif pos==1: self["key_red"].setText(MPaskList[1][0])
437 elif pos==2: self["key_green"].setText(MPaskList[2][0])
438 elif pos==3: self["key_yellow"].setText(MPaskList[3][0])
439 elif pos==4: self["key_blue"].setText(MPaskList[4][0])
441 self["list"] = MPanelList(list = self.list, selection = 0)
442 self["list"].onSelectionChanged.append(self.updateOLED)
443 self["actions"] = ActionMap(["WizardActions", "MenuActions", "InfobarActions", "ColorActions"],
447 "menu": self.emContextMenu,
448 "showMovies": lambda: self.go2(MPaskList,0),
449 "green": lambda: self.go2(MPaskList,2),
450 "red": lambda: self.go2(MPaskList,1),
451 "blue": lambda: self.go2(MPaskList,4),
452 "yellow": lambda: self.go2(MPaskList,3)
459 cursel = self["list"].l.getCurrentSelection()
461 self.goEntry(cursel[0])
465 def go2(self, was, wohin):
467 self.close(was[wohin])
470 self.close(was[wohin])
473 self.close(was[wohin])
476 self.close(was[wohin])
479 self.close(was[wohin])
481 def goEntry(self, entry):
482 if len(entry) > 2 and isinstance(entry[1], str) and entry[1] == "CALLFUNC":
483 arg = self["list"].l.getCurrentSelection()[0]
488 def emContextMenu(self):
489 self.session.open(ConfigEasyMedia)
491 def createSummary(self):
492 return EasyMediaSummary
494 def updateOLED(self):
495 text = str(self["list"].l.getCurrentSelection()[0][0])
496 self.summaries.setText(text, 1)
500 def MPcallbackFunc(answer):
501 if EMsession is None:
503 answer = answer and answer[1]
504 if answer == "PLAYMOVIES":
506 InfoBar_instance.showMovies()
507 elif answer == "RADIO":
508 if config.usage.e1like_radio_mode.value:
510 askBM.append((_("TV-mode"), "TM"))
511 askBM.append((_("Radio-mode"), "RM"))
512 askBM.append((_("Nothing"), "NO"))
513 EMsession.openWithCallback(TvRadioCallback, ChoiceBox, title="EasyMedia...", list = askBM)
516 InfoBar_instance.showRadio()
517 elif answer == "BOOKMARKS":
518 tmpBookmarks = config.movielist.videodirs
519 myBookmarks = tmpBookmarks and tmpBookmarks.value[:] or []
520 if len(myBookmarks)>0:
522 for s in myBookmarks:
524 EMsession.openWithCallback(BookmarksCallback, ChoiceBox, title=_("Select bookmark..."), list = askBM)
525 elif answer == "PICTURES":
526 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/PicturePlayer/plugin.pyo"):
527 from Plugins.Extensions.PicturePlayer.plugin import picshow
528 EMsession.open(picshow)
530 EMsession.open(MessageBox, text = _('Picture-player is not installed!'), type = MessageBox.TYPE_ERROR)
531 elif answer == "MUSIC":
532 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/MerlinMusicPlayer/plugin.pyo") and (config.plugins.easyMedia.music.value == "merlinmp"):
533 from Plugins.Extensions.MerlinMusicPlayer.plugin import MerlinMusicPlayerFileList
535 EMsession.open(MerlinMusicPlayerFileList, servicelist)
536 elif fileExists("/usr/lib/enigma2/python/Plugins/Extensions/MediaPlayer/plugin.pyo") and (config.plugins.easyMedia.music.value == "mediaplayer"):
537 from Plugins.Extensions.MediaPlayer.plugin import MediaPlayer
538 EMsession.open(MediaPlayer)
540 EMsession.open(MessageBox, text = _('No Music-Player installed!'), type = MessageBox.TYPE_ERROR)
541 elif answer == "FILES":
542 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/Tuxcom/plugin.pyo") and (config.plugins.easyMedia.files.value == "tuxcom"):
543 from Plugins.Extensions.Tuxcom.plugin import TuxComStarter
544 EMsession.open(TuxComStarter)
545 elif fileExists("/usr/lib/enigma2/python/Plugins/Extensions/DreamExplorer/plugin.pyo") and (config.plugins.easyMedia.files.value == "dreamexplorer"):
546 from Plugins.Extensions.DreamExplorer.plugin import DreamExplorerII
547 EMsession.open(DreamExplorerII)
548 elif fileExists("/usr/lib/enigma2/python/Plugins/Extensions/Filebrowser/plugin.pyo") and (config.plugins.easyMedia.files.value == "filebrowser"):
549 from Plugins.Extensions.Filebrowser.plugin import FilebrowserScreen
550 EMsession.open(FilebrowserScreen)
552 EMsession.open(MessageBox, text = _('No File-Manager installed!'), type = MessageBox.TYPE_ERROR)
553 elif answer == "WEATHER":
554 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/WeatherPlugin/plugin.pyo"):
555 from Plugins.Extensions.WeatherPlugin.plugin import MSNWeatherPlugin
556 EMsession.open(MSNWeatherPlugin)
558 EMsession.open(MessageBox, text = _('Weather Plugin is not installed!'), type = MessageBox.TYPE_ERROR)
559 elif answer == "DVD":
560 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/DVDPlayer/plugin.pyo"):
561 from Plugins.Extensions.DVDPlayer.plugin import DVDPlayer
562 EMsession.open(DVDPlayer)
564 EMsession.open(MessageBox, text = _('DVDPlayer Plugin is not installed!'), type = MessageBox.TYPE_ERROR)
565 elif answer == "MYTUBE":
566 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/MyTube/plugin.pyo"):
567 from Plugins.Extensions.MyTube.plugin import *
568 MyTubeMain(EMsession)
570 EMsession.open(MessageBox, text = _('MyTube Plugin is not installed!'), type = MessageBox.TYPE_ERROR)
571 elif answer == "INTERNETRADIO":
572 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/InternetRadio/plugin.pyo"):
573 from Plugins.Extensions.InternetRadio.InternetRadioScreen import InternetRadioScreen
574 EMsession.open(InternetRadioScreen)
576 EMsession.open(MessageBox, text = _('SHOUTcast Plugin is not installed!'), type = MessageBox.TYPE_ERROR)
577 elif answer == "ZDF":
578 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/ZDFMediathek/plugin.pyo"):
579 from Plugins.Extensions.ZDFMediathek.plugin import ZDFMediathek
580 EMsession.open(ZDFMediathek)
582 EMsession.open(MessageBox, text = _('ZDFmediathek Plugin is not installed!'), type = MessageBox.TYPE_ERROR)
583 elif answer == "VLC":
584 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/VlcPlayer/plugin.pyo"):
585 from Plugins.Extensions.VlcPlayer.plugin import *
588 EMsession.open(MessageBox, text = _('VLC Player is not installed!'), type = MessageBox.TYPE_ERROR)
589 elif answer == "IDREAM":
590 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/MerlinMusicPlayer/plugin.pyo"):
591 from Plugins.Extensions.MerlinMusicPlayer.plugin import iDreamMerlin
593 EMsession.open(iDreamMerlin, servicelist)
595 EMsession.open(MessageBox, text = _('Merlin iDream is not installed!'), type = MessageBox.TYPE_ERROR)
596 elif answer == "MYVIDEO":
597 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/MyVideoPlayer/plugin.pyo"):
598 from Plugins.Extensions.MyVideoPlayer.plugin import Vidtype
599 EMsession.open(Vidtype)
601 EMsession.open(MessageBox, text = _('MyVideo Player is not installed!'), type = MessageBox.TYPE_ERROR)
602 elif answer == "VIDEODB":
603 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/VideoDB/plugin.pyo"):
604 from Plugins.Extensions.VideoDB.plugin import main as vdbmain
607 EMsession.open(MessageBox, text = _('VideoDB is not installed!'), type = MessageBox.TYPE_ERROR)
608 elif answer == "TIMERS":
609 from Screens.TimerEdit import TimerEditList
610 EMsession.open(TimerEditList)
611 elif answer is not None and "++++" in answer:
612 plugToRun = answer[4:]
614 inpf = open(("/usr/lib/enigma2/python/Plugins/Extensions/EasyMedia/" + plugToRun + ".plug"), 'rb')
615 runPlug = pickle.load(inpf)
617 runPlug(session = EMsession)
618 except: EMsession.open(MessageBox, text = (plugToRun + " not found!"), type = MessageBox.TYPE_WARNING)