Subversion Repositories SmartDukaan

Rev

Rev 5039 | Rev 6477 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

import utils

def getscore(struct):
    
    score = 0.0
    
    if struct.has_key('features'):
        features = struct.get('features')
        
        if features.has_key('Operating system provided'):
            os = str(features.get('Operating system provided')[0])
            
            if os == 'DOS':
                score = 7.0  #TODO
                
            elif os == 'Linux':
                score = 9.0  #TODO
                
            elif os == 'Windows 7 Starter':
                score = 8.0  #TODO
                
            elif os == 'Windows 7 Basic':
                score = 8.0  #TODO
                
            elif os == 'Windows 7 Professional':
                score = 9.0  #TODO
                
            elif os == 'Windows 7 Premium':
                score = 9.5  #TODO
                
            elif os == 'Windows 7 Ultimate':
                score = 10.0  #TODO

            elif os == 'Mac OS X 10.4 Tiger':
                score = 8.0  #TODO
                
            elif os == 'Mac OS X 10.5 Leopard':
                score = 8.5  #TODO
                
            elif os == 'Mac OS X 10.6 Snow Leopard':
                score = 9.0  #TODO
                
            elif os == ' Mac OS X 10.7 Lion':
                score = 9.5  #TODO
                
    return score


print "expSlide=" + `expSlide`

struct = utils.contentModel2Struct(expSlide, categoryObj)
print "struct=" + `struct`

score = getscore(struct)