Rev 6477 | Go to most recent revision | Blame | Compare with Previous | 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('Operating system provided'):os = str(features.get('Operating system provided')[0])if os == 'DOS':score = 7.0 #TODOelif os == 'Linux':score = 8.5 #TODOelif os == 'Windows 7 Starter':score = 8.0 #TODOelif os == 'Windows 7 Basic':score = 7.5 #TODOelif os == 'Windows 7 Professional':score = 8.5 #TODOelif os == 'Windows 7 Premium':score = 9.0 #TODOelif os == 'Windows 8':score = 9.0 #TODOelif os == 'Windows 7 Ultimate':score = 9.5 #TODOelif os == 'Mac OS X 10.4 Tiger':score = 8.0 #TODOelif os == 'Mac OS X 10.5 Leopard':score = 8.5 #TODOelif os == 'Mac OS X 10.6 Snow Leopard':score = 9.0 #TODOelif os == 'Mac OS X 10.7 Lion':score = 9.5 #TODOelif os == 'Mac OS X 10.8 Mountain Lion':score = 10.0 #TODOelif os == 'Windows 8 Pro':score = 9.5 #TODOreturn scoreprint "expSlide=" + `expSlide`struct = utils.contentModel2Struct(expSlide, categoryObj)print "struct=" + `struct`score = getscore(struct)