diff options
author | Mark Sapiro <mark@msapiro.net> | 2016-09-02 11:54:08 -0700 |
---|---|---|
committer | Mark Sapiro <mark@msapiro.net> | 2016-09-02 11:54:08 -0700 |
commit | 2ab16e2cd8ac34c27c8cf8a757a9d25de9509254 (patch) | |
tree | 8c95b2bd0f3ef46f16874b52e8fd988ec17681f2 /cron/senddigests | |
parent | 1652e6d6bc935f17bef2895cb1d94840ca893e2b (diff) | |
download | mailman2-2ab16e2cd8ac34c27c8cf8a757a9d25de9509254.tar.gz mailman2-2ab16e2cd8ac34c27c8cf8a757a9d25de9509254.tar.xz mailman2-2ab16e2cd8ac34c27c8cf8a757a9d25de9509254.zip |
Added -e/--exceptlist to cron/senddigests.
Diffstat (limited to '')
-rwxr-xr-x | cron/senddigests | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/cron/senddigests b/cron/senddigests index edf27a2a..9997096c 100755 --- a/cron/senddigests +++ b/cron/senddigests @@ -1,6 +1,6 @@ #! @PYTHON@ # -# Copyright (C) 1998-2007 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -28,7 +28,12 @@ Options: -l listname --listname=listname Send the digest for the given list only, otherwise the digests for all - lists are sent out. + lists are sent out. May be repeated to do multiple lists. + + -e listname + --exceptlist listname + Don't send the digest for the given list. May be repeated to skip + multiple lists. """ import os @@ -63,22 +68,31 @@ def usage(code, msg=''): def main(): try: - opts, args = getopt.getopt(sys.argv[1:], 'hl:', ['help', 'listname=']) + opts, args = getopt.getopt(sys.argv[1:], 'hl:e:', + ['help', 'listname=', 'exceptlist=']) except getopt.error, msg: usage(1, msg) if args: usage(1) + exceptlists = [] listnames = [] for opt, arg in opts: if opt in ('-h', '--help'): usage(0) elif opt in ('-l', '--listname'): listnames.append(arg) + elif opt in ('-e', '--exceptlist'): + exceptlists.append(arg) if not listnames: listnames = Utils.list_names() + for listname in exceptlists: + try: + listnames.remove(listname) + except ValueError: + pass for listname in listnames: mlist = MailList.MailList(listname, lock=0) |