Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

import utils

def getscore(struct):
    
    score = 0.0
    
    if struct.has_key('features'):
        features = struct.get('features')
        features_count = len(features)
        score = 10.0 if features_count >= 10 else features_count * 1.0
        
    return score


print "expSlide=" + `expSlide`

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

score = getscore(struct)