Skip to content

Commit e3314a0

Browse files
committed
flake8 fixes.
1 parent adb3bb1 commit e3314a0

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

roundup/mailer.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,30 @@
22
"""
33
__docformat__ = 'restructuredtext'
44

5-
import time, os, socket, smtplib, sys, traceback, logging
6-
7-
from roundup import __version__
8-
from roundup.date import get_timezone, Date
5+
import logging
6+
import os
7+
import smtplib
8+
import socket
9+
import sys
10+
import time
11+
import traceback
912

1013
from email import charset
11-
from email.utils import formatdate, specialsre, escapesre
1214
from email.charset import Charset
1315
from email.header import Header
1416
from email.mime.base import MIMEBase
15-
from email.mime.text import MIMEText
1617
from email.mime.multipart import MIMEMultipart
1718
from email.mime.nonmultipart import MIMENonMultipart
19+
from email.mime.text import MIMEText
20+
from email.utils import formatdate, specialsre, escapesre
1821

19-
from roundup.anypy import email_
22+
from roundup.anypy import email_ # noqa: F401 defines functions
2023
from roundup.anypy.strings import b2s, s2u
24+
from roundup import __version__
25+
from roundup.date import get_timezone, Date
2126

2227
try:
23-
import gpg, gpg.core
28+
import gpg, gpg.core # noqa: E401
2429
except ImportError:
2530
gpg = None
2631

@@ -171,7 +176,7 @@ def bounce_message(self, bounced_message, to, error,
171176
to = None
172177
# see whether we should send to the dispatcher or not
173178
dispatcher_email = getattr(self.config, "DISPATCHER_EMAIL",
174-
getattr(self.config, "ADMIN_EMAIL"))
179+
self.config.ADMIN_EMAIL)
175180
error_messages_to = getattr(self.config, "ERROR_MESSAGES_TO", "user")
176181
if error_messages_to == "dispatcher":
177182
to = [dispatcher_email]
@@ -280,8 +285,8 @@ def smtp_send(self, to, message, sender=None):
280285
unixfrm = 'From %s %s' % (sender, Date('.').pretty(fmt))
281286
debug_fh = open(self.debug, 'a')
282287
debug_fh.write('%s\nFROM: %s\nTO: %s\n%s\n\n' %
283-
(unixfrm, sender,
284-
', '.join(to), message))
288+
(unixfrm, sender,
289+
', '.join(to), message))
285290
debug_fh.close()
286291
else:
287292
# now try to send the message

0 commit comments

Comments
 (0)