make model detection optional
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Mon, 7 Jul 2008 10:37:26 +0000 (10:37 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Mon, 7 Jul 2008 10:37:26 +0000 (10:37 +0000)
lib/python/Tools/HardwareInfo.py

index 38cccb5..f426d18 100644 (file)
@@ -1,10 +1,17 @@
 class HardwareInfo:
        def __init__(self):
                self.device = "unknown"
-               file = open("/proc/stb/info/model", "r")
-               self.device = file.readline().strip()
+               try:
+                       file = open("/proc/stb/info/model", "r")
+                       self.device = file.readline().strip()
+                       file.close()
+               except:
+                       print "----------------"
+                       print "you should upgrade to new drivers for the hardware detection to work properly"
+                       print "----------------"
                
        def get_device_name(self):
                return self.device
        
-       device_name = property(get_device_name)
\ No newline at end of file
+       device_name = property(get_device_name)
+