from twisted.web.client import downloadPage
from enigma import ePicLoad
from Screens.Screen import Screen
+from Screens.EpgSelection import EPGSelection
from Components.ActionMap import ActionMap
from Components.Pixmap import Pixmap
from Components.Label import Label
import htmlentitydefs
import urllib
+class IMDBEPGSelection(EPGSelection):
+ def __init__(self, *args):
+ EPGSelection.__init__(self, *args)
+ self.skinName = "EPGSelection"
+ self["key_green"].setText(_("Lookup"))
+
+ def infoKeyPressed(self):
+ self.timerAdd()
+
+ def timerAdd(self):
+ cur = self["list"].getCurrent()
+ evt = cur[0]
+ sref = cur[1]
+ if not evt:
+ return
+
+ self.session.open(
+ IMDB,
+ evt.getEventName()
+ )
+
+ def onSelectionChanged(self):
+ pass
+
class IMDB(Screen):
skin = """
<screen name="IMDB" position="90,95" size="560,420" title="Internet Movie Database Details Plugin" >
Screen.__init__(self, session)
self["headline"] = Label("IMDB Plugin")
+def eventinfo(session, servicelist, **kwargs):
+ ref = session.nav.getCurrentlyPlayingServiceReference()
+ session.open(IMDBEPGSelection, ref)
+
def main(session, eventName="", **kwargs):
session.open(IMDB, eventName)
def Plugins(**kwargs):
try:
- wherelist = [PluginDescriptor.WHERE_EVENTINFO, PluginDescriptor.WHERE_PLUGINMENU]
- return PluginDescriptor(name="IMDb Details",
+ return [PluginDescriptor(name="IMDb Details",
description=_("Query details from the Internet Movie Database"),
icon="imdb.png",
- where = wherelist,
- fnc=main)
+ where = PluginDescriptor.WHERE_PLUGINMENU,
+ fnc = main),
+ PluginDescriptor(name="IMDb Details",
+ description=_("Query details from the Internet Movie Database"),
+ where = PluginDescriptor.WHERE_EVENTINFO,
+ fnc = eventinfo)
+ ]
except AttributeError:
wherelist = [PluginDescriptor.WHERE_EXTENSIONSMENU, PluginDescriptor.WHERE_PLUGINMENU]
return PluginDescriptor(name="IMDb Details",
description=_("Query details from the Internet Movie Database"),
icon="imdb.png",
where = wherelist,
- fnc=main)
\ No newline at end of file
+ fnc=main)
from twisted.web.client import downloadPage
from enigma import ePicLoad
from Screens.Screen import Screen
+from Screens.EpgSelection import EPGSelection
from Components.ActionMap import ActionMap
from Components.Pixmap import Pixmap
from Components.Label import Label
import htmlentitydefs
import urllib
+class OFDBEPGSelection(EPGSelection):
+ def __init__(self, *args):
+ EPGSelection.__init__(self, *args)
+ self.skinName = "EPGSelection"
+ self["key_green"].setText(_("Lookup"))
+
+ def infoKeyPressed(self):
+ self.timerAdd()
+
+ def timerAdd(self):
+ cur = self["list"].getCurrent()
+ evt = cur[0]
+ sref = cur[1]
+ if not evt:
+ return
+
+ self.session.open(
+ OFDB,
+ evt.getEventName()
+ )
+
+ def onSelectionChanged(self):
+ pass
+
class OFDB(Screen):
skin = """
<screen name="OFDb" position="90,95" size="560,420" title="Internet Movie Database Details Plugin" >
Screen.__init__(self, session)
self["headline"] = Label("OFDb Plugin")
+def eventinfo(session, servicelist, **kwargs):
+ ref = session.nav.getCurrentlyPlayingServiceReference()
+ session.open(OFDBEPGSelection, ref)
+
def main(session, eventName="", **kwargs):
session.open(OFDB, eventName)
def Plugins(**kwargs):
try:
- wherelist = [PluginDescriptor.WHERE_EVENTINFO, PluginDescriptor.WHERE_PLUGINMENU]
- return PluginDescriptor(name="OFDb Details",
- description=_("Query details from the Online-Filmdatenbank"),
- icon="ofdb.png",
- where = wherelist,
- fnc=main)
+ return [PluginDescriptor(name = "OFDb Details",
+ description = _("Query details from the Online-Filmdatenbank"),
+ icon = "ofdb.png",
+ where = PluginDescriptor.WHERE_PLUGINMENU,
+ fnc = main),
+ PluginDescriptor(name = "OFDb Details",
+ description = _("Query details from the Online-Filmdatenbank"),
+ where = PluginDescriptor.WHERE_EVENTINFO,
+ fnc = eventinfo)
+ ]
except AttributeError:
wherelist = [PluginDescriptor.WHERE_EXTENSIONSMENU, PluginDescriptor.WHERE_PLUGINMENU]
return PluginDescriptor(name="OFDb Details",