Package ProcImap :: Package Utils :: Module Processing :: Class AddressListFile
[hide private]
[frames] | no frames]

Class AddressListFile

source code

This class wraps around a file containing emailadresses. It is intended to help with Whitelisting, Blacklisting, etc.

Instance Methods [hide private]
 
__init__(self, filename, inmemory=False, regexes=False)
Initialize AddressListFile: If inmemory is True, the file is loaded into memory.
source code
 
contains(self, lookupstring)
Return True if there is a line in the represented file that is contained in lookupstring.
source code
 
add(self, line)
Add line to self.filename
source code
Method Details [hide private]

__init__(self, filename, inmemory=False, regexes=False)
(Constructor)

source code 

Initialize AddressListFile: If inmemory is True, the file is loaded into memory. If regexes is True, the lines in the file are compiled as regexes.

contains(self, lookupstring)

source code 

Return True if there is a line in the represented file that is contained in lookupstring. E.g., if you search for 'someone@gmail.com' and the file contains a line '@gmail.com', True is returned. If regexes are used, return True if there is a regex in the file that matches the lookupstring completely.