Subversion Repositories SmartDukaan

Rev

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

Rev 71 Rev 77
Line 1... Line 1...
1
def getscore(struct):
1
def getscore(struct) :
-
 
2
    
2
    return 5
3
    score = 0
-
 
4
    
-
 
5
    if struct.has_key("features") :
-
 
6
        features = struct.get("features")
-
 
7
    
-
 
8
        # GPRS : 1, 0
-
 
9
        if features.has_key("GPRS") :
-
 
10
            score += 1
-
 
11
 
-
 
12
        # EDGE : 1, 0
-
 
13
        if features.has_key("EDGE") :
-
 
14
            score += 1
-
 
15
        
-
 
16
        # 3G : 2, 0
-
 
17
        if features.has_key("3G") :
-
 
18
            score += 2
-
 
19
        
-
 
20
        # WLAN : 2, 0
-
 
21
        if features.has_key("WLAN") :
-
 
22
            score += 2
-
 
23
        
-
 
24
        # Bluetooth : 1, 0
-
 
25
        if features.has_key("Bluetooth") :
-
 
26
            score += 1
-
 
27
         
-
 
28
        # USB : 1, 0
-
 
29
        if features.has_key("USB") :
-
 
30
            score += 1
-
 
31
 
-
 
32
    return score