X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FPlugins%2FSystemPlugins%2FNFIFlash%2Fplugin.py;h=1eba1dd4004fbd337b4dce14fdaa4dc6b206e2ae;hp=0394d81bf2969215b176ba706878ef829311ce87;hb=91ad4707b3a64d8d166e0c1976977ba85ea29a70;hpb=2ca2437ed16a3676fea816e2061aefb69ccf047d diff --git a/lib/python/Plugins/SystemPlugins/NFIFlash/plugin.py b/lib/python/Plugins/SystemPlugins/NFIFlash/plugin.py old mode 100644 new mode 100755 index 0394d81..1eba1dd --- a/lib/python/Plugins/SystemPlugins/NFIFlash/plugin.py +++ b/lib/python/Plugins/SystemPlugins/NFIFlash/plugin.py @@ -1,20 +1,25 @@ -# -*- coding: utf8 -*- +from Plugins.Plugin import PluginDescriptor +from Tools.HardwareInfo import HardwareInfo +from Tools.Directories import fileExists +from downloader import NFIDownload, filescan +from flasher import NFIFlash + +def NFIFlasherMain(session, tmp = None, **kwargs): + session.open(NFIDownload, "/home/root" ) + +def NFICallFnc(tmp = None): + return NFIFlasherMain def Plugins(**kwargs): - from Plugins.Plugin import PluginDescriptor - from Tools.Directories import fileExists - if fileExists("/usr/share/bootlogo-flasher.mvi"): - import flasher - # started from usb stick # don't try to be intelligent and trick this - it's not possible to rewrite the flash memory with a system currently booted from it - return [PluginDescriptor(where = PluginDescriptor.WHERE_WIZARD, fnc = (9,flasher.NFIFlash))] - else: - # started on real enigma2 - import downloader - return [PluginDescriptor(name="NFI Image Flashing", - description = _("Download .NFI-Files for USB-Flasher"), - icon = "flash.png", - where = [PluginDescriptor.WHERE_PLUGINMENU], - fnc = downloader.main), PluginDescriptor(name="nfi", where = PluginDescriptor.WHERE_FILESCAN, fnc = downloader.filescan) - ] - #, - #PluginDescriptor(name="nfi", where = PluginDescriptor.WHERE_WIZARD, fnc = (1,downloader.NFIDownload)) ] + # currently only available for DM8000 + if HardwareInfo().get_device_name() != "dm8000": + return [PluginDescriptor()] + #return [PluginDescriptor(where = PluginDescriptor.WHERE_WIZARD, fnc = (9,NFIFlash))] + # it's not possible to rewrite the flash memory with a system currently booted from it + return [PluginDescriptor(name=_("NFI Image Flashing"), + description=_("Download .NFI-Files for USB-Flasher"), + icon = "flash.png", + where = PluginDescriptor.WHERE_SOFTWAREMANAGER, + fnc={"SoftwareSupported": NFICallFnc, "menuEntryName": lambda x: _("NFI Image Flashing"), + "menuEntryDescription": lambda x: _("Download .NFI-Files for USB-Flasher")}), + PluginDescriptor(name="nfi", where = PluginDescriptor.WHERE_FILESCAN, fnc = filescan)]