Merge remote branch 'origin/pootle-import'
[enigma2.git] / lib / python / Plugins / SystemPlugins / NFIFlash / plugin.py
1 from Plugins.Plugin import PluginDescriptor
2 from Tools.HardwareInfo import HardwareInfo
3 from Tools.Directories import fileExists
4 from downloader import NFIDownload, filescan
5 from flasher import NFIFlash
6
7 def NFIFlasherMain(session, tmp = None, **kwargs):
8         session.open(NFIDownload, "/home/root" )
9
10 def NFICallFnc(tmp = None):
11         return NFIFlasherMain
12
13 def Plugins(**kwargs):
14         # currently only available for DM8000
15         if HardwareInfo().get_device_name() != "dm8000":
16                 return [PluginDescriptor()]
17         #return [PluginDescriptor(where = PluginDescriptor.WHERE_WIZARD, fnc = (9,NFIFlash))]
18                 # it's not possible to rewrite the flash memory with a system currently booted from it
19         return [PluginDescriptor(name=_("NFI Image Flashing"),
20                 description=_("Download .NFI-Files for USB-Flasher"),
21                 icon = "flash.png",
22                 where = PluginDescriptor.WHERE_SOFTWAREMANAGER,
23                 needsRestart = False,
24                 fnc={"SoftwareSupported": NFICallFnc, "menuEntryName": lambda x: _("NFI Image Flashing"),
25                         "menuEntryDescription": lambda x: _("Download .NFI-Files for USB-Flasher")}),
26                 PluginDescriptor(name="nfi", where = PluginDescriptor.WHERE_FILESCAN, needsRestart = False, fnc = filescan)]