Rev 4037 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
import utilsdef getscore(struct):score = 0.0wireless_score = 0.0ethernet_score = 0.0bluetooth_score = 0.0if struct.has_key('features'):features = struct.get('features')if features.has_key("Wireless LAN"):wireless = str(features.get('Wireless LAN')[0])wireless_score = 10.0 if wireless.find('b/g/n') > -1 else 8.0if features.has_key('Ethernet LAN'):ethernet = str(features.get('Ethernet LAN')[0])if ethernet.find('1000 ') > -1:ethernet_score = 10.0elif ethernet.find('100') > -1:ethernet_score = 7.0else:ethernet_score = 4.0if features.has_key('Bluetooth'):bluetooth = str(features.get('Bluetooth')[0])bluetooth_score = 10.0 if bluetooth.find('3.0') else 7.0score = (50.0 * wireless_score + 30.0 * ethernet_score + 10.0 * bluetooth_score) / 100return scoreprint "expSlide=" + `expSlide`struct = utils.contentModel2Struct(expSlide, categoryObj)print "struct=" + `struct`score = getscore(struct)