drop file name cleanup
This commit is contained in:
parent
f1fc5a24c1
commit
a03e5fc26c
|
@ -12,8 +12,8 @@ N = 500
|
||||||
if not os.path.isdir('notes'):
|
if not os.path.isdir('notes'):
|
||||||
os.mkdir('notes')
|
os.mkdir('notes')
|
||||||
|
|
||||||
def clean(text):
|
# def clean(text):
|
||||||
return "".join(c if c.isalnum() else "_" for c in text)
|
# return "".join(c if c.isalnum() else "_" for c in text)
|
||||||
|
|
||||||
imap = imaplib.IMAP4_SSL(imapserver)
|
imap = imaplib.IMAP4_SSL(imapserver)
|
||||||
imap.login(username, password)
|
imap.login(username, password)
|
||||||
|
@ -36,7 +36,7 @@ for i in range(messages, messages-N, -1):
|
||||||
From = From.decode(encoding)
|
From = From.decode(encoding)
|
||||||
|
|
||||||
print(subject)
|
print(subject)
|
||||||
filepath = clean(subject) + '.md'
|
filepath = subject + '.md'
|
||||||
filepath = os.path.join('notes', filepath)
|
filepath = os.path.join('notes', filepath)
|
||||||
|
|
||||||
if msg.is_multipart():
|
if msg.is_multipart():
|
||||||
|
|
Loading…
Reference in New Issue