Subversion Repositories SmartDukaan

Rev

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