Subversion Repositories SmartDukaan

Rev

Rev 78 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

def getscore(struct):

    score = 0
    
    if struct.has_key("features") :
        features = struct.get("features")
        
        # GPS Type : Integrated GPS-4, Bluetooth GPS-2
        if features.has_key("GPS Type") :
           gpstype = features.get("GPS Type")
           
           if "Integrated GPS" in gpstype :
                score += 4
                
           if "Bluetooth GPS" in gpstype :
                score += 2
         
        # A-GPS : 2, 0
        if features.has_key("A-GPS") :
            score += 2
            
    return score