diff options
| author | bwarsaw | 2002-05-02 02:54:46 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-05-02 02:54:46 +0000 |
| commit | ea909c059b1c1671adbb995d292649482277ad95 (patch) | |
| tree | 183863b01c5835627d7edbf0aac6e6c2fcc1d067 /Mailman/Commands/cmd_info.py | |
| parent | 8550439af7c64c4c2a857318388be5a202dd3292 (diff) | |
| download | mailman-ea909c059b1c1671adbb995d292649482277ad95.tar.gz mailman-ea909c059b1c1671adbb995d292649482277ad95.tar.zst mailman-ea909c059b1c1671adbb995d292649482277ad95.zip | |
New architecture for email commands. Instead of the monolithic (and
unmaintainable) MailCommandHandler.py file, we've now got a framework
where each command is implemented in a separate file. This means it's
both more extensible and more flexible:
- you can easily add new commands for things I haven't thought of
<wink>, and the `help' command will automatically adjust
- you can disable commands entirely by removing the appropriate file
- you can disable, change, or add commands on a per-list (or even
per-message or per-sender) basis
CommandRunner.py is the module that calls into this framework. Each
command is implemented as a cmd_<command>.py file. The `set' command
is the most complicated. The help text is currently implemented as
module docstrings (for most commands), so the i18n catalogs must be
updated. Also the help.txt files will be updated.
Diffstat (limited to 'Mailman/Commands/cmd_info.py')
| -rw-r--r-- | Mailman/Commands/cmd_info.py | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/Mailman/Commands/cmd_info.py b/Mailman/Commands/cmd_info.py new file mode 100644 index 000000000..1c28da70e --- /dev/null +++ b/Mailman/Commands/cmd_info.py @@ -0,0 +1,49 @@ +# 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. + +""" + info + Get information about this mailing list. +""" + +from Mailman.i18n import _ + +STOP = 1 + + + +def gethelp(mlist): + return _(__doc__) + + + +def process(res, args): + mlist = res.mlist + if args: + res.results.append(gethelp(mlist)) + return STOP + listname = mlist.real_name + description = mlist.description or _('n/a') + postaddr = mlist.GetListEmail() + requestaddr = mlist.GetRequestEmail() + owneraddr = mlist.GetOwnerEmail() + listurl = mlist.GetScriptURL('listinfo', absolute=1) + res.results.append(_('List name: %(listname)s')) + res.results.append(_('Description: %(description)s')) + res.results.append(_('Postings to: %(postaddr)s')) + res.results.append(_('List Helpbot: %(requestaddr)s')) + res.results.append(_('List Owners: %(owneraddr)s')) + res.results.append(_('More information: %(listurl)s')) |
