summaryrefslogtreecommitdiff
path: root/Mailman/Commands/cmd_lists.py
diff options
context:
space:
mode:
authorbwarsaw2002-05-02 02:54:46 +0000
committerbwarsaw2002-05-02 02:54:46 +0000
commitea909c059b1c1671adbb995d292649482277ad95 (patch)
tree183863b01c5835627d7edbf0aac6e6c2fcc1d067 /Mailman/Commands/cmd_lists.py
parent8550439af7c64c4c2a857318388be5a202dd3292 (diff)
downloadmailman-ea909c059b1c1671adbb995d292649482277ad95.tar.gz
mailman-ea909c059b1c1671adbb995d292649482277ad95.tar.zst
mailman-ea909c059b1c1671adbb995d292649482277ad95.zip
Diffstat (limited to 'Mailman/Commands/cmd_lists.py')
-rw-r--r--Mailman/Commands/cmd_lists.py63
1 files changed, 63 insertions, 0 deletions
diff --git a/Mailman/Commands/cmd_lists.py b/Mailman/Commands/cmd_lists.py
new file mode 100644
index 000000000..0708df2a0
--- /dev/null
+++ b/Mailman/Commands/cmd_lists.py
@@ -0,0 +1,63 @@
+# Copyright (C) 2002 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
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+"""
+ lists
+ See a list of the public mailing lists on this GNU Mailman server.
+"""
+
+from Mailman import Utils
+from Mailman.MailList import MailList
+from Mailman.i18n import _
+
+
+STOP = 1
+
+
+
+def gethelp(mlist):
+ return _(__doc__)
+
+
+
+def process(res, args):
+ mlist = res.mlist
+ if args:
+ res.results.append(_('Usage:'))
+ res.results.append(gethelp(mlist))
+ return STOP
+ hostname = mlist.host_name
+ res.results.append(_('Public mailing lists at %(hostname)s:'))
+ lists = Utils.list_names()
+ lists.sort()
+ i = 1
+ for listname in lists:
+ if listname == mlist.internal_name():
+ xlist = mlist
+ else:
+ xlist = MailList(listname, lock=0)
+ # We can mention this list if you already know about it
+ if not xlist.advertised and xlist is not mlist:
+ continue
+ realname = xlist.real_name
+ description = xlist.description or _('n/a')
+ requestaddr = xlist.GetRequestEmail()
+ if i > 1:
+ res.results.append('')
+ res.results.append(_('%(i)3d. List name: %(realname)s'))
+ res.results.append(_(' Description: %(description)s'))
+ res.results.append(_(' Requests to: %(requestaddr)s'))
+ i += 1