diff options
| author | Barry Warsaw | 2009-08-09 10:49:35 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2009-08-09 10:49:35 -0400 |
| commit | 9cb2d844baf1ec47bed25fd48e5762ab641b5498 (patch) | |
| tree | 071f4c18deec29c8c270bef8d8d3fd94b6cdaec8 /src/mailman/interfaces/command.py | |
| parent | c4a053b184f16156cafd984b01c055d70414c4b6 (diff) | |
| download | mailman-9cb2d844baf1ec47bed25fd48e5762ab641b5498.tar.gz mailman-9cb2d844baf1ec47bed25fd48e5762ab641b5498.tar.zst mailman-9cb2d844baf1ec47bed25fd48e5762ab641b5498.zip | |
A start on the 'mailman' subcommand layout, with the help of argparse. Right
now the only subcommand is 'lists' which displays all mailing lists like the
old bin/list_lists command did (which is now removed).
Remove bin/version since 'bin/mailman --version' does this for us.
Simplify the calculation of the bin scripts; there will be many fewer of them.
Extend i18n to use a class based structure. By default, all i18n strings are
dedented after translation and substitution, which improves command line
help. The class structure allows for overriding this behavior.
Diffstat (limited to '')
| -rw-r--r-- | src/mailman/interfaces/command.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/mailman/interfaces/command.py b/src/mailman/interfaces/command.py index 9995b80a9..14e7f9dd6 100644 --- a/src/mailman/interfaces/command.py +++ b/src/mailman/interfaces/command.py @@ -22,6 +22,7 @@ from __future__ import absolute_import, unicode_literals __metaclass__ = type __all__ = [ 'ContinueProcessing', + 'ICLISubCommand', 'IEmailCommand', 'IEmailResults', ] @@ -69,5 +70,19 @@ class IEmailCommand(Interface): -class IBinCommand(Interface): - """A command line (i.e. bin) command.""" +class ICLISubCommand(Interface): + """A command line interface subcommand.""" + + def add(subparser): + """Add the subcommand to the subparser. + + :param subparser: The argument subparser. + :type subparser: `argparse.ArgumentParser` + """ + + def process(args): + """Process the subcommand. + + :param args: The namespace, as passed in by argparse. + :type args: `argparse.Namespace` + """ |
