From cc164830f42a65bd962642961bc5368e4ace6cd5 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Tue, 18 May 2021 17:11:38 -0400 Subject: Tweak output filenames Save am-able maildirs as .eml files, as this is more likely to be properly recognized format-wise by vim and friends. Signed-off-by: Konstantin Ryabitsev --- b4/mbox.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/b4/mbox.py b/b4/mbox.py index 9c8de3f..850558f 100644 --- a/b4/mbox.py +++ b/b4/mbox.py @@ -128,7 +128,7 @@ def make_am(msgs, cmdargs, msgid): d_cur = os.path.join(am_filename, 'cur') pathlib.Path(d_cur).mkdir(parents=True) for m_slug, msg in am_msgs: - with open(os.path.join(d_new, m_slug), 'wb') as mfh: + with open(os.path.join(d_new, f'{m_slug}.eml'), 'wb') as mfh: mfh.write(msg.as_bytes(policy=b4.emlpolicy)) else: with open(am_filename, 'wb') as fh: @@ -629,13 +629,13 @@ def main(cmdargs): if b4.LoreMessage.get_clean_msgid(msg) not in have_msgids: added += 1 mdr.add(msg) - logger.info('Added to %s messages to maildir %s', added, cmdargs.outdir) + logger.info('Added %s messages to maildir %s', added, cmdargs.outdir) return config = b4.get_main_config() if cmdargs.maildir or config.get('save-maildirs', 'no') == 'yes': save_maildir = True - dftext = 'thread' + dftext = 'maildir' else: save_maildir = False dftext = 'mbx' -- cgit v1.2.3