1
# Copyright (C) 2002 by the Free Software Foundation, Inc.
3
# This program is free software; you can redistribute it and/or
4
# modify it under the terms of the GNU General Public License
5
# as published by the Free Software Foundation; either version 2
6
# of the License, or (at your option) any later version.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
Print this help message.
25
from Mailman import mm_cfg
26
from Mailman import Utils
27
from Mailman.i18n import _
38
def process(res, args):
39
# Get the help text introduction
41
# Since this message is personalized, add some useful information if the
42
# address requesting help is a member of the list.
44
for sender in msg.get_senders():
45
if mlist.isMember(sender):
46
memberurl = mlist.GetOptionsURL(sender, absolute=1)
48
'You can access your personal options via the following url:')
49
res.results.append(urlhelp)
50
res.results.append(memberurl)
51
# Get a blank line in the output.
52
res.results.append('')
54
# build the specific command helps from the module docstrings
56
import Mailman.Commands
57
path = os.path.dirname(os.path.abspath(Mailman.Commands.__file__))
58
for file in os.listdir(path):
59
if not file.startswith('cmd_') or not file.endswith('.py'):
61
module = os.path.splitext(file)[0]
62
modname = 'Mailman.Commands.' + module
69
if hasattr(sys.modules[modname], 'gethelp'):
70
help = sys.modules[modname].gethelp(mlist)
72
modhelps[cmdname] = help
73
# Now sort the command helps
75
keys = modhelps.keys()
78
helptext.append(modhelps[cmd])
79
commands = EMPTYSTRING.join(helptext)
80
# Now craft the response
81
helptext = Utils.maketext(
83
{'listname' : mlist.real_name,
84
'version' : mm_cfg.VERSION,
85
'listinfo_url': mlist.GetScriptURL('listinfo', absolute=1),
86
'requestaddr' : mlist.GetRequestEmail(),
87
'adminaddr' : mlist.GetOwnerEmail(),
88
'commands' : commands,
89
}, mlist=mlist, lang=res.msgdata['lang'], raw=1)
90
# Now add to the response
91
res.results.append('help')
92
res.results.append(helptext)