------------------------------------------------------------
revno: 1673
fixes bug: https://launchpad.net/bugs/1619770
committer: Mark Sapiro <m...@msapiro.net>
branch nick: 2.1
timestamp: Fri 2016-09-02 11:54:08 -0700
message:
  Added -e/--exceptlist to cron/senddigests.
modified:
  NEWS
  cron/senddigests


--
lp:mailman/2.1
https://code.launchpad.net/~mailman-coders/mailman/2.1

Your team Mailman Checkins is subscribed to branch lp:mailman/2.1.
To unsubscribe from this branch go to 
https://code.launchpad.net/~mailman-coders/mailman/2.1/+edit-subscription
=== modified file 'NEWS'
--- NEWS	2016-08-28 00:51:58 +0000
+++ NEWS	2016-09-02 18:54:08 +0000
@@ -7,6 +7,11 @@
 
 2.1.24 (xx-xxx-xxxx)
 
+  New Features
+
+    - cron/senddigests has a new -e/--exceptlist option to send pending
+      digests for all but a named list.  (LP: #1619770)
+
   i18n
 
     - The Japanese translation has been updated by Yasuhito FUTATSUKI.

=== modified file 'cron/senddigests'
--- cron/senddigests	2008-06-29 20:31:47 +0000
+++ cron/senddigests	2016-09-02 18:54:08 +0000
@@ -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 @@
     -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 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)

_______________________________________________
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to