diff options
| author | Barry Warsaw | 2008-08-12 23:33:48 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2008-08-12 23:33:48 -0400 |
| commit | 1822c649436477bbfc81ab036933529abe83bbf2 (patch) | |
| tree | fb829429cebc8c4d2129788ce7e8f52608bac5bc /mailman/commands/docs | |
| parent | b42f3204f7223f3ce9ae306dcb2cec10853eca8d (diff) | |
| parent | ae24685f77661f19ee0357e9328737b6a3251596 (diff) | |
| download | mailman-1822c649436477bbfc81ab036933529abe83bbf2.tar.gz mailman-1822c649436477bbfc81ab036933529abe83bbf2.tar.zst mailman-1822c649436477bbfc81ab036933529abe83bbf2.zip | |
Merge in command refactoring branch.
Begin to flesh out the tests for the join command.
Refactor out notifications from the add_member() function.
Diffstat (limited to 'mailman/commands/docs')
| -rw-r--r-- | mailman/commands/docs/echo.txt | 31 | ||||
| -rw-r--r-- | mailman/commands/docs/end.txt | 38 | ||||
| -rw-r--r-- | mailman/commands/docs/join.txt | 60 |
3 files changed, 129 insertions, 0 deletions
diff --git a/mailman/commands/docs/echo.txt b/mailman/commands/docs/echo.txt new file mode 100644 index 000000000..d2781d330 --- /dev/null +++ b/mailman/commands/docs/echo.txt @@ -0,0 +1,31 @@ +The 'echo' command +================== + +The mail command 'echo' simply replies with the original command and arguments +to the sender. + + >>> from mailman.configuration import config + >>> command = config.commands['echo'] + >>> command.name + 'echo' + >>> command.argument_description + '[args]' + >>> command.description + u'Echo an acknowledgement. Arguments are return unchanged.' + +The original message is ignored, but the results receive the echoed command. + + >>> from mailman.app.lifecycle import create_list + >>> mlist = create_list(u'test@example.com') + + >>> from mailman.queue.command import Results + >>> results = Results() + + >>> from mailman.Message import Message + >>> print command.process(mlist, Message(), {}, ('foo', 'bar'), results) + ContinueProcessing.yes + >>> print unicode(results) + The results of your email command are provided below. + <BLANKLINE> + echo foo bar + <BLANKLINE> diff --git a/mailman/commands/docs/end.txt b/mailman/commands/docs/end.txt new file mode 100644 index 000000000..bd632de48 --- /dev/null +++ b/mailman/commands/docs/end.txt @@ -0,0 +1,38 @@ +The 'end' command +================= + +The mail command processor recognized an 'end' command which tells it to stop +processing email messages. + + >>> from mailman.configuration import config + >>> command = config.commands['end'] + >>> command.name + 'end' + >>> command.description + u'Stop processing commands.' + +The 'end' command takes no arguments. + + >>> command.argument_description + '' + +The command itself is fairly simple; it just stops command processing, and the +message isn't even looked at. + + >>> from mailman.app.lifecycle import create_list + >>> mlist = create_list(u'test@example.com') + >>> from mailman.Message import Message + >>> print command.process(mlist, Message(), {}, (), None) + ContinueProcessing.no + +The 'stop' command is a synonym for 'end'. + + >>> command = config.commands['stop'] + >>> command.name + 'stop' + >>> command.description + u'Stop processing commands.' + >>> command.argument_description + '' + >>> print command.process(mlist, Message(), {}, (), None) + ContinueProcessing.no diff --git a/mailman/commands/docs/join.txt b/mailman/commands/docs/join.txt new file mode 100644 index 000000000..75a8ac8ea --- /dev/null +++ b/mailman/commands/docs/join.txt @@ -0,0 +1,60 @@ +The 'join' command +================== + +The mail command 'join' subscribes an email address to the mailing list. +'subscribe' is an alias for 'join'. + + >>> from mailman.configuration import config + >>> command = config.commands['join'] + >>> print command.name + join + >>> print command.description + Join this mailing list. You will be asked to confirm your subscription + request and you may be issued a provisional password. + <BLANKLINE> + By using the 'digest' option, you can specify whether you want digest + delivery or not. If not specified, the mailing list's default will be + used. You can also subscribe an alternative address by using the + 'address' option. For example: + <BLANKLINE> + join address=myotheraddress@example.com + <BLANKLINE> + >>> print command.argument_description + [digest=<yes|no>] [address=<address>] + + +No address to join +------------------ + + >>> from mailman.Message import Message + >>> from mailman.app.lifecycle import create_list + >>> from mailman.queue.command import Results + >>> mlist = create_list(u'test@example.com') + +When no address argument is given, the message's From address will be used. +If that's missing though, then an error is returned. + + >>> results = Results() + >>> print command.process(mlist, Message(), {}, (), results) + ContinueProcessing.no + >>> print unicode(results) + The results of your email command are provided below. + <BLANKLINE> + join: No valid address found to subscribe + <BLANKLINE> + +The 'subscribe' command is an alias. + + >>> subscribe = config.commands['subscribe'] + >>> print subscribe.name + subscribe + >>> results = Results() + >>> print subscribe.process(mlist, Message(), {}, (), results) + ContinueProcessing.no + >>> print unicode(results) + The results of your email command are provided below. + <BLANKLINE> + subscribe: No valid address found to subscribe + <BLANKLINE> + + |
