Rev 110 | Rev 1915 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
def getscore(struct):score = 0if struct.has_key("features") :features = struct.get("features")# Weight : <=100-3, <=150-2, >150-1if features.has_key("Weight") :weight = features.get("Weight")if len(weight) > 0 :weight = float(weight[0])print "weight=" + `weight`if weight <= 100 :score += 3elif weight <= 150 :score += 2elif weight > 150 :score += 1# REVISIT# Size : Thickness <=10-4, <=12-3, <=14-2, >14-1if features.has_key("Size") :size = features.get("Size")if len(size) > 2 :thickness = float(size[2])print "thickness=" + `thickness`if thickness <= 10 :score += 4elif thickness <= 12 :score += 3elif thickness <= 14 :score += 2elif thickness > 14 :score += 1# REVISIT# Form Factor# REVISIT# Colorreturn score