From 3e4556706ac4c42b68594be8477fb204cd5ff0e9 Mon Sep 17 00:00:00 2001 From: Mladen Horvat Date: Mon, 7 Dec 2009 14:12:14 +0100 Subject: [PATCH] NFIFlash/plugin.py: move NFI Flash Utility inside Softwaremanager. This fixes #308 --- .../Plugins/SystemPlugins/NFIFlash/plugin.py | 26 ++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) mode change 100644 => 100755 lib/python/Plugins/SystemPlugins/NFIFlash/plugin.py 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 40914e1..28b3330 --- a/lib/python/Plugins/SystemPlugins/NFIFlash/plugin.py +++ b/lib/python/Plugins/SystemPlugins/NFIFlash/plugin.py @@ -1,20 +1,28 @@ +from Plugins.Plugin import PluginDescriptor +from Tools.HardwareInfo import HardwareInfo +from Tools.Directories import fileExists +from downloader import NFIDownload, filescan + +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.HardwareInfo import HardwareInfo # currently only available for DM8000 if HardwareInfo().get_device_name() != "dm8000": return [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"), + 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) - ] + 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)] -- 2.7.4