Subversion Repositories SmartDukaan

Rev

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

def getscore(struct) :
    score = 0
    if not struct.has_key("features") :
        return score
    
    features = struct.get("features")
    
    # REVISIT - May be we should count supported formats
    if features.has_key("Ringtone Types") :
        score = score + 1 
    
    # REVISIT - May be we should count supported formats
    if features.has_key("Music Formats") :
        score = score + 1 
        
    if features.has_key("FM Radio") :
        score = score + 1 
        
    if features.has_key("Headset") :
        score = score + 1 

    if features.has_key("Album art") :
        score = score + 1 

    if features.has_key("Speaker phone") :
        score = score + 1 

    if features.has_key("Internet Radio") :
        score = score + 2 

    return score