Subversion Repositories SmartDukaan

Rev

Rev 77 | Rev 1915 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
77 naveen 1
def getscore(struct) :
2
 
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