display front processor version in about screen
authorFelix Domke <tmbinc@elitedvb.net>
Tue, 21 Feb 2006 17:42:17 +0000 (17:42 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Tue, 21 Feb 2006 17:42:17 +0000 (17:42 +0000)
lib/python/Screens/About.py
lib/python/Tools/DreamboxHardware.py [new file with mode: 0644]
lib/python/Tools/Makefile.am
lib/python/Tools/__init__.py

index 5bd5f27..7e93aa0 100644 (file)
@@ -6,6 +6,8 @@ from Components.NimManager import nimmanager
 from Components.MenuList import MenuList
 from Components.About import about
 
+from Tools.DreamboxHardware import getFPVersion
+
 class About(Screen):
        def __init__(self, session):
                Screen.__init__(self, session)
@@ -13,6 +15,14 @@ class About(Screen):
                self["text"] = Label("Enigma v" + about.getVersionString())
 
                self["tuner"] = Label(_("Detected NIMs:"))
+
+               fp_version = getFPVersion()
+               if fp_version is None:
+                       fp_version = ""
+               else:
+                       fp_version = _("Frontprocessor version: %d") % fp_version
+               
+               self["fpVersion"] = Label(fp_version)
                
                nims = nimmanager.nimList()
                count = 0
@@ -32,4 +42,3 @@ class About(Screen):
                                "cancel": self.close,
                                "ok": self.close,
                        })
-       
\ No newline at end of file
diff --git a/lib/python/Tools/DreamboxHardware.py b/lib/python/Tools/DreamboxHardware.py
new file mode 100644 (file)
index 0000000..4f873e9
--- /dev/null
@@ -0,0 +1,7 @@
+def getFPVersion():
+       from fcntl import ioctl
+       try:
+               fp = open("/dev/dbox/fp0")
+               return ioctl(fp.fileno(),0)
+       except IOError:
+               return None
index f1fc936..a2160d8 100644 (file)
@@ -3,4 +3,5 @@ installdir = $(LIBDIR)/enigma2/python/Tools
 install_DATA = \
        FuzzyDate.py XMLTools.py Directories.py NumericalTextInput.py \
        KeyBindings.py BoundFunction.py ISO639.py Notifications.py __init__.py \
-       RedirectOutput.py
+       RedirectOutput.py DreamboxHardware.py
+
index 16205a5..a79bb10 100644 (file)
@@ -1,2 +1,2 @@
 all = ["FuzzyDate.py", "XMLTools.py", "Directories.py", "KeyBindings.py", "BoundFunction.py", "ISO639.py", "Notifications",
-       "RedirectOutput.py"]
+       "RedirectOutput.py", "DreamboxHardware.py"]