From 75e84d50f814f94a118edbde3761110df5d9861c Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Wed, 25 Sep 2024 09:21:55 +0200 Subject: [PATCH] put output folder in a variable --- imap2md/export-imap-notes.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/imap2md/export-imap-notes.py b/imap2md/export-imap-notes.py index 975e3c5..0328f7f 100644 --- a/imap2md/export-imap-notes.py +++ b/imap2md/export-imap-notes.py @@ -8,10 +8,11 @@ import re username = "" password = "" imapserver = "" +folder = "notes" N = 500 -if not os.path.isdir('notes'): - os.mkdir('notes') +if not os.path.isdir(folder): + os.mkdir(folder) imap = imaplib.IMAP4_SSL(imapserver) imap.login(username, password) @@ -35,7 +36,7 @@ for i in range(messages, max(0, messages-N), -1): print(str(i) + ' - ' + subject) filepath = subject + '.md' - filepath = os.path.join('notes', filepath) + filepath = os.path.join(folder, filepath) if msg.is_multipart(): for part in msg.walk():