'''
Read data from dataset. Check for unknown tags, CPU model & OS version. Append them to config file
'''
__author__ = 'Dilum Bandara'
__version__ = "0.1"
__date__ = "04/26/2010"
__modified__ = "05/29/2012"
__license__ = 'Python'
__copyright__ = "Copyright (c) 2010 Dilum Bandara"

import re

class CPU_OS():
    #append 'T' to indicate tag in varaiable name
    def __init__(self):
        pass

    def convertCPU(self, name):
        if 'Intel(R) Xeon(TM) ' in name or 'Intel(R) Xeon(R) CPU' in name or 'Intel(R) XEON(TM) ' in name:
            cpu_list = ['Xeon', 'x86', '32', '-1']
            if 'GHz' in name:            
                cpu_list[3] = name[name.index('GHz')- 4: name.index('GHz')]
            elif 'MHz' in name:            
                cpu_list[3] = str(int(name[name.index('MHz')- 4: name.index('MHz')])/1000.0)
            return cpu_list
        elif 'AMD Athlon(tm) II' in name:
            cpu_list = ['Athlon II', 'x86', '64', '-1']
            if 'M300' in name:
                cpu_list[3] = '2.0'
            elif 'M320' in name:
                cpu_list[3] = '2.1'
            elif '215' in name:
                cpu_list[3] = '2.7'
            elif '235' in name:
                cpu_list[3] = '2.7'
            elif '240' in name:
                cpu_list[3] = '2.8'
            elif '245' in name:
                cpu_list[3] = '2.9'
            elif '250' in name:
                cpu_list[3] = '3.0'
            elif '425' in name:
                cpu_list[3] = '2.7'
            elif '620' in name:
                cpu_list[3] = '2.6'
            elif '630' in name:
                cpu_list[3] = '2.8'
            return cpu_list
        elif 'AMD Phenom(tm)' in name:
            cpu_list = ['Phenom', 'x86', '64', '-1']
            if '1055T' in name:
                cpu_list[3] = '2.8'
            elif '1090T' in name:
                cpu_list[3] = '3.2'
            elif 'M300' in name:
                cpu_list[3] = '2.0'
            elif '215' in name:
                cpu_list[3] = '2.7'
            elif '235' in name:
                cpu_list[3] = '2.7'
            elif '240' in name:
                cpu_list[3] = '2.8'
            elif '245' in name:
                cpu_list[3] = '2.9'
            elif '250' in name:
                cpu_list[3] = '3.0'
            elif '250u' in name:
                cpu_list[3] = '1.8'
            elif '255' in name:
                cpu_list[3] = '3.1'
            elif '260' in name:
                cpu_list[3] = '1.8'
            elif '400' in name:
                cpu_list[3] = '2.2'
            elif '405' in name:
                cpu_list[3] = '2.3'
            elif '425' in name:
                cpu_list[3] = '2.7'
            elif '435' in name:
                cpu_list[3] = '2.9'
            elif '440' in name:
                cpu_list[3] = '3.0'
            elif '545' in name:
                cpu_list[3] = '3.0'
            elif '550' in name:
                cpu_list[3] = '3.1'
            elif '555' in name:
                cpu_list[3] = '3.2'
            elif '600e' in name:
                cpu_list[3] = '2.2'
            elif '605e' in name:
                cpu_list[3] = '2.3'
            elif '620' in name:
                cpu_list[3] = '2.6'
            elif '630' in name:
                cpu_list[3] = '2.8'
            elif '635' in name:
                cpu_list[3] = '2.9'
            elif '700e' in name:
                cpu_list[3] = '2.4'
            elif '705e' in name:
                cpu_list[3] = '2.5'
            elif '710' in name:
                cpu_list[3] = '2.6'
            elif '720' in name:
                cpu_list[3] = '2.8'
            elif '805' in name:
                cpu_list[3] = '2.5'
            elif '810' in name:
                cpu_list[3] = '2.6'
            elif '820' in name:
                cpu_list[3] = '2.8'
            elif '900e' in name:
                cpu_list[3] = '2.4'
            elif '905e' in name:
                cpu_list[3] = '2.5'
            elif '910' in name:
                cpu_list[3] = '2.6'
            elif '920' in name:
                cpu_list[3] = '2.8'
            elif '925' in name:
                cpu_list[3] = '2.8'
            elif '940' in name:
                cpu_list[3] = '3.0'
            elif '945' in name:
                cpu_list[3] = '3.0'
            elif '955' in name:
                cpu_list[3] = '3.2'
            elif '965' in name:
                cpu_list[3] = '3.4'
            elif '5000+' in name:
                cpu_list[3] = '2.2'
            elif '6000+' in name:
                cpu_list[3] = '3.0'
            elif '7850' in name:
                cpu_list[3] = '2.8'
            elif '8250' in name:
                cpu_list[3] = '1.9'
            elif '8400' in name:
                cpu_list[3] = '2.1'
            elif '8450' in name:
                cpu_list[3] = '2.1'
            elif '8600' in name:
                cpu_list[3] = '2.3'
            elif '8650' in name:
                cpu_list[3] = '2.3'
            elif '8750' in name:
                cpu_list[3] = '2.4'
            elif '8850' in name:
                cpu_list[3] = '2.5'
            elif '9100' in name:
                cpu_list[3] = '1.8'
            elif '9150' in name:
                cpu_list[3] = '1.8'
            elif '9350' in name:
                cpu_list[3] = '2.0'
            elif '9450' in name:
                cpu_list[3] = '2.1'
            elif '9500' in name:
                cpu_list[3] = '2.2'
            elif '9550' in name:
                cpu_list[3] = '2.2'
            elif '9600' in name:
                cpu_list[3] = '2.3'
            elif '9650' in name:
                cpu_list[3] = '2.3'
            elif '9750' in name:
                cpu_list[3] = '2.4'
            elif '9850' in name:
                cpu_list[3] = '2.5'
            elif '9950' in name:
                cpu_list[3] = '2.6'
            elif '9600' in name:
                cpu_list[3] = '2.3'
            elif '9950' in name:
                cpu_list[3] = '2.6'
            elif 'B22' in name:
                cpu_list[3] = '2.8'
            elif 'B24' in name:
                cpu_list[3] = '3.0'
            elif 'B53' in name:
                cpu_list[3] = '2.8'
            elif 'B55' in name:
                cpu_list[3] = '3.0'
            elif 'B73' in name:
                cpu_list[3] = '2.8'
            elif 'B75' in name:
                cpu_list[3] = '3.0'
            elif 'B93' in name:
                cpu_list[3] = '2.8'
            elif 'B95' in name:
                cpu_list[3] = '3.0'
            return cpu_list
        elif 'UltraSparc' in name or 'sparcv' in name or 'SPARCstation' in name or 'RS/6000' in name:
            cpu_list = ['-1', 'SPARC', '-1', '-1']
            return cpu_list
        elif 'AMD Athlon(tm) 64' in name or 'AMD Athlon Dual' in name or 'AMD Athlon(tm) Dual' in name \
        or 'AMD Athlon 64' in name or 'AMD Athlon(tm)64' in name:
            cpu_list = ['Athlon 64', 'x86', '64', '-1']
            if '2800+' in name:
                cpu_list[3] = '1.6'
            elif '2900+' in name:
                cpu_list[3] = '2.0'
            elif '3200+' in name:
                cpu_list[3] = '2.0'
            elif '3300+' in name:
                cpu_list[3] = '2.4'
            elif '3400+' in name:
                cpu_list[3] = '2.2'
            elif '3500+' in name:
                cpu_list[3] = '2.2'
            elif '4000+' in name:
                cpu_list[3] = '2.4'
            elif 'FX-51' in name:
                cpu_list[3] = '2.2'
            elif 'FX-53' in name:
                cpu_list[3] = '2.4'
            elif 'FX-55' in name:
                cpu_list[3] = '2.6'
            elif 'FX-57' in name:
                cpu_list[3] = '2.8'
            elif 'FX-60' in name:
                cpu_list[3] = '2.6'
            elif 'FX-62' in name:
                cpu_list[3] = '2.8'
            elif 'FX-70' in name:
                cpu_list[3] = '2.6'
            elif 'FX-72' in name:
                cpu_list[3] = '2.8'
            elif 'FX-74' in name:
                cpu_list[3] = '3.0'
            elif 'TK-53' in name:
                cpu_list[3] = '1.7'
            elif 'TK-55' in name:
                cpu_list[3] = '1.8'
            elif 'TL-56' in name:
                cpu_list[3] = '1.8'
            elif 'TK-57' in name:
                cpu_list[3] = '1.9'
            elif 'TL-58' in name:
                cpu_list[3] = '1.9'
            elif 'TL-60' in name:
                cpu_list[3] = '2.0'
            elif 'TL-62' in name:
                cpu_list[3] = '2.1'
            elif 'TL-64' in name:
                cpu_list[3] = '2.2'
            elif 'TL-66' in name:
                cpu_list[3] = '2.3'
            elif 'TL-68' in name:
                cpu_list[3] = '2.4'
            return cpu_list
        elif 'MacBook' in name or 'MacPro' in name or 'PowerBook' in name or 'PowerMac' in name \
        or 'Power Macintosh' in name or 'iMac' in name or 'RackMac' in name:
            cpu_list = ['-1', 'PowerPC', '-1', '-1']
            if '7400' in name: cpu_list[3] = 0.35
            return cpu_list
        elif 'AMD Athlon(TM) MP' in name or 'AMD Athlon(tm) MP' in name:
            cpu_list = ['Athlon', 'x86', '32', '-1']
            if '1600+' in name:
                cpu_list[3] = '1.4'
            elif '1800+' in name:
                cpu_list[3] = '1.533'
            elif '1900+' in name:
                cpu_list[3] = '1.6'
            elif '2000+' in name:
                cpu_list[3] = '1.667'
            elif '2100+' in name:
                cpu_list[3] = '1.733'
            elif '2200+' in name:
                cpu_list[3] = '1.8'
            elif '2400+' in name:
                cpu_list[3] = '2.0'
            elif '2600+' in name:
                cpu_list[3] = '2.133'
            elif '2800+' in name:
                cpu_list[3] = '2.0'
            elif '1700+' in name:
                cpu_list[3] = '1.466'
            return cpu_list
        elif 'AMD Athlon(tm) 64 X2 Dual Core' in name or 'AMD Athlon(tm) 64 X2 Dual Core Processor' in name or 'Athlon 64 Dual Core' in name:
            cpu_list = ['Athlon 64 Dual Core', 'x86', '64', '-1']
            if '3800+' in name:
                cpu_list[3] = '2.0'
            elif '4000+' in name:
                cpu_list[3] = '2.1'
            elif '4600+' in name:
                cpu_list[3] = '2.3'
            elif '4200+' in name:
                cpu_list[3] = '2.1'
            elif '4400+' in name:
                cpu_list[3] = '2.2'
            elif '5000+' in name:
                cpu_list[3] = '2.6'
            elif '5200+' in name:
                cpu_list[3] = '2.7'
            elif '5400+' in name:
                cpu_list[3] = '2.8'
            elif '5600+' in name:
                cpu_list[3] = '2.8'
            elif '6000+' in name:
                cpu_list[3] = '3.0'
            elif '6400+' in name:
                cpu_list[3] = '3.2'
            elif 'TK-55' in name:
                cpu_list[3] = '1.8'
            elif 'TK-53' in name:
                cpu_list[3] = '1.7'
            elif 'TK-57' in name:
                cpu_list[3] = '1.9'
            return cpu_list
        elif 'AMD Athlon(tm) XP' in name or 'AMD Athlon(TM) XP' in name or 'AMD Athlon XP-M' in name:
            cpu_list = ['Athlon', 'x86', '32', '-1']
            if '1500+' in name:
                cpu_list[3] = '1.333'
            elif '1600+' in name:
                cpu_list[3] = '1.4'
            elif '1700' in name:
                cpu_list[3] = '1.467'
            elif '1800+' in name:
                cpu_list[3] = '1.533'
            elif '1900+' in name:
                cpu_list[3] = '1.6'
            elif '2000+' in name:
                cpu_list[3] = '1.667'
            elif '2100+' in name:
                cpu_list[3] = '1.733'
            elif '2200+' in name:
                cpu_list[3] = '1.8'
            elif '2400+' in name:
                cpu_list[3] = '2.0'
            elif '2500+' in name:
                cpu_list[3] = '1.833'
            elif '2600+' in name:
                cpu_list[3] = '2.133'
            elif '2700+' in name:
                cpu_list[3] = '2.167'
            elif '2800+' in name:
                cpu_list[3] = '2.25'
            elif '2900+' in name:
                cpu_list[3] = '2.0'
            elif '3000+' in name:
                cpu_list[3] = '2.1'
            elif '3100+' in name:
                cpu_list[3] = '2.2'
            elif '3200+' in name:
                cpu_list[3] = '2.333'
            return cpu_list
        elif 'AMD Turion(tm) 64' in name or 'AMD Turion' in name:
            cpu_list = ['Turion', 'x86', '64', '-1']
            if 'TL-50' in name:
                cpu_list[3] = '1.6'
            elif 'TL-52' in name:
                cpu_list[3] = '1.6'
            elif 'TL-56' in name:
                cpu_list[3] = '1.8'
            elif 'TL-58' in name:
                cpu_list[3] = '1.9'
            elif 'TL-60' in name:
                cpu_list[3] = '2.0'
            elif 'TL-62' in name:
                cpu_list[3] = '2.1'
            elif 'TL-64' in name:
                cpu_list[3] = '2.2'
            elif 'TL-66' in name:
                cpu_list[3] = '2.3'
            elif 'TL-68' in name:
                cpu_list[3] = '2.4'
            elif 'M100' in name or 'M300' in name:
                cpu_list[3] = '2.0'
            elif 'M120' in name or 'M320' in name:
                cpu_list[3] = '2.1'
            elif 'M340' in name:
                cpu_list[3] = '2.2'
            elif 'M500' in name:
                cpu_list[3] = '2.2'
            elif 'M520' in name:
                cpu_list[3] = '2.3'
            elif 'M540' in name:
                cpu_list[3] = '2.4'
            elif 'MK-36' in name:
                cpu_list[3] = '2.0'
            elif 'MK-38' in name:
                cpu_list[3] = '2.2'
            elif 'ML-28' in name:
                cpu_list[3] = '1.6'
            elif 'ML-30' in name:
                cpu_list[3] = '1.6'
            elif 'ML-32' in name:
                cpu_list[3] = '1.8'
            elif 'ML-34' in name:
                cpu_list[3] = '1.8'
            elif 'ML-37' in name:
                cpu_list[3] = '2.0'
            elif 'ML-40' in name:
                cpu_list[3] = '2.2'
            elif 'ML-42' in name:
                cpu_list[3] = '2.4'
            elif 'ML-44' in name:
                cpu_list[3] = '2.4'
            elif 'MT-28' in name:
                cpu_list[3] = '1.6'
            elif 'MT-30' in name:
                cpu_list[3] = '1.6'
            elif 'MT-37' in name:
                cpu_list[3] = '2.0'
            elif 'MT-40' in name:
                cpu_list[3] = '2.2'
            elif 'RM-70' in name:
                cpu_list[3] = '2.0'
            elif 'RM-72' in name:
                cpu_list[3] = '2.1'
            elif 'RM-74' in name or 'RM-75' in name:
                cpu_list[3] = '2.2'
            elif 'RM-76' in name or 'RM-77' in name:
                cpu_list[3] = '2.3'
            elif 'ZM-80' in name:
                cpu_list[3] = '2.1'
            elif 'ZM-82' in name:
                cpu_list[3] = '2.2'
            elif 'ZM-84' in name or 'ZM-85' in name:
                cpu_list[3] = '2.3'
            elif 'ZM-86' in name or 'ZM-87' in name:
                cpu_list[3] = '2.4'
            elif 'ZM-88' in name:
                cpu_list[3] = '2.5'
            return cpu_list
        elif 'AMD Athlon XP 3600+' in name: return ['Athlon', 'x86', '32', '2.0']
        elif 'Mobile AMD Athlon (tm) XP 1400+' in name: return ['Athlon', 'x86', '32', '1.2']
        elif 'AMD Sempron(tm)' in name or 'Mobile AMD Sempron(tm)' in name or 'AMD Sempron(TM)' in name:
            cpu_list = ['Sempron', 'x86', '32', '-1']
            if '2400+' in name:
                cpu_list[3] = '1.6'
            elif '2200+' in name:
                cpu_list[3] = '1.5'
            elif '2300+' in name:
                cpu_list[3] = '1.58'
            elif '2500+' in name:
                cpu_list[3] = '1.75'
            elif '2600+' in name:
                cpu_list[3] = '1.6'
            elif '2800+' in name:
                cpu_list[3] = '1.6'
            elif '3000+' in name:
                cpu_list[3] = '1.8'
            elif '3100+' in name:
                cpu_list[3] = '1.8'
            elif '3300+' in name:
                cpu_list[3] = '2.0'
            elif '3400+' in name:
                cpu_list[3] = '2.0'
            elif '3500+' in name:
                cpu_list[3] = '1.8'
            elif '3600+' in name:
                cpu_list[3] = '2.0'
            elif '3700+' in name:
                cpu_list[3] = '2.0'
            elif '3800+' in name:
                cpu_list[3] = '2.2'
            elif '4000+' in name:
                cpu_list[3] = '2.2'
            return cpu_list
        elif 'AMD Athlon(tm) X2' in name or 'Athlon(tm) Dual Core Processor' in name:
            cpu_list = ['Athlon', 'x86', '64', '-1']
            if '4850e' in name:
                cpu_list[3] = '2.5'
            elif '4450e' in name:
                cpu_list[3] = '2.3'
            elif '4050e' in name:
                cpu_list[3] = '2.1'
            elif '5050e' in name:
                cpu_list[3] = '2.6'
            elif '3600+' in name:
                cpu_list[3] = '1.9'
            elif '3800+' in name:
                cpu_list[3] = '2.0'
            elif '4000+' in name:
                cpu_list[3] = '2.0'
            elif '4200+' in name:
                cpu_list[3] = '2.2'
            elif '4400+' in name:
                cpu_list[3] = '2.2'
            elif '4600+' in name:
                cpu_list[3] = '2.4'
            elif '4800+' in name:
                cpu_list[3] = '2.4'
            elif '5000+' in name:
                cpu_list[3] = '2.6'
            elif '5400+' in name:
                cpu_list[3] = '2.7'
            elif '5600+' in name:
                cpu_list[3] = '2.8'
            elif '6000+' in name:
                cpu_list[3] = '3.0'
            elif 'BE-2350' in name:
                cpu_list[3] = '2.1'
            elif 'BE-2300' in name:
                cpu_list[3] = '1.9'
            elif 'BE-2400' in name:
                cpu_list[3] = '2.3'
            elif '7750' in name:
                cpu_list[3] = '2.7'
            elif '7550' in name:
                cpu_list[3] = '2.5'
            elif '7450' in name:
                cpu_list[3] = '2.4'
            elif '7850' in name:
                cpu_list[3] = '2.8'
            elif 'QL-60' in name:
                cpu_list[3] = '1.9'
            elif 'QL-62' in name:
                cpu_list[3] = '2.0'
            return cpu_list
        elif 'AMD Opteron(tm) Processor' in name or 'AMD Opteron (tm) Processor ' in name or 'AMD Opteron(TM) Processor' in name:
            cpu_list = ['Opteron', 'x86', '64', '-1']
            if '144' in name or '165' in name or '244' in name or '265' in name:
                cpu_list[3] = '1.8'
            elif '150' in name or '250' in name or '180' in name or '280' in name or '850' in name:
                cpu_list[3] = '2.4'
            elif '146' in name or '170' in name or '246' in name or '270' in name:
                cpu_list[3] = '2.0'
            elif '148' in name or '248' in name or '175' in name or '275' in name or '875' in name or '6274' in name:
                cpu_list[3] = '2.2'
            elif '152' in name or '185' in name or '252' in name or '285' in name or '885' in name:
                cpu_list[3] = '2.6'
            elif '154' in name or '254' in name:
                cpu_list[3] = '2.8'
            elif '1210' in name or '2210' in name:
                cpu_list[3] = '1.8'
            elif '1214' in name or '2214' in name:
                cpu_list[3] = '2.2'
            elif '1212' in name or '2212' in name:
                cpu_list[3] = '2.0'
            elif '1218' in name or '2218' in name:
                cpu_list[3] = '2.6'
            elif '1220' in name or '2220' in name or '8220' in name:
                cpu_list[3] = '2.8'
            return cpu_list
        elif 'Genuine Intel(R) CPU ' in name:
            cpu_list = ['-1', 'x86', '32', '-1']
            if 'GHz' in name:            
                cpu_list[3] = name[name.index('GHz')- 4: name.index('GHz')]
            elif 'MHz' in name:            
                cpu_list[3] = str(int(name[name.index('MHz')- 4: name.index('MHz')])/1000.0)
            return cpu_list
        elif 'Pentium(R) Dual-Core ' in name or 'Intel(R) Core(TM) Duo CPU' in name or 'Intel(R) Core(TM)2 Solo CPU' in name\
            or 'Intel(R) Core(TM) Solo CPU' in name or 'Intel(R) Core(TM) CPU Z520' in name or \
            'Intel(R) Core(TM) CPU       ' in name:
            cpu_list = ['Dual Core', 'x86', '64', '-1']
            if 'GHz' in name:          
                cpu_list[3] = name[name.index('GHz')- 4: name.index('GHz')]
            elif 'MHz' in name:  
                cpu_list[3] = str(int(name[name.index('MHz')- 4: name.index('MHz')])/1000.0)
            return cpu_list
        elif re.match(r'^Itanium', name) or 'ia64' in name or 'IA-64' in name:
            cpu_list = ['Itanium', 'IA-64', '64', '-1']
            return cpu_list
        elif 'Intel(R) Core(TM)2 Quad' in name:
            cpu_list = ['Core 2 Quad', 'x86', '64', '-1']
            if 'GHz' in name:
                cpu_list[3] = name[name.index('GHz')- 4: name.index('GHz')]
            elif 'MHz' in name:            
                cpu_list[3] = str(int(name[name.index('MHz')- 4: name.index('MHz')])/1000.0)
            return cpu_list
        elif 'Intel(R) Core(TM)2 Extreme' in name:
            cpu_list = ['Core 2 Extreme', 'x86', '64', '-1']
            if 'GHz' in name:
                cpu_list[3] = name[name.index('GHz')- 4: name.index('GHz')]
            elif 'MHz' in name:            
                cpu_list[3] = str(int(name[name.index('MHz')- 4: name.index('MHz')])/1000.0)
            return cpu_list
        elif 'Intel(R) Atom(TM)' in name:
            if 'N270' in name: cpu_list = ['Atom', 'x86', '32', '-1']
            else: cpu_list = ['Atom', 'x86', '64', '-1']
            if 'GHz' in name:
                cpu_list[3] = name[name.index('GHz')- 4: name.index('GHz')]
            elif 'MHz' in name:            
                cpu_list[3] = str(int(name[name.index('MHz')- 4: name.index('MHz')])/1000.0)
            return cpu_list
        elif 'Intel(R) Pentium(R) 4 Mobile CPU' in name:
            cpu_list = ['Pentium Mobile', 'x86', '32', '-1']
            if 'GHz' in name:
                cpu_list[3] = name[name.index('GHz')- 4: name.index('GHz')]
            elif 'MHz' in name:            
                cpu_list[3] = str(int(name[name.index('MHz')- 4: name.index('MHz')])/1000.0)
            return cpu_list
        elif 'Intel(R) Core(TM)2 CPU' in name:
            cpu_list = ['Core 2', 'x86', '64', '-1']
            if 'GHz' in name:
                cpu_list[3] = name[name.index('GHz')- 4: name.index('GHz')]
            elif 'MHz' in name:            
                cpu_list[3] = str(int(name[name.index('MHz')- 4: name.index('MHz')])/1000.0)
            return cpu_list
        elif 'AMD Athlon(tm) 64 X2 Dual Core Processor 4600+' in name:
            cpu_list = ['Athlon 64 Dual Core', 'x86', '64', '2.30']
            return cpu_list
        elif 'AMD Athlon(tm) 64 Processor 3700+' in name:
            cpu_list = ['Athlon 64 Dual Core', 'x86', '64', '2.20']
            return cpu_list
        elif 'AMD Athlon(tm) 64 Processor 3000+' in name:
            cpu_list = ['Athlon 64 Dual Core', 'x86', '64', '2.0']
            return cpu_list
        elif 'AMD Athlon(tm) 64 Processor 3800+' in name:
            cpu_list = ['Athlon 64 Dual Core', 'x86', '64', '2.40']
            return cpu_list
        elif 'Mobile Intel(R) Celeron(R)' in name or 'Intel(R) Celeron(R)' in name or 'Intel(R) Celeron(TM)' in name \
        or 'Intel(r) Celeron(tm)' in name or 'Celeron(R)' in name or 'Mobile Intel(R) Celeron(TM)' in name \
        or 'Intel Celeron' in name or 'Celeron (Coppermine)' in name or 'Celeron (Mendocino)' in name:
            cpu_list = ['Celeron', 'x86', '32', '-1']
            if 'GHz' in name:
                cpu_list[3] = name[name.index('GHz')- 4: name.index('GHz')]
            elif 'MHz' in name:            
                cpu_list[3] = str(int(name[name.index('MHz')- 4: name.index('MHz')])/1000.0)
            return cpu_list
        elif 'Intel(R) Core(TM)2 Duo CPU' in name:
            cpu_list = ['Core 2 Duo', 'x86', '64', '-1']
            if 'GHz' in name:
                cpu_list[3] = name[name.index('GHz')- 4: name.index('GHz')]
            elif 'MHz' in name:            
                cpu_list[3] = str(int(name[name.index('MHz')- 4: name.index('MHz')])/1000.0)
            return cpu_list
        elif re.match(r'^Intel(R) Core(TM) i\d CPU', name) or 'Intel(R) Core(TM) i3' in name \
            or 'Intel(R) Core(TM) i5' in name or 'Intel(R) Core(TM) i7' in name :
            if 'i7' in name:            
                cpu_list = ['Core i7', 'x86', '64', '-1']
            elif 'i5' in name:            
                cpu_list = ['Core i5', 'x86', '64', '-1']
            elif 'i3' in name:            
                cpu_list = ['Core i3', 'x86', '64', '-1']
            else: cpu_list = ['-1', 'x86', '64', '-1']
            if 'GHz' in name:
                cpu_list[3] = name[name.index('GHz')- 4: name.index('GHz')]
            elif 'MHz' in name:            
                cpu_list[3] = str(int(name[name.index('MHz')- 4: name.index('MHz')])/1000.0)
            return cpu_list
        elif 'Intel(R) Pentium(R) 4 CPU' in name:
            cpu_list = ['Pentium 4', 'x86', '32', '-1']
            if 'GHz' in name:
                cpu_list[3] = name[name.index('GHz')- 4: name.index('GHz')]
            elif 'MHz' in name:            
                cpu_list[3] = str(int(name[name.index('MHz')- 4: name.index('MHz')])/1000.0)
            return cpu_list
        elif 'Mobile Intel(R) Pentium(R) III' in name or 'Intel(R) Pentium(R) III' in name:
            cpu_list = ['Pentium 3', 'x86', '32', '-1']
            if 'GHz' in name:
                cpu_list[3] = name[name.index('GHz')- 4: name.index('GHz')]
            elif 'MHz' in name:            
                cpu_list[3] = str(int(name[name.index('MHz')- 4: name.index('MHz')])/1000.0)
            return cpu_list
        elif 'Pentium III' in name:
            cpu_list = ['Pentium 3', 'x86', '32', '-1']
            if 'GHz' in name:
                cpu_list[3] = name[name.index('GHz')- 4: name.index('GHz')]
            elif 'MHz' in name:            
                cpu_list[3] = str(int(name[name.index('MHz')- 4: name.index('MHz')])/1000.0)
            return cpu_list
        elif 'Pentium II' in name or 'Pentium(r) II' in name:
            cpu_list = ['Pentium 2', 'x86', '32', '-1']
            if 'GHz' in name:
                cpu_list[3] = name[name.index('GHz')- 4: name.index('GHz')]
            elif 'MHz' in name:            
                cpu_list[3] = str(int(name[name.index('MHz')- 4: name.index('MHz')])/1000.0)
            return cpu_list
        elif 'Intel(R) Pentium(R) Dual  CPU' in name or 'Intel(R) Pentium(R) D' in name:
            cpu_list = ['Dual', 'x86', '64', '-1']
            return cpu_list
        elif 'AMD-K6(tm)' in name or 'AMD-K6tm' in name: return ['K6', 'x86', '32', '-1']
        elif 'AMD-K7(tm)' in name: return ['K7', 'x86', '32', '-1']
        elif 'Intel(R) Pentium(R) D CPU' in name:
            cpu_list = ['Pentium D', 'x86', '64', '-1']
            return cpu_list
        elif 'Unknown CPU Type' in name:
            cpu_list = ['-1', '-1', '-1', '-1']
            return cpu_list
        elif 'AMD Athlon(tm)' in name or 'AMD Duron(tm)' in name or 'AMD Duron(TM)' in name:
            if 'Athlon' in name : cpu_list = ['Athlon', 'x86', '-1', '-1']
            else: cpu_list = ['Duron', 'x86', '-1', '-1']
            return cpu_list
        elif 'Mobile Intel(R) Pentium(R) 4' in name or 'Intel(R) Pentium(R) M processor' in name:
            cpu_list = ['Pentium Mobile', 'x86', '32', '-1']
            if 'GHz' in name:
                cpu_list[3] = name[name.index('GHz')- 4: name.index('GHz')]
            elif 'MHz' in name:            
                cpu_list[3] = str(int(name[name.index('MHz')- 4: name.index('MHz')])/1000.0)
            return cpu_list
        elif 'AMD A4-3300 APU' in name: return ['APU', 'x86', '64', '2.5']
        elif 'AMD A4-3400 APU' in name: return ['APU', 'x86', '64', '2.7']
        elif 'AMD A6-3500 APU' in name: return ['APU', 'x86', '64', '2.1']
        elif 'AMD A6-3600 APU' in name: return ['APU', 'x86', '64', '2.1']
        elif 'AMD A6-3620 APU' in name: return ['APU', 'x86', '64', '2.2']
        elif 'AMD A6-3650 APU' in name: return ['APU', 'x86', '64', '2.6']
        elif 'AMD A6-3670 APU' in name: return ['APU', 'x86', '64', '2.7']
        elif 'AMD A8-3510MX' in name: return ['APU', 'x86', '64', '1.8']
        elif 'AMD A8-3600 APU with Radeon' in name: return ['APU', 'x86', '64', '2.4']
        elif 'AMD A8-3650 APU with Radeon' in name: return ['APU', 'x86', '64', '2.6']
        elif 'AMD A8-3800 APU with Radeon' in name: return ['APU', 'x86', '64', '2.7']
        elif 'AMD A8-3820 APU with Radeon' in name: return ['APU', 'x86', '64', '2.6']
        elif 'AMD A8-3850 APU with Radeon' in name: return ['APU', 'x86', '64', '2.9']
        elif 'AMD A8-3870 APU with Radeon' in name: return ['APU', 'x86', '64', '3.1']
        elif 'AMD FX(tm)-4100 ' in name: return ['FX', 'x86', '64', '3.6']
        elif 'AMD FX(tm)-4170 ' in name: return ['FX', 'x86', '64', '4.2']
        elif 'AMD FX(tm)-6100 ' in name: return ['FX', 'x86', '64', '3.3']
        elif 'AMD FX(tm)-6200 ' in name: return ['FX', 'x86', '64', '3.8']
        elif 'AMD FX(tm)-8120' in name: return ['FX', 'x86', '64', '3.1']
        elif 'AMD FX(tm)-8150' in name: return ['FX', 'x86', '64', '3.6']
        elif re.match(r'^x86 Family \d Model \d Stepping \d', name) or re.match(r'^x86 Family \d\d Model \d Stepping \d', name)\
        or re.match(r'^x86 Family \d Model \d\d Stepping \d', name) or re.match(r'^x86 Family \d Model \d\d Stepping \d\d', name):
            cpu_list = ['-1', 'x86', '32', '-1']
            if 'GHz' in name:
                cpu_list[3] = name[name.index('GHz')- 4: name.index('GHz')]
            elif 'MHz' in name:            
                cpu_list[3] = str(int(name[name.index('MHz')- 4: name.index('MHz')])/1000.0)
            return cpu_list
        elif re.match(r'^\[Family \d Model \d Stepping \d', name) or re.match(r'^\[Family \d Model \d\d Stepping \d', name)\
            or re.match(r'^\[x86 Family \d Model \d\d Stepping \d\d', name):
            cpu_list = ['-1', 'x86', '32', '-1']
            if 'GHz' in name:
                cpu_list[3] = name[name.index('GHz')- 4: name.index('GHz')]
            elif 'MHz' in name:            
                cpu_list[3] = str(int(name[name.index('MHz')- 4: name.index('MHz')])/1000.0)
            return cpu_list
        elif 'AMD C-50 Processor' in name: return ['-1', 'x86', '32', '1.0']
        elif 'AMD E-240 Processor' in name: return ['-1', 'x86', '32', '1.5']
        elif 'AMD E-350 Processor' in name: return ['-1', 'x86', '32', '1.6']
        elif 'AMD E-450 APU' in name: return ['-1', 'x86', '32', '1.65']
        elif 'AMD Hammer Family processor' in name:
            cpu_list = ['Hammer', 'x86', '-1', '-1']
            return cpu_list
        elif 'Intel(r) family' in name:
            cpu_list = ['-1', 'x86', '32', '-1']
            return cpu_list
        elif 'Pentium' in name or 'pentium_pro+mmx' in name:
            cpu_list = ['-1', 'x86', '32', '-1']
            return cpu_list
        elif 'Unknow CPU Type' in name or 'Unknown CPU Typ' in name or 'Unknown Processor' in name\
        or 'Processor model unknown' in name:
            return ['-1', '-1', '-1', '-1']
        elif 'QEMU Virtual CPU' in name:
            return ['-1', '-1', '-1', '-1']
        elif 'AMD Six-Core Processor' in name:  return ['-1', '-1', '64', '-1']
        elif 'amd64' in name: return ['-1', 'x86', '64', '-1']
        elif 'AMD V120 Processor' in name or 'AMD V140 Processor' in name or 'AMD V160 Processor ' in name: return ['-1', 'x86', '-1', '-1']
        elif 'AMD Athlon(TM)Processor' in name: return ['Athlon', 'x86', '-1', '-1']
        elif 'AMD Processor Model Unknown' in name or 'AMD Engineering Sample' in name\
        or 'AMD Geode' in name or 'AMD Sempron' in name or 'Geode(TM) Integrated' in name or 'Mobile AMD Athl' in name \
        or 'AMD Athlon(TM) ' in name: 
            return ['-1', 'x86', '-1', '-1']
        elif 'Turbo 4800+ Comb (K8M80-M7A and Sempron 3000M)' in name:
            return ['-1', 'x86', '-1', '-1']
        elif 'Turbo 3400L Comb featuring VIG4 and AMD NX1750' in name:
            return ['-1', 'x86', '-1', '-1']
        elif 'VIA Eden Processor 1000MHz' in name: return ['-1', '-1', '-1', '1.0']
        elif 'VIA Esther processor' in name: 
            if '800MHz' in name: return ['-1', '-1', '-1', '0.8']
            elif '1000MHz' in name: return ['-1', '-1', '-1', '1.0']
            elif '1200MHz' in name: return ['-1', '-1', '-1', '1.3']
            elif '1300MHz' in name: return ['-1', '-1', '-1', '1.3']
            elif '1500MHz' in name: return ['-1', '-1', '-1', '1.5']
            elif '2000MHz' in name: return ['-1', '-1', '-1', '2.0']
            else: print 'Check CPU_OS.py--', name
        elif 'VIA Nano processor U2250 (1.6GHz Capable)' in name:
            return ['-1', '-1', '-1', '1.66']
        elif 'VIA Nano processor U2500@1200MHz' in name: return ['-1', '-1', '-1', '1.2']
        elif 'VIA Nano processor U2250@1300+MHz' in name: return ['-1', '-1', '-1', '1.3']
        elif 'VIA Nehemiah' in name or 'VIA Samuel' in name or 'VIA C3 Nehemiah' in name or 'VIA Ezra [' in name: 
            return ['-1', '-1', '-1', '-1']
        elif 'VIA C7 Processor 1000MHz ' in name: return ['-1', '-1', '-1', '1.0']
        elif 'VIA C7 Processor 1500MHz' in name or 'VIA C7-D Processor 1500MHz' in name: return ['-1', '-1', '-1', '1.5']
        elif 'VIA C7-M Processor 1200MHz' in name: return ['-1', '-1', '-1', '1.2']
        elif 'VIA C7-M Processor 1600MHz' in name: return ['-1', '-1', '-1', '1.6']
        elif 'VIA C7-M Processor 6300MHz' in name: return ['-1', '-1', '-1', '1.6']
        elif 'XP 2000+' in name or '9000/800' in name or '9000/785' in name or '740/750' in name or '06/17 [' in name \
        or '7447A [' in name: 
            return ['-1', '-1', '-1', '-1']
        elif 'Macmini1,1' in name or 'Macmini2,1' in name: return ['-1', '-1', '-1', '-1']
        elif 'EV56' in name or 'EV67' in name: return ['-1', '-1', '-1', '-1']
        elif 'tes>&#10;&lt;max_' in name: return ['-1', '-1', '-1', '-1']
        elif '7400 [Model' in name or '7450 [Model 0 ]' in name: return ['-1', '-1', '-1', '-1']
        elif 'IP25' in name or 'IP32' in name or 'Allegro W2' in name: return ['-1', '-1', '-1', '-1']
        elif 'Genuine Intel(R) processor               800MHz' in name: return ['-1', '-1', '-1', '0.8']
        elif 'Intel Core 2 Duo P9xxx' in name: return ['Core 2 Duo', '-1', '-1', '-1']
        elif '[Intel64 Family 6 Model 23 Stepping 10]' in name: return ['-1', '-1', '64', '-1']
        elif 'POWER5 (gr)' in name: return ['-1', '-1', '-1', '-1']
        elif 'Transmeta(tm) Crusoe(tm) Processor TM5800' in name or 'Transmeta(tm) Crusoe' in name: 
            return ['-1', '-1', '-1', '1.0']
        elif '[EM64T Family 6 Modeli' or '[Family 17 Model 6 Stepping 8]' in name: return ['-1', '-1', '-1', '-1']
        elif len(name) == 0: return ['-1', '-1', '-1', '-1']
        else:
            return []
        

    def convertOS(self, name):
        if 'Ultimate x86 Editon' in name or 'Ultimate x86 Edition' in name:
            if 'Service Pack 1' in name:
                os_list = ['Ultimate Edition', '1', '-1']
            elif 'Service Pack 2' in name:
                os_list = ['Ultimate Edition', '2', '-1']
            elif 'Service Pack 3' in name:
                os_list = ['Ultimate Edition', '3', '-1']
            elif 'Service Pack 4' in name:
                os_list = ['Ultimate Edition', '4', '-1']
            else:
                os_list = ['Ultimate Edition', '-1', '-1']
            return os_list
        elif 'Professional x86 Editon' in name or 'Professional Edition' in name or 'Professional x86 Edition' in name:
            if 'Service Pack 1' in name:
              os_list = ['Professional Edition', '1', '-1']
            elif 'Service Pack 2' in name:
              os_list = ['Professional Edition', '2', '-1']
            elif 'Service Pack 3' in name:
              os_list = ['Professional Edition', '3', '']
            elif 'Service Pack 4' in name:
              os_list = ['Professional Edition', '4', '']
            elif 'Service Pack 5' in name:
              os_list = ['Professional Edition', '5', '']
            elif 'Service Pack 6' in name:
              os_list = ['Professional Edition', '6', '']
            else:
              os_list = ['Professional Edition', '', '']
            return os_list
        elif 'Professional x64 Edition' in name:
            if 'Service Pack 1' in name:
                os_list = ['Professional Edition', '1', '64']
            elif 'Service Pack 2' in name:
                os_list = ['Professional Edition', '2', '64']
            elif 'Service Pack 3' in name:
                os_list = ['Professional Edition', '3', '64']
            elif 'Service Pack 4' in name:
                os_list = ['Professional Edition', '4', '64']
            elif 'Service Pack 5' in name:
                os_list = ['Professional Edition', '5', '64']
            elif 'Service Pack 6' in name:
                os_list = ['Professional Edition', '6', '64']
            else :
                os_list = ['Professional Edition', '', '64']
            return os_list
        elif 'Professional x64 Editon' in name:
            if 'Service Pack 1' in name:
                os_list = ['Professional Edition', '1', '64']
            elif 'Service Pack 2' in name:
                os_list = ['Professional Edition', '2', '64']
            elif 'Service Pack 3' in name:
                os_list = ['Professional Edition', '3', '64']
            elif 'Service Pack 4' in name:
                os_list = ['Professional Edition', '4', '64']
            elif 'Service Pack 5' in name:
                os_list = ['Professional Edition', '5', '64']
            elif 'Service Pack 6' in name:
                os_list = ['Professional Edition', '6', '64']
            else :
                os_list = ['Professional Edition', '', '64']
            return os_list
        elif 'Home Premium x86 Editon' in name or 'Home Premium x86 Edition' in name:
            if 'Service Pack 1' in name:
                os_list = ['Home Premium Edition', '1', '']
            elif 'Service Pack 2' in name:
                os_list = ['Home Premium Edition', '2', '']
            elif 'Service Pack 3' in name:
                os_list = ['Home Premium Edition', '3', '']
            elif 'Service Pack 4' in name:
                os_list = ['Home Premium Edition', '4', '']
            elif 'Service Pack 5' in name:
                os_list = ['Home Premium Edition', '5', '']
            elif 'Service Pack 6' in name:
                os_list = ['Home Premium Edition', '6', '']
            else :
                os_list = ['Home Premium Edition', '', '']
            return os_list
        elif 'Datacenter Server x86 Edition' in name or 'Datacenter Server x86 Editon' in name \
        or 'Datacenter x86 Edition' in name or 'Datacenter x86 Editon' in name:
            if 'Service Pack 1' in name:
                os_list = ['Datacenter Server Edition', '1', '']
            elif 'Service Pack 2' in name:
                os_list = ['Datacenter Server Edition', '2', '']
            elif 'Service Pack 3' in name:
                os_list = ['Datacenter Server Edition', '3', '']
            elif 'Service Pack 4' in name:
                os_list = ['Datacenter Server Edition', '4', '']
            elif 'Service Pack 5' in name:
                os_list = ['Datacenter Server Edition', '5', '']
            elif 'Service Pack 6' in name:
                os_list = ['Datacenter Server Edition', '6', '']
            else :
                os_list = ['Datacenter Server Edition', '', '']
            return os_list
        elif 'Datacenter Server x64 Edition' in name or 'Datacenter Server x46 Editon' in name:
            if 'Service Pack 1' in name:
                os_list = ['Datacenter Server Edition', '1', '64']
            elif 'Service Pack 2' in name:
                os_list = ['Datacenter Server Edition', '2', '64']
            elif 'Service Pack 3' in name:
                os_list = ['Datacenter Server Edition', '3', '64']
            elif 'Service Pack 4' in name:
                os_list = ['Datacenter Server Edition', '4', '64']
            elif 'Service Pack 5' in name:
                os_list = ['Datacenter Server Edition', '5', '64']
            elif 'Service Pack 6' in name:
                os_list = ['Datacenter Server Edition', '6', '64']
            else :
                os_list = ['Datacenter Server Edition', '', '64']
            return os_list
        elif 'Home Premium x64 Editon' in name or 'Home Premium x64 Edition' in name:
            if 'Service Pack 1' in name:
                os_list = ['Home Premium Edition', '1', '64']
            elif 'Service Pack 2' in name:
                os_list = ['Home Premium Edition', '2', '64']
            elif 'Service Pack 3' in name:
                os_list = ['Home Premium Edition', '3', '64']
            elif 'Service Pack 4' in name:
                os_list = ['Home Premium Edition', '4', '64']
            elif 'Service Pack 5' in name:
                os_list = ['Home Premium Edition', '5', '64']
            elif 'Service Pack 6' in name:
                os_list = ['Home Premium Edition', '6', '64']
            else :
                os_list = ['Home Premium Edition', '', '64']
            return os_list
        elif 'Home Editon' in name or 'Home Edition' in name or 'Home x86 Edition' in name or 'Home x86 Editon' in name:
            if 'Service Pack 1' in name:
                os_list = ['Home Edition', '1', '']
            elif 'Service Pack 2' in name:
                os_list = ['Home Edition', '2', '']
            elif 'Service Pack 3' in name:
                os_list = ['Home Edition', '3', '']
            elif 'Service Pack 4' in name:
                os_list = ['Home Edition', '4', '']
            elif 'Dodatek Service Pack 1' in name:
                os_list = ['Home Edition', '1', '']
            elif 'Dodatek Service Pack 2' in name:
                os_list = ['Home Edition', '2', '']
            elif 'Dodatek Service Pack 3' in name:
                os_list = ['Home Edition', '3', '']
            elif 'Szervizcsomag 1' in name:
                os_list = ['Home Edition', '1', '']
            elif 'Szervizcsomag 2' in name:
                os_list = ['Home Edition', '2', '']
            elif 'Szervizcsomag 3' in name:
                os_list = ['Home Edition', '3', '']
            else :
                os_list = ['Home Edition', '', '']
            return os_list
        elif 'Ultimate x64 Edition' in name or 'Ultimate x64 Editon' in name:
            if 'Service Pack 1' in name:
                os_list = ['Ultimate Edition', '1', '64']
            elif 'Service Pack 2' in name:
                os_list = ['Ultimate Edition', '2', '64']
            elif 'Service Pack 3' in name:
                os_list = ['Ultimate Edition', '3', '64']
            elif 'Service Pack 4' in name:
                os_list = ['Ultimate Edition', '4', '64']
            elif 'Service Pack 5' in name:
                os_list = ['Ultimate Edition', '5', '64']
            elif 'Service Pack 6' in name:
                os_list = ['Ultimate Edition', '6', '64']
            else :
                os_list = ['Ultimate Edition', '', '64']
            return os_list
        elif 'Enterprise Server Edition' in name or 'Enterprise Server x86 Editon' in name or 'Enterprise Server x86 Edition' in name:
            if 'Service Pack 1' in name:
                os_list = ['Enterprise Server Edition', '1', '']
            elif 'Service Pack 2' in name:
                os_list = ['Enterprise Server Edition', '2', '']
            elif 'Service Pack 3' in name:
                os_list = ['Enterprise Server Edition', '3', '']
            elif 'Service Pack 4' in name:
                os_list = ['Enterprise Server Edition', '4', '']
            elif 'Service Pack 5' in name:
                os_list = ['Enterprise Server Edition', '5', '']
            elif 'Service Pack 6' in name:
                os_list = ['Enterprise Server Edition', '6', '']
            else :
                os_list = ['Enterprise Server Edition', '', '']
            return os_list
        elif 'Enterprise Server x64 Edition' in name or 'Enterprise Server x64 Editon' in name:
            if 'Service Pack 1' in name:
                os_list = ['Enterprise Server Edition', '1', '64']
            elif 'Service Pack 2' in name:
                os_list = ['Enterprise Server Edition', '2', '64']
            elif 'Service Pack 3' in name:
                os_list = ['Enterprise Server Edition', '3', '64']
            elif 'Service Pack 4' in name:
                os_list = ['Enterprise Server Edition', '4', '64']
            elif 'Service Pack 5' in name:
                os_list = ['Enterprise Server Edition', '5', '64']
            elif 'Service Pack 6' in name:
                os_list = ['Enterprise Server Edition', '6', '64']
            else :
                os_list = ['Enterprise Server Edition', '', '64']
            return os_list
        elif 'Standard x64 Edition' in name or 'Standard x64 Editon' in name:
            if 'Service Pack 1' in name:
                os_list = ['Standard Edition', '1', '64']
            elif 'Service Pack 2' in name:
                os_list = ['Standard Edition', '2', '64']
            elif 'Service Pack 3' in name:
                os_list = ['Standard Edition', '3', '64']
            elif 'Service Pack 4' in name:
                os_list = ['Standard Edition', '4', '64']
            elif 'Service Pack 5' in name:
                os_list = ['Standard Edition', '5', '64']
            elif 'Service Pack 6' in name:
                os_list = ['Standard Edition', '6', '64']
            else :
                os_list = ['Standard Edition', '', '64']
            return os_list
        elif 'Starter x86 Edition' in name or 'Starter x86 Editon' in name:
            if 'Service Pack 1' in name:
                os_list = ['Starter Edition', '1', '']
            elif 'Service Pack 2' in name:
                os_list = ['Starter Edition', '2', '']
            elif 'Service Pack 3' in name:
                os_list = ['Starter Edition', '3', '']
            elif 'Service Pack 4' in name:
                os_list = ['Starter Edition', '4', '']
            elif 'Service Pack 5' in name:
                os_list = ['Starter Edition', '5', '']
            elif 'Service Pack 6' in name:
                os_list = ['Starter Edition', '6', '']
            else :
                os_list = ['Starter Edition', '', '']
            return os_list
        elif 'Datacenter Server Edition' in name or 'Datacenter Server Editon' in name:
            if 'Service Pack 1' in name:
                os_list = ['Datacenter Server Edition', '1', '']
            elif 'Service Pack 2' in name:
                os_list = ['Datacenter Server Edition', '2', '']
            elif 'Service Pack 3' in name:
                os_list = ['Datacenter Server Edition', '3', '']
            elif 'Service Pack 4' in name:
                os_list = ['Datacenter Server Edition', '4', '']
            elif 'Service Pack 5' in name:
                os_list = ['Datacenter Server Edition', '5', '']
            elif 'Service Pack 6' in name:
                os_list = ['Datacenter Server Edition', '6', '']
            else :
                os_list = ['Datacenter Server Edition', '', '']
            return os_list
        elif 'Datacenter x64 Edition' in name or 'Datacenter x64 Editon' in name:
            if 'Service Pack 1' in name:
                os_list = ['Datacenter Edition', '1', '64']
            elif 'Service Pack 2' in name:
                os_list = ['Datacenter Edition', '2', '64']
            elif 'Service Pack 3' in name:
                os_list = ['Datacenter Edition', '3', '64']
            elif 'Service Pack 4' in name:
                os_list = ['Datacenter Edition', '4', '64']
            elif 'Service Pack 5' in name:
                os_list = ['Datacenter Edition', '5', '64']
            elif 'Service Pack 6' in name:
                os_list = ['Datacenter Edition', '6', '64']
            else :
                os_list = ['Datacenter Edition', '', '64']
            return os_list
        elif 'Cluster Server x64 Edition' in name or 'Cluster Server x64 Editon' in name:
            if 'Service Pack 1' in name:
                os_list = ['Cluster Server Edition', '1', '64']
            elif 'Service Pack 2' in name:
                os_list = ['Cluster Server Edition', '2', '64']
            elif 'Service Pack 3' in name:
                os_list = ['Cluster Server Edition', '3', '64']
            elif 'Service Pack 4' in name:
                os_list = ['Cluster Server Edition', '4', '64']
            elif 'Service Pack 5' in name:
                os_list = ['Cluster Server Edition', '5', '64']
            elif 'Service Pack 6' in name:
                os_list = ['Cluster Server Edition', '6', '64']
            else :
                os_list = ['Cluster Server Edition', '', '64']
            return os_list
        elif 'Standard Server x64 Edition' in name or 'Standard Server x64 Editon' in name:
            if 'Service Pack 1' in name:
                os_list = ['Standard Server Edition', '1', '64']
            elif 'Service Pack 2' in name:
                os_list = ['Standard Server Edition', '2', '64']
            elif 'Service Pack 3' in name:
                os_list = ['Standard Server Edition', '3', '64']
            elif 'Service Pack 4' in name:
                os_list = ['Standard Server Edition', '4', '64']
            elif 'Service Pack 5' in name:
                os_list = ['Standard Server Edition', '5', '64']
            elif 'Service Pack 6' in name:
                os_list = ['Standard Server Edition', '6', '64']
            else :
                os_list = ['Standard Server Edition', '', '64']
            return os_list
        elif 'Standard Server x86 Edition' in name or 'Standard Server x86 Editon' in name \
        or 'Standard Server Edition' in name or 'Standard Server Editon' in name:
            if 'Service Pack 1' in name:
                os_list = ['Standard Server Edition', '1', '']
            elif 'Service Pack 2' in name:
                os_list = ['Standard Server Edition', '2', '']
            elif 'Service Pack 3' in name:
                os_list = ['Standard Server Edition', '3', '']
            elif 'Service Pack 4' in name:
                os_list = ['Standard Server Edition', '4', '']
            elif 'Service Pack 5' in name:
                os_list = ['Standard Server Edition', '5', '']
            elif 'Service Pack 5' in name:
                os_list = ['Standard Server Edition', '6', '']
            elif 'Dodatek Service Pack 1' in name:
                os_list = ['Standard Server Edition', '1', '']
            elif 'Dodatek Service Pack 2' in name:
                os_list = ['Standard Server Edition', '2', '']
            elif 'Szervizcsomag 1' in name:
                os_list = ['Standard Server Edition', '1', '']
            elif 'Szervizcsomag 2' in name:
                os_list = ['Standard Server Edition', '2', '']
            else :
                os_list = ['Standard Server Edition', '', '']
            return os_list
        elif 'Standard x86 Edition' in name or 'Standard x86 Editon' in name:
            if 'Service Pack 1' in name:
                os_list = ['Standard Edition', '1', '']
            elif 'Service Pack 2' in name:
                os_list = ['Standard Edition', '2', '']
            elif 'Service Pack 3' in name:
                os_list = ['Standard Edition', '3', '']
            elif 'Service Pack 4' in name:
                os_list = ['Standard Edition', '4', '']
            elif 'Service Pack 5' in name:
                os_list = ['Standard Edition', '5', '']
            elif 'Service Pack 6' in name:
                os_list = ['Standard Edition', '6', '']
            else :
                os_list = ['Standard Edition', '', '']
            return os_list
        elif 'Advanced Server Edition' in name or 'Advanced Server x86 Edition' in name or 'Advanced Server x86 Editon' in name:
            if 'Service Pack 1' in name:
                os_list = ['Advanced Server Edition', '1', '']
            elif 'Service Pack 2' in name:
                os_list = ['Advanced Server Edition', '2', '']
            elif 'Service Pack 3' in name:
                os_list = ['Advanced Server Edition', '3', '']
            elif 'Service Pack 4' in name:
                os_list = ['Advanced Server Edition', '4', '']
            elif 'Service Pack 5' in name:
                os_list = ['Advanced Server Edition', '5', '']
            elif 'Service Pack 6' in name:
                os_list = ['Advanced Server Edition', '6', '']
            else :
                os_list = ['Advanced Server Edition', '', '']
            return os_list
        elif 'Home Basic x86 Edition' in name:
            if 'Service Pack 1' in name:
                os_list = ['Home Basic Edition', '1', '']
            elif 'Service Pack 2' in name:
                os_list = ['Home Basic Edition', '2', '']
            elif 'Service Pack 3' in name:
                os_list = ['Home Basic Edition', '3', '']
            elif 'Service Pack 4' in name:
                os_list = ['Home Basic Edition', '4', '']
            elif 'Service Pack 5' in name:
                os_list = ['Home Basic Edition', '5', '']
            elif 'Service Pack 6' in name:
                os_list = ['Home Basic Edition', '6', '']
            else :
                os_list = ['Home Basic Edition', '', '']
            return os_list
        elif 'Home Basic x64 Edition' in name or 'Home Basic x64 Editon' in name:
            if 'Service Pack 1' in name:
                os_list = ['Home Basic Edition', '1', '64']
            elif 'Service Pack 2' in name:
                os_list = ['Home Basic Edition', '2', '64']
            elif 'Service Pack 3' in name:
                os_list = ['Home Basic Edition', '3', '64']
            elif 'Service Pack 4' in name:
                os_list = ['Home Basic Edition', '4', '64']
            elif 'Service Pack 5' in name:
                os_list = ['Home Basic Edition', '5', '64']
            elif 'Service Pack 6' in name:
                os_list = ['Home Basic Edition', '6', '64']
            else :
                os_list = ['Home Basic Edition', '', '64']
            return os_list
        elif 'Web Server x64 Edition' in name or 'Web Server x64 Edition' in name:
            if 'Service Pack 1' in name:
                os_list = ['Web Server Edition', '1', '64']
            elif 'Service Pack 2' in name:
                os_list = ['Web Server Edition', '2', '64']
            elif 'Service Pack 3' in name:
                os_list = ['Web Server Edition', '3', '64']
            else :
                os_list = ['Web Server Edition', '', '64']
            return os_list
        elif 'Web Server x86 Edition' in name or 'Web Server x64 Edition' in name:
            if 'Service Pack 1' in name:
                os_list = ['Web Server Edition', '1', '32']
            elif 'Service Pack 2' in name:
                os_list = ['Web Server Edition', '2', '32']
            elif 'Service Pack 3' in name:
                os_list = ['Web Server Edition', '3', '32']
            else :
                os_list = ['Web Server Edition', '', '32']
            return os_list
        elif 'Business x64 Edition' in name or 'Business x64 Editon' in name:
            if 'Service Pack 1' in name:
                os_list = ['Business Edition', '1', '64']
            elif 'Service Pack 2' in name:
                os_list = ['Business Edition', '2', '64']
            elif 'Service Pack 3' in name:
                os_list = ['Business Edition', '3', '64']
            elif 'Service Pack 4' in name:
                os_list = ['Business Edition', '4', '64']
            elif 'Service Pack 5' in name:
                os_list = ['Business Edition', '5', '64']
            elif 'Service Pack 6' in name:
                os_list = ['Business Edition', '6', '64']
            else :
                os_list = ['Business Edition', '', '64']
            return os_list
        elif 'Enterprise x86 Edition' in name or 'Enterprise x86 Editon' in name:
            if 'Service Pack 1' in name:
                os_list = ['Enterprise Edition', '1', '']
            elif 'Service Pack 2' in name:
                os_list = ['Enterprise Edition', '2', '']
            elif 'Service Pack 3' in name:
                os_list = ['Enterprise Edition', '3', '']
            elif 'Service Pack 4' in name:
                os_list = ['Enterprise Edition', '4', '']
            elif 'Service Pack 5' in name:
                os_list = ['Enterprise Edition', '5', '']
            elif 'Service Pack 6' in name:
                os_list = ['Enterprise Edition', '6', '']
            else :
                os_list = ['Enterprise Edition', '', '']
            return os_list
        elif 'Enterprise x64 Edition' in name or 'Enterprise x64 Editon' in name:
            if 'Service Pack 1' in name:
                os_list = ['Enterprise Edition', '1', '64']
            elif 'Service Pack 2' in name:
                os_list = ['Enterprise Edition', '2', '64']
            elif 'Service Pack 3' in name:
                os_list = ['Enterprise Edition', '3', '64']
            elif 'Service Pack 4' in name:
                os_list = ['Enterprise Edition', '4', '64']
            elif 'Service Pack 5' in name:
                os_list = ['Enterprise Edition', '5', '64']
            elif 'Service Pack 6' in name:
                os_list = ['Enterprise Edition', '6', '64']
            else :
                os_list = ['Enterprise Edition', '', '64']
            return os_list
        elif 'Business x86 Edition' in name or 'Business x86 Editon' in name:
            if 'Service Pack 1' in name:
                os_list = ['Business Edition', '1', '']
            elif 'Service Pack 2' in name:
                os_list = ['Business Edition', '2', '']
            elif 'Service Pack 3' in name:
                os_list = ['Business Edition', '3', '']
            elif 'Service Pack 4' in name:
                os_list = ['Business Edition', '4', '']
            elif 'Service Pack 5' in name:
                os_list = ['Business Edition', '5', '']
            elif 'Service Pack 6' in name:
                os_list = ['Business Edition', '6', '']
            else :
                os_list = ['Business Edition', '', '']
            return os_list
        elif re.match('Workstation Edition', name):
            if 'Service Pack 1' in name: os_list = ['', '1', '32']
            elif 'Service Pack 2' in name: os_list = ['', '2', '32']
            elif 'Service Pack 3' in name: os_list = ['', '3', '32']
            elif 'Service Pack 4' in name: os_list = ['', '4', '32']
            elif 'Service Pack 5' in name: os_list = ['', '5', '32']
            elif 'Service Pack 6' in name: os_list = ['', '6', '32']
            elif 'Srvice Pack 6a' in name: os_list = ['', '6a', '32']
            else : os_list = ['', '', '32']
            return os_list
        elif re.match('^x64 Edition', name) or re.match('^x64 Editon', name):
            if 'Service Pack 1' in name:
                os_list = ['', '1', '64']
            elif 'Service Pack 2' in name:
                os_list = ['', '2', '64']
            elif 'Service Pack 3' in name:
                os_list = ['', '3', '64']
            elif 'Service Pack 4' in name:
                os_list = ['', '4', '64']
            elif 'Service Pack 5' in name:
                os_list = ['', '5', '64']
            elif 'Service Pack 6' in name:
                os_list = ['', '6', '64']
            else :
                os_list = ['', '', '64']
            return os_list
        elif re.match('^x86 Edition', name) or re.match('^x86 Editon', name):
            if 'Service Pack 1' in name:
                os_list = ['', '1', '']
            elif 'Service Pack 2' in name:
                os_list = ['', '2', '']
            elif 'Service Pack 3' in name:
                os_list = ['', '3', '']
            elif 'Service Pack 4' in name:
                os_list = ['', '4', '']
            elif 'Service Pack 5' in name:
                os_list = ['', '5', '']
            elif 'Service Pack 6' in name:
                os_list = ['', '6', '']
            else :
                os_list = ['', '', '']
            return os_list
        elif re.match('^, Service Pack ', name):
            if 'Service Pack 1' in name:
                os_list = ['', '1', '']
            elif 'Service Pack 2' in name:
                os_list = ['', '2', '']
            elif 'Service Pack 3' in name:
                os_list = ['', '3', '']
            elif 'Service Pack 4' in name:
                os_list = ['', '4', '']
            elif 'Service Pack 5' in name:
                os_list = ['', '5', '']
            elif 'Service Pack 6' in name:
                os_list = ['', '6', '']
            else :
                os_list = ['', '', '']
            return os_list
        elif 'SE, (04.10.2222.00)' in name:
            os_list = ['SE', '', '']
            return os_list
        elif re.match(r'^\d.\d.\d', name) and not '686' in name and not '386' in name:
            os_list = ['', '', '']
            os_list[0] = re.match(r'^\d.\d.\d', name).group()
            return os_list
        elif re.match(r'^\d.\d.\d', name) and '686' in name:
            os_list = ['', '', '64']
            os_list[0] = re.match(r'^\d.\d.\d', name).group()
            return os_list
        elif re.match(r'^\d.\d.\d', name) and '386' in name:
            os_list = ['', '', '32']
            os_list[0] = re.match(r'^\d.\d.\d', name).group()
            return os_list
        elif re.match(r'^\d\d.\d.\d', name):
            os_list = ['', '', '']
            os_list[0] = re.match(r'^\d\d.\d.\d', name).group()
            return os_list
        elif re.match(r'^\d.\d\d', name):
            os_list = ['', '', '']
            os_list[0] = re.match(r'^\d.\d\d', name).group()
            return os_list
        elif re.match(r'^\d.\d', name):
            print name
            os_list = ['', '', '']
            os_list[0] = re.match(r'^\d.\d', name).group()
            return os_list
        else:
            return ['-1', '-1', '-1']
