Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
75 naveen 1
def getscore(struct) :
2
    score = 0
3
    if not struct.has_key("features") :
4
        return score
5
 
6
    features = struct.get("features")
7
 
8
    # REVISIT - May be we should count supported formats
9
    if features.has_key("Ringtone Types") :
10
        score = score + 1 
11
 
12
    # REVISIT - May be we should count supported formats
13
    if features.has_key("Music Formats") :
14
        score = score + 1 
15
 
16
    if features.has_key("FM Radio") :
17
        score = score + 1 
18
 
19
    if features.has_key("Headset") :
20
        score = score + 1 
21
 
22
    if features.has_key("Album art") :
23
        score = score + 1 
24
 
25
    if features.has_key("Speaker phone") :
26
        score = score + 1 
27
 
28
    if features.has_key("Internet Radio") :
29
        score = score + 2 
30
 
31
    return score