Subversion Repositories SmartDukaan

Rev

Rev 73 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 73 Rev 77
Line 1... Line -...
1
import messaging_math as mathmodel
-
 
2
import utils
1
import utils
3
 
2
 
4
print "expSlide=" + `expSlide`
3
print "expSlide=" + `expSlide`
5
 
4
 
6
struct = utils.contentModel2Struct(expSlide)
5
struct = utils.contentModel2Struct(expSlide)
7
print "struct=" + `struct`
6
print "struct=" + `struct`
8
 
7
 
9
score = mathmodel.getscore(struct)
-
 
10
8
score = 0
-
 
9
 
-
 
10
if struct.has_key("features") :
-
 
11
    features = struct.get("features")
-
 
12
    
-
 
13
    # E-mail Client : 2, 0
-
 
14
    if features.has_key("E-mail Client") :
-
 
15
        score += 2
-
 
16
    
-
 
17
if struct.has_key("childrenslides") :
-
 
18
    childrenslides = struct.get("childrenslides")
-
 
19
    
-
 
20
    if childrenslides.has_key("Types") :
-
 
21
        types = childrenslides.get("Types")
-
 
22
        
-
 
23
        if types.has_key("features") :
-
 
24
            features = types.get("features")
-
 
25
        
-
 
26
            # Types > MMS : 2, 0
-
 
27
            if features.has_key("MMS") :
-
 
28
                score += 2
-
 
29
 
-
 
30
            # Types > SMS : 2, 0
-
 
31
            if features.has_key("SMS") :
-
 
32
                score += 2
-
 
33
 
-
 
34
            # Types > Instant Messaging : 2, 0
-
 
35
            if features.has_key("Instant Messaging") :
-
 
36
                score += 2
-
 
37
 
-
 
38
            # Types > Email : 2, 0
-
 
39
            if features.has_key("Email") :
-
 
40
                score += 2
-
 
41