Skip to content

Commit 7a88310

Browse files
committed
remove field_key parameter from PipetoCommand
I don't think anyone needs anything else but copiousoutput here
1 parent 411b875 commit 7a88310

2 files changed

Lines changed: 9 additions & 16 deletions

File tree

alot/commands/thread.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -610,8 +610,6 @@ def matches(msgt):
610610
'help': 'let the shell interpret the command'}),
611611
(['--notify_stdout'], {'action': 'store_true',
612612
'help': 'display cmd\'s stdout as notification'}),
613-
(['--field_key'], {'help': 'mailcap field key for decoding',
614-
'default': 'copiousoutput'}),
615613
])
616614
class PipeCommand(Command):
617615

@@ -621,8 +619,7 @@ class PipeCommand(Command):
621619
def __init__(self, cmd, all=False, separately=False, background=False,
622620
shell=False, notify_stdout=False, format='raw',
623621
add_tags=False, noop_msg='no command specified',
624-
confirm_msg='', done_msg=None, field_key='copiousoutput',
625-
**kwargs):
622+
confirm_msg='', done_msg=None, **kwargs):
626623
"""
627624
:param cmd: shellcommand to open
628625
:type cmd: str or list of str
@@ -632,15 +629,15 @@ def __init__(self, cmd, all=False, separately=False, background=False,
632629
:type separately: bool
633630
:param background: do not suspend the interface
634631
:type background: bool
635-
:param notify_stdout: display command\'s stdout as notification message
636-
:type notify_stdout: bool
637632
:param shell: let the shell interpret the command
638633
:type shell: bool
639-
640-
'raw': message content as is,
641-
'decoded': message content, decoded quoted printable,
642-
'id': message ids, separated by newlines,
643-
'filepath': paths to message files on disk
634+
:param notify_stdout: display command\'s stdout as notification message
635+
:type notify_stdout: bool
636+
:param format: what to pipe to the processes stdin. one of:
637+
'raw': message content as is,
638+
'decoded': message content, decoded quoted printable,
639+
'id': message ids, separated by newlines,
640+
'filepath': paths to message files on disk
644641
:type format: str
645642
:param add_tags: add 'Tags' header to the message
646643
:type add_tags: bool
@@ -651,8 +648,6 @@ def __init__(self, cmd, all=False, separately=False, background=False,
651648
:type confirm_msg: str
652649
:param done_msg: notification message to show upon success
653650
:type done_msg: str
654-
:param field_key: malcap field key for decoding
655-
:type field_key: str
656651
"""
657652
Command.__init__(self, **kwargs)
658653
if isinstance(cmd, str):
@@ -668,7 +663,6 @@ def __init__(self, cmd, all=False, separately=False, background=False,
668663
self.noop_msg = noop_msg
669664
self.confirm_msg = confirm_msg
670665
self.done_msg = done_msg
671-
self.field_key = field_key
672666

673667
async def apply(self, ui):
674668
# abort if command unset
@@ -712,7 +706,7 @@ async def apply(self, ui):
712706
pipestrings.append(mail.as_string())
713707
elif self.output_format == 'decoded':
714708
headertext = extract_headers(mail)
715-
bodytext = extract_body(mail, field_key=self.field_key)
709+
bodytext = extract_body(mail)
716710
msgtext = '%s\n\n%s' % (headertext, bodytext)
717711
pipestrings.append(msgtext)
718712

docs/source/usage/modes/thread.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ The following commands are available in thread mode:
7878
:---add_tags: add 'Tags' header to the message
7979
:---shell: let the shell interpret the command
8080
:---notify_stdout: display cmd's stdout as notification
81-
:---field_key: mailcap field key for decoding (defaults to: 'copiousoutput')
8281

8382
.. _cmd.thread.print:
8483

0 commit comments

Comments
 (0)