Subversion Repositories SmartDukaan

Rev

Rev 4036 | Rev 5206 | 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
    return score


print "expSlide=" + `expSlide`

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

score = getscore(struct)