From 2d96d3432ca9b66a595e76b94f90bfb861538a9c Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Fri, 10 Dec 1999 00:02:09 +0000 Subject: test harness can take a list of file names --- Mailman/Bouncers/BouncerAPI.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Mailman/Bouncers/BouncerAPI.py b/Mailman/Bouncers/BouncerAPI.py index 621e08115..7435ebf80 100644 --- a/Mailman/Bouncers/BouncerAPI.py +++ b/Mailman/Bouncers/BouncerAPI.py @@ -51,7 +51,7 @@ def ScanMessages(mlist, msg, testing=0): if not testing: mlist.RegisterBounce(addr, msg) else: - print 'Bounce of %s detected by module %s' % ( + print ' Bounce of %s detected by module %s' % ( addr, modname) # we saw some bounces return 1 @@ -71,13 +71,15 @@ if __name__ == '__main__': print msg sys.exit(code) - if len(sys.argv) <> 3: - usage(1, 'required arguments: ') + if len(sys.argv) < 3: + usage(1, 'required arguments: [, ...]') listname = sys.argv[1] - filename = sys.argv[2] - mlist = MailList.MailList(listname, lock=0) - fp = open(filename) - msg = mimetools.Message(fp) - ScanMessages(mlist, msg, testing=1) + + for filename in sys.argv[2:]: + print 'scanning file', filename + fp = open(filename) + msg = mimetools.Message(fp) + ScanMessages(mlist, msg, testing=1) + fp.close() -- cgit v1.2.3-70-g09d2