]> git.ipfire.org Git - oddments/fireinfo.git/commitdiff
Replace information ino CPU class from /proc/cpuinfo.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 23 Nov 2010 21:52:53 +0000 (22:52 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 23 Nov 2010 21:52:53 +0000 (22:52 +0100)
New property: model_string.

fireinfo/cpu.py

index 66eaff6610dd1e38e7c126c775065a4d1c23c1be..fad78104c2626f750c3c3d3f3991105ccbe0be25 100644 (file)
@@ -37,23 +37,27 @@ class CPU(object):
 
        @property
        def bogomips(self):
-               return float(self.__info["bogomips"])
+               return float(self.__cpuinfo["bogomips"])
 
        @property
        def model(self):
-               return int(self.__info["model"])
+               return int(self.__cpuinfo["model"])
+
+       @property
+       def model_string(self):
+               return self.__cpuinfo["model_name"]
 
        @property
        def vendor(self):
-               return self.__info["vendor"]
+               return self.__cpuinfo["vendor_id"]
 
        @property
        def stepping(self):
-               return int(self.__info["stepping"])
+               return int(self.__cpuinfo["stepping"])
 
        @property
        def flags(self):
-               return self.__info["flags"].split()
+               return self.__cpuinfo["flags"].split()
 
        @property
        def speed(self):
@@ -74,7 +78,7 @@ class CPU(object):
        
        @property
        def family(self):
-               return int(self.__info["family"])
+               return int(self.__cpuinfo["cpu_family"])
        
        @property
        def count(self):
@@ -96,3 +100,4 @@ if __name__ == "__main__":
        print "Virtype:", c.virtype
        print "Family:", c.family
        print "Count:", c.count
+       print "Model string:", c.model_string