diff options
| author | Barry Warsaw | 2009-11-24 23:36:14 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2009-11-24 23:36:14 -0500 |
| commit | a26ed5b02a76dd26a72eb8acad819be47dca3049 (patch) | |
| tree | 916a3a0cacd895519e891cef83930e01c6f3503c /src/mailman/commands/cli_inject.py | |
| parent | 79d9e36a0b824548a0f2bc83cb948fc5ce668151 (diff) | |
| download | mailman-a26ed5b02a76dd26a72eb8acad819be47dca3049.tar.gz mailman-a26ed5b02a76dd26a72eb8acad819be47dca3049.tar.zst mailman-a26ed5b02a76dd26a72eb8acad819be47dca3049.zip | |
Diffstat (limited to 'src/mailman/commands/cli_inject.py')
| -rw-r--r-- | src/mailman/commands/cli_inject.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mailman/commands/cli_inject.py b/src/mailman/commands/cli_inject.py index 025dcb036..8b7570e0a 100644 --- a/src/mailman/commands/cli_inject.py +++ b/src/mailman/commands/cli_inject.py @@ -60,13 +60,12 @@ class Inject: help=_('Show a list of all available queue names and exit.')) command_parser.add_argument( '-f', '--filename', - type='string', help=_(""" + type=unicode, help=_(""" Name of file containing the message to inject. If not given, or - '-' (without the quotes) standard input is used. - """)) + '-' (without the quotes) standard input is used.""")) # Required positional argument. command_parser.add_argument( - 'listname', metavar='LISTNAME', nargs='?', + 'listname', metavar='LISTNAME', nargs=1, help=_("""\ The 'fully qualified list name', i.e. the posting address of the mailing list to inject the message into.""")) @@ -97,7 +96,11 @@ class Inject: self.parser.error(_('No such queue: $queue')) return if args.filename in (None, '-'): - message_text = sys.stdin.read() + try: + message_text = sys.stdin.read() + except KeyboardInterrupt: + print 'Interrupted' + sys.exit(1) else: with open(args.filename) as fp: message_text = fp.read() |
