Subversion Repositories SmartDukaan

Rev

Rev 4036 | Rev 5039 | 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('Operating system provided'):
11
            os = str(features.get('Operating system provided')[0])
12
 
13
            if os == 'DOS':
14
                score = 7.0  #TODO
15
 
16
            elif os == 'Linux':
17
                score = 9.0  #TODO
18
 
4081 varun.gupt 19
            elif os == 'Windows 7 Starter':
20
                score = 8.0  #TODO
21
 
4036 varun.gupt 22
            elif os == 'Windows 7 Basic':
23
                score = 8.0  #TODO
24
 
25
            elif os == 'Windows 7 Professional':
26
                score = 9.0  #TODO
27
 
4081 varun.gupt 28
            elif os == 'Windows 7 Premium':
29
                score = 9.5  #TODO
4036 varun.gupt 30
 
31
            elif os == 'Windows 7 Ultimate':
32
                score = 10.0  #TODO
33
    return score
34
 
35
 
36
print "expSlide=" + `expSlide`
37
 
38
struct = utils.contentModel2Struct(expSlide, categoryObj)
39
print "struct=" + `struct`
40
 
41
score = getscore(struct)