Blame | Last modification | View Log | RSS feed
import utilsdef getscore(struct):score = 0.0if struct.has_key('features'):features = struct.get('features')if features.has_key('Web cam'):if `features.get('Web cam')[0]`.find('VGA') > -1 or `features.get('Web cam')[0]`.find('0.3') > -1 or `features.get('Web cam')[0]`.find('1.3')> -1 :score += 20else :score += 30if features.has_key('Pointing device'):score +=15.0if features.has_key('Pointing device_fft'):for fft in features.get('Pointing device_fft'):fft = fft.encode()if fft.find('multi') > -1 or fft.find('Multi') > -1:if fft.find('touch') > -1 or fft.find('Touch')> -1:score += 5.0breakif features.has_key('Built-in speaker'):score += 15.0if len(features.get('Built-in speaker')[0]) > -1:score += 5.0if features.has_key('Dedicated keys'):score += 10.0if features.has_key('Biometric security'):bio_score = len(features.get('Biometric security'))*10.0if bio_score > 20.0:bio_score = 20.0score += bio_scorereturn score/10.0print "expSlide=" + `expSlide`struct = utils.contentModel2Struct(expSlide, categoryObj)print "struct=" + `struct`score = getscore(struct)