remove unused email modules and fix pep
This commit is contained in:
parent
5526801f30
commit
9541e148c7
1 changed files with 13 additions and 3 deletions
|
@ -14,8 +14,6 @@ import logging
|
|||
from logging.handlers import SysLogHandler
|
||||
import imaplib
|
||||
import email
|
||||
from email.mime.multipart import MIMEMultipart
|
||||
from email.mime.text import MIMEText
|
||||
import click
|
||||
import click_config_file
|
||||
|
||||
|
@ -144,7 +142,19 @@ class BackupImap:
|
|||
data = fetch_data[0][1]
|
||||
subjects = self._get_mail_header('Subject', data)
|
||||
if len(subjects) > 0:
|
||||
subject = subjects[-1].replace(os.path.sep, '_').replace('\r', '_').replace('\n', '_').replace(':', '_')
|
||||
subject = subjects[-1].replace(
|
||||
os.path.sep,
|
||||
'_'
|
||||
).replace(
|
||||
'\r',
|
||||
'_'
|
||||
).replace(
|
||||
'\n',
|
||||
'_'
|
||||
).replace(
|
||||
':',
|
||||
'_'
|
||||
)
|
||||
message_path = os.path.join(
|
||||
mailbox_path,
|
||||
subject
|
||||
|
|
Loading…
Reference in a new issue