Subversion Repositories SmartDukaan

Rev

Rev 4081 | Rev 5206 | 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
5039 amit.gupta 33
 
34
            elif os == 'Mac OS X 10.4 Tiger':
35
                score = 8.0  #TODO
36
 
37
            elif os == 'Mac OS X 10.5 Leopard':
38
                score = 8.5  #TODO
39
 
40
            elif os == 'Mac OS X 10.6 Snow Leopard':
41
                score = 9.0  #TODO
42
 
43
            elif os == 'Mac OS X 10.7 Lion':
44
                score = 9.5  #TODO
45
 
4036 varun.gupt 46
    return score
47
 
48
 
49
print "expSlide=" + `expSlide`
50
 
51
struct = utils.contentModel2Struct(expSlide, categoryObj)
52
print "struct=" + `struct`
53
 
54
score = getscore(struct)