Subversion Repositories SmartDukaan

Rev

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

Rev 323 Rev 1915
Line 1... Line 1...
1
def getscore(struct):
1
def getscore(struct):
2
 
2
 
3
    score = 0
3
    score = 0.0
-
 
4
    
4
    
5
    
5
    if struct.has_key("features") :
6
    if struct.has_key("features") :
6
        features = struct.get("features")
7
        features = struct.get("features")
7
        
8
        
8
        # GPS Type : Integrated GPS-4, Bluetooth GPS-2
9
        # GPS Type : Integrated GPS-4, Bluetooth GPS-2
9
        if features.has_key("GPS Type") :
10
        if features.has_key("GPS type") :
10
           gpstype = features.get("GPS Type")
11
           gps_type = features.get("GPS type")
11
           
12
           
12
           if "Integrated GPS" in gpstype :
13
           if "Integrated GPS" in gps_type :
13
                score += 4
14
                score += 5
14
                
15
                
15
           if "Bluetooth GPS" in gpstype :
16
           if "A-GPS" in gps_type :
16
                score += 2
17
                score += 5
17
         
18
         
18
        # A-GPS : 2, 0
-
 
19
        if features.has_key("A-GPS") :
-
 
20
            score += 2
-
 
21
            
-
 
22
    return score
19
    return score