From: Michael Tremer Date: Tue, 23 Nov 2010 21:52:53 +0000 (+0100) Subject: Replace information ino CPU class from /proc/cpuinfo. X-Git-Tag: v0.2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2a02693e25a9ad837a3c3cedb7f01d481cafdef;p=oddments%2Ffireinfo.git Replace information ino CPU class from /proc/cpuinfo. New property: model_string. --- diff --git a/fireinfo/cpu.py b/fireinfo/cpu.py index 66eaff6..fad7810 100644 --- a/fireinfo/cpu.py +++ b/fireinfo/cpu.py @@ -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