Subversion Repositories SmartDukaan

Rev

Rev 323 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 323 Rev 1915
Line 1... Line 1...
1
def getscore(struct) :
1
def getscore(struct) :
2
    
2
    
3
    score = 0
3
    score = 0.0
4
    
4
    
5
    if struct.has_key("features") :
5
    if struct.has_key("features") :
6
        features = struct.get("features")
6
        features = struct.get("features")
7
        
7
        
8
        # Protocols : Mail for Exchange-3, POP3-1, SMTP-1, IMAP-1, IMAP4-1
8
        # Protocols : Mail for Exchange-3, POP3-1, SMTP-1, IMAP-1, IMAP4-1
9
        if features.has_key("Protocols") :
9
        if features.has_key("Protocols") :
10
            ps = features.get("Protocols")
10
            protocols = features.get("Protocols")
11
            
11
            
12
            if "Mail for Exchange" in ps :
-
 
13
                score += 3
-
 
14
 
-
 
15
            if "POP3" in ps :
-
 
16
                score += 1
-
 
17
                
-
 
18
            if "SMTP" in ps :
-
 
19
                score += 1
-
 
20
                
-
 
21
            if "IMAP" in ps :
12
            if "IMAP" in protocols :
22
                score += 1
13
                score = 10.0
23
                
14
            else:
24
            if "IMAP4" in ps :
-
 
25
                score += 1
15
                score = 7.0
26
                
16
                
27
    return score
17
    return score