projects
/
vuplus_dvbapp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib/python/Tools/HardwareInfo.py: remove debug output
[vuplus_dvbapp]
/
lib
/
python
/
Tools
/
HardwareInfo.py
diff --git
a/lib/python/Tools/HardwareInfo.py
b/lib/python/Tools/HardwareInfo.py
index
f5c4534
..
e72d291
100644
(file)
--- a/
lib/python/Tools/HardwareInfo.py
+++ b/
lib/python/Tools/HardwareInfo.py
@@
-1,9
+1,15
@@
class HardwareInfo:
class HardwareInfo:
+ device_name = None
+
def __init__(self):
def __init__(self):
- self.device = "unknown"
+ if HardwareInfo.device_name is not None:
+# print "using cached result"
+ return
+
+ HardwareInfo.device_name = "unknown"
try:
file = open("/proc/stb/info/model", "r")
try:
file = open("/proc/stb/info/model", "r")
-
self.devic
e = file.readline().strip()
+
HardwareInfo.device_nam
e = file.readline().strip()
file.close()
except:
print "----------------"
file.close()
except:
print "----------------"
@@
-12,20
+18,17
@@
class HardwareInfo:
print "fallback to detect hardware via /proc/cpuinfo!!"
try:
rd = open("/proc/cpuinfo", "r").read()
print "fallback to detect hardware via /proc/cpuinfo!!"
try:
rd = open("/proc/cpuinfo", "r").read()
- if rd.find("Brcm4380 V4.2") !=
0
:
-
self.devic
e = "dm8000"
+ if rd.find("Brcm4380 V4.2") !=
-1
:
+
HardwareInfo.device_nam
e = "dm8000"
print "dm8000 detected!"
print "dm8000 detected!"
- elif rd.find("Brcm7401 V0.0") !=
0
:
-
self.devic
e = "dm800"
+ elif rd.find("Brcm7401 V0.0") !=
-1
:
+
HardwareInfo.device_nam
e = "dm800"
print "dm800 detected!"
print "dm800 detected!"
- elif rd.find("MIPS 4KEc V4.8") !=
0
:
-
self.devic
e = "dm7025"
+ elif rd.find("MIPS 4KEc V4.8") !=
-1
:
+
HardwareInfo.device_nam
e = "dm7025"
print "dm7025 detected!"
except:
pass
def get_device_name(self):
print "dm7025 detected!"
except:
pass
def get_device_name(self):
- return self.device
-
- device_name = property(get_device_name)
-
+ return HardwareInfo.device_name