Rev 75 | Blame | Last modification | View Log | RSS feed
import battery_math as mathmodelimport utilsprint "expSlide=" + `expSlide`struct = utils.contentModel2Struct(expSlide)print "struct=" + `struct`newstruct = {}# Copy features as isif struct.has_key("features") :features = struct.get("features")newstruct['features'] = features# Talktime and Standby time become 'childrenslides' and bullets go under 'features' > '2G'if struct.has_key("childrenslides") :childrenslides = struct.get("childrenslides")newchildrenslides = {}if childrenslides.has_key("Capacity") :capacity = childrenslides.get("Capacity")newcapacity = {}if capacity.has_key("features") :features = capacity.get("features")if features.has_key("Talk time") :talktimebullets = features.get("Talk time")newtalktimefeatures = {}newtalktimefeatures['2G'] = talktimebulletsnewtalktime = {}newtalktime['features'] = newtalktimefeaturesnewcapacity['Talk time'] = newtalktimeif features.has_key("Standby time") :standbytimebullet = features.get("Standby time")newstandbytimefeatures = {}newstandbytimefeatures['2G'] = standbytimebulletnewstandbytime = {}newstandbytime['features'] = newstandbytimefeaturesnewcapacity['Standby time'] = newstandbytimenewcapacitychildrenslides = {}newcapacitychildrenslides['childrenslides'] = newcapacitynewchildrenslides['Capacity'] = newcapacitychildrenslidesnewstruct['childrenslides'] = newchildrenslidesprint "newstruct=" + `newstruct`score = mathmodel.getscore(newstruct)