Rev 323 | Rev 3448 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
def getscore(struct) :score = 0.0voip_score = 0.0twog_network_score = 0.0threeg_network_score = 0.0multiple_sim_score = 0.0if struct.has_key("features") :features = struct.get("features")if features.has_key("VoIP") :voip_score = 10if features.has_key("2G network") :twog_network = features.get("2G network")if len(twog_network) > 0 :twog_network = twog_network[0]print "2G Network=" + `twog_network`if twog_network.find("Quadband") > -1 :twog_network_score = 9elif twog_network.find("Triband") > -1 :twog_network_score = 7elif twog_network.find("Dualband") > -1 :twog_network_score = 5if features.has_key("3G network") :threeg_network_score = 10if features.has_key("Multiple SIM") :multiple_sim_score = 10score = (20*voip_score + 40*twog_network_score + 30*threeg_network_score + 10*multiple_sim_score)/100print "voip_score" + str(voip_score)print "twog_network_score" + str(twog_network_score)print "threeg_network_score" + str(threeg_network_score)print "multiple_sim_score" + str(multiple_sim_score)return score