Subversion Repositories SmartDukaan

Rev

Rev 77 | Rev 1915 | 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")
    
        # GPRS : 1, 0
        if features.has_key("GPRS") :
            score += 1

        # EDGE : 1, 0
        if features.has_key("EDGE") :
            score += 1
        
        # 3G : 2, 0
        if features.has_key("3G") :
            score += 2
        
        # WLAN : 2, 0
        if features.has_key("WLAN") :
            score += 2
        
        # Bluetooth : 1, 0
        if features.has_key("Bluetooth") :
            score += 1
         
        # USB : 1, 0
        if features.has_key("USB") :
            score += 1

    return score