Subversion Repositories SmartDukaan

Rev

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

Rev 2657 Rev 8045
Line 9... Line 9...
9
    additional_camera_features_score = 0.0
9
    additional_camera_features_score = 0.0
10
 
10
 
11
    if struct.has_key("features") :
11
    if struct.has_key("features") :
12
        features = struct.get("features")
12
        features = struct.get("features")
13
        
13
        
14
        if features.has_key("Resolution") :
14
        if features.has_key("Front camera") :
15
            resolution = features.get("Resolution") 
15
            resolution = features.get("Back camera") 
16
            if len(resolution) > 0 :
16
            if len(resolution) > 0 :
17
                resolution = float(resolution[0])
17
                resolution = float(resolution[0])
18
                print "resolution=" + `resolution`
18
                print "resolution=" + `resolution`
19
                
19
                
20
                if resolution <= 1.0 :
20
                if resolution <= 1.0 :
Line 62... Line 62...
62
            if len(additional_camera_features) > 10 :
62
            if len(additional_camera_features) > 10 :
63
                additional_camera_features_score = 10.0
63
                additional_camera_features_score = 10.0
64
            else:
64
            else:
65
                additional_camera_features_score = len(additional_camera_features) 
65
                additional_camera_features_score = len(additional_camera_features) 
66
    
66
    
67
        if features.has_key("Secondary camera") :
67
        if features.has_key("Front camera") :
68
            secondary_camera_score = 10.0
68
            secondary_camera_score = 10.0
69
 
69
 
70
        print "resolution_score" + `resolution_score`
70
        print "resolution_score" + `resolution_score`
71
        print "flash_score" + `flash_score`
71
        print "flash_score" + `flash_score`
72
        print "image_formats_score" + `image_formats_score`
72
        print "image_formats_score" + `image_formats_score`
73
        print "secondary_camera_score" +  `secondary_camera_score`
73
        print "secondary_camera_score" +  `secondary_camera_score`
74
        print "additional_camera_features_score" + `additional_camera_features_score`
74
        print "additional_camera_features_score" + `additional_camera_features_score`
75
            
75
            
76
        score = (30*resolution_score + 30*flash_score + 20*image_formats_score + 10*secondary_camera_score + 10*additional_camera_features_score) / 100
76
        score = (40*resolution_score + 20*flash_score + 20*image_formats_score + 10*secondary_camera_score + 10*additional_camera_features_score) / 100
77
 
77
 
78
    return score
78
    return score