summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-05-18 17:11:38 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-05-18 17:11:38 -0400
commitcc164830f42a65bd962642961bc5368e4ace6cd5 (patch)
tree7b1a1764747c1ace4f5ba0fd07bb5224a9568b54
parent8744478eaa56fe42c77481042984e4d1c95e5124 (diff)
downloadb4-cc164830f42a65bd962642961bc5368e4ace6cd5.tar.gz
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 <konstantin@linuxfoundation.org>
-rw-r--r--b4/mbox.py6
1 files 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'