Subversion Repositories SmartDukaan

Rev

Rev 4036 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4036 varun.gupt 1
import utils
2
 
3
def getscore(struct):
4
 
5
    score = 0.0
6
 
7
    if struct.has_key('features'):
8
        features = struct.get('features')
9
 
10
        if features.has_key('Battery capacity'):
11
            capacity = features.get('Battery capacity') #TODO
12
 
13
        if features.has_key('Energy efficiency'):
14
            efficiency = features.get('Energy efficiency')
15
            efficiency_score = len(efficiency) * 1.0
4043 rajveer 16
            score = efficiency_score
4036 varun.gupt 17
 
18
    return score
19
 
20
 
21
print "expSlide=" + `expSlide`
22
 
23
struct = utils.contentModel2Struct(expSlide, categoryObj)
24
print "struct=" + `struct`
25
 
26
score = getscore(struct)