import re

class PlatformDetector(object):
    def __init__(self):
        self.rawinfo = []


    def getCPUInfo(self):
        self.rawinfo = self.readCPUInfo()
        info = {}
        info['numCores'] = self.parseNumCores()
        info['vendorID'] = self.parseCPUInfo('vendor_id')
        info['model'] = int(self.parseCPUInfo('model'))
        info['cpuFamily'] = int(self.parseCPUInfo('cpu family'))
        info['cacheSize'] = int(self.parseCPUInfo('cache size'))
        info['capabilities'] = self.parseCapabilities()
        return info

    def parseCapabilities(self):
        matcher = re.compile("flags\s+:")
        for line in self.rawinfo:
            if re.match(matcher, line):
                return line.split(":")[1].split(" ")
    
        
    def parseNumCores(self):
        matcher = re.compile("processor\s+:")
        count = 0
        for line in self.rawinfo:
            if re.match(matcher, line):
                count +=1
        return count
        
    def parseCPUInfo(self, item):
        matcher = re.compile(item +"\s+:\s*(\w+)")
        for line in self.rawinfo:
            if re.match(matcher, line):
                return re.match(matcher, line).group(1)
        
    def readCPUInfo(self):
        pass

@@ -1245,9 +1245,50 @@
     
-pass
+return open(%22/proc/cpuinfo%22, %22r%22).readlines()
 %0A

implement reading /proc/cpuinfo