1 from Screens.Screen import Screen
2 from Components.ActionMap import ActionMap
3 from Components.Label import Label
4 from Plugins.Plugin import PluginDescriptor
6 def getUpgradeVersion():
9 r = os.popen("fpupgrade --version").read()
12 if r[:16] != "FP update tool v":
17 class FPUpgrade(Screen):
19 <screen position="150,200" size="450,200" title="FP upgrade required" >
20 <widget name="text" position="0,0" size="550,50" font="Regular;20" />
21 <widget name="oldversion_label" position="10,100" size="290,25" font="Regular;20" />
22 <widget name="newversion_label" position="10,125" size="290,25" font="Regular;20" />
23 <widget name="oldversion" position="300,100" size="50,25" font="Regular;20" />
24 <widget name="newversion" position="300,125" size="50,25" font="Regular;20" />
26 def __init__(self, session):
27 self.skin = FPUpgrade.skin
28 Screen.__init__(self, session)
30 from Tools.DreamboxHardware import getFPVersion
31 version = str(getFPVersion() or "N/A")
32 newversion = str(getUpgradeVersion() or "N/A")
34 self["text"] = Label(_("Your frontprocessor firmware must be upgraded.\nPress OK to start upgrade."))
35 self["oldversion_label"] = Label(_("Current version:"))
36 self["newversion_label"] = Label(_("New version:"))
38 self["oldversion"] = Label(version)
39 self["newversion"] = Label(newversion)
41 self["actions"] = ActionMap(["OkCancelActions"],
50 class SystemMessage(Screen):
52 <screen position="150,200" size="450,200" title="System Message" >
53 <widget source="text" position="0,0" size="450,200" font="Regular;20" halign="center" valign="center" render="Label" />
54 <ePixmap pixmap="skin_default/icons/input_error.png" position="5,5" size="53,53" alphatest="on" />
56 def __init__(self, session, message):
57 from Components.Sources.StaticText import StaticText
59 Screen.__init__(self, session)
61 self["text"] = StaticText(message)
63 self["actions"] = ActionMap(["OkCancelActions"],
71 def Plugins(**kwargs):
72 from Tools.DreamboxHardware import getFPVersion
73 from Screens.MessageBox import MessageBox
75 version = getFPVersion()
76 newversion = getUpgradeVersion() or 0
78 if version is not None and version < newversion:
79 list.append(PluginDescriptor(name="FP Upgrade", where = PluginDescriptor.WHERE_WIZARD, fnc=(8, FPUpgrade)))
82 msg = open("/proc/stb/message").read()
83 list.append(PluginDescriptor(name="System Message Check", where = PluginDescriptor.WHERE_WIZARD, fnc=(9, SystemMessage, msg)))