Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
import utilsdef getscore(struct):score = 0.0screen_size_score = 0.0resolution_score = 0.0if struct.has_key('childrenslides'):childslides = struct.get('childrenslides')if childslides.has_key('Display'):display_slide = childslides.get('Display')if display_slide.has_key('features'):features = display_slide.get('features')if features.has_key('Screen size'):screen_size = float(features.get('Screen size')[0])if screen_size <= 10.0:screen_size_score = 5.0elif screen_size >= 15.0:screen_size_score = 10.0else:screen_size_score = 5.0 + (screen_size - 10.0)if features.has_key('Display resolution'):resolution = features.get('Display resolution')if resolution == 'WVGA: 800x480':resolution_score = 5.0elif resolution == 'SVGA: 800x600':resolution_score == 6.0elif resolution == 'WSVGA:1024x600':resolution_score == 7.0elif resolution == 'XGA: 1024x768':resolution_score = 7.5elif resolution == 'WXGA: 1366x768':resolution_score = 9.0else:resolution_score = 10.0#TODO: Acquire list of GPUs and Display Typesscore = (70.0 * screen_size_score + 30.0 * resolution_score) / 100.0return scoreprint "expSlide=" + `expSlide`struct = utils.contentModel2Struct(expSlide, categoryObj)print "struct=" + `struct`score = getscore(struct)