Update of /cvsroot/tmda/tmda/TMDA
In directory sc8-pr-cvs1:/tmp/cvs-serv32271/TMDA
Modified Files:
ChangeLog FilterParser.py
Log Message:
A more flexible implementation of -domains.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/ChangeLog,v
retrieving revision 1.258
retrieving revision 1.259
diff -u -r1.258 -r1.259
--- ChangeLog 12 Mar 2003 20:56:50 -0000 1.258
+++ ChangeLog 24 Mar 2003 19:53:12 -0000 1.259
@@ -3,9 +3,9 @@
* FilterParser.py (_FilterFile.__init__): Add `-domains', a new
argument for from-(file|cdb|dbm) and to-(file|cdb|dbm).
- (FilterParser.__add_domains): New method.
+ (FilterParser.__extract_domains): New method.
- (FilterParser.firstmatch): Use __add_domains if the `-domains'
+ (FilterParser.firstmatch): Use __extract_domains if the `-domains'
argument is specified.
2003-03-04 Jason R. Mastaler <[EMAIL PROTECTED]>
Index: FilterParser.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/FilterParser.py,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- FilterParser.py 23 Mar 2003 23:24:34 -0000 1.52
+++ FilterParser.py 24 Mar 2003 19:53:13 -0000 1.53
@@ -829,10 +829,9 @@
return (dbname, search_func)
- def __add_domains(self, keys):
+ def __extract_domains(self, keys):
"""
- Attempt to extract the domain names from each address in keys.
- Add these to keys and return the combined list.
+ Attempt to extract the domain name from each address in keys.
"""
domains = []
for k in keys:
@@ -840,7 +839,7 @@
domains.append(k.split('@', 1)[1])
except IndexError:
pass
- return keys + domains
+ return domains
def firstmatch(self, recipient, senders=None,
@@ -870,7 +869,7 @@
dbname = os.path.expanduser(match)
search_func = self.__search_file
if args.has_key('domains'):
- keys = self.__add_domains(keys)
+ keys += self.__extract_domains(keys)
# If we have an 'auto*' argument, ensure that the database
# is up-to-date. If the 'optional' argument is also given,
# don't die if the file doesn't exist.
@@ -899,7 +898,7 @@
import anydbm
match = os.path.expanduser(match)
if args.has_key('domains'):
- keys = self.__add_domains(keys)
+ keys += self.__extract_domains(keys)
try:
found_match = self.__search_dbm(match, keys,
actions, source)
@@ -913,7 +912,7 @@
import cdb
match = os.path.expanduser(match)
if args.has_key('domains'):
- keys = self.__add_domains(keys)
+ keys += self.__extract_domains(keys)
try:
found_match = self.__search_cdb(match, keys,
actions, source)
_______________________________________
tmda-cvs mailing list
http://tmda.net/lists/listinfo/tmda-cvs