[Mailman-Developers] problem with view other subscriptions..

Harald Meland Harald.Meland@usit.uio.no
19 May 2000 15:29:47 +0200


--=-=-=

[Matt Davis]

> Applied all patches & got this..

Oops.  At first I called the new function argument "mlist", but a
little later I renamed it to "from_mlist".  However, I forgot to make
the same change in the function's body.  The fix should be rather
straightforward to do by hand, but here it is as a patch (against
current CVS, not your patched version of the file).


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline

Index: Utils.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Utils.py,v
retrieving revision 1.87
diff -u -r1.87 Utils.py
--- Utils.py	2000/04/09 21:03:31	1.87
+++ Utils.py	2000/05/19 13:24:50
@@ -409,16 +409,20 @@
 
 
 
-def map_maillists(func, names=None, unlock=None, verbose=0):
+def map_maillists(func, names=None, lock=1, verbose=0, from_mlist=None):
     """Apply function (of one argument) to all list objs in turn.
 
     Returns a list of the results.
 
     Optional arg 'names' specifies which lists, default all.
-    Optional arg unlock says to unlock immediately after instantiation.
+    Optional arg lock says whether or not to lock the list on instantiation.
     Optional arg verbose says to print list name as it's about to be
     instantiated, CR when instantiation is complete, and result of
-    application as it shows."""
+    application as it shows.
+    Optional arg from_mlist is an already instantiated list object, which
+    should neither be re-instantiated nor unlocked.
+
+    """
     from Mailman import MailList
     if names == None:
         names = list_names()
@@ -426,15 +430,16 @@
     for i in names:
 	if verbose:
             print i,
-	l = MailList.MailList(i)
+	if from_mlist and from_mlist.internal_name() == i:
+            l = from_mlist
+        else:
+            MailList.MailList(i, lock=lock)
 	if verbose:
             print
-	if unlock and l.Locked():
-	    l.Unlock()
 	got.append(apply(func, (l,)))
 	if verbose:
             print got[-1]
-	if not unlock:
+	if not (from_mlist and from_mlist.internal_name() == i):
 	    l.Unlock()
 	del l
     return got

--=-=-=
Content-Disposition: inline

Sorry that it is still untested,
-- 
Harald

--=-=-=--