Subversion Repositories SmartDukaan

Rev

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

Rev 71 Rev 75
Line 1... Line 1...
1
def getscore(struct):
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
 
2
    return 7
31
    return score