|
2 | 2 | """ |
3 | 3 | __docformat__ = 'restructuredtext' |
4 | 4 |
|
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 |
9 | 12 |
|
10 | 13 | from email import charset |
11 | | -from email.utils import formatdate, specialsre, escapesre |
12 | 14 | from email.charset import Charset |
13 | 15 | from email.header import Header |
14 | 16 | from email.mime.base import MIMEBase |
15 | | -from email.mime.text import MIMEText |
16 | 17 | from email.mime.multipart import MIMEMultipart |
17 | 18 | from email.mime.nonmultipart import MIMENonMultipart |
| 19 | +from email.mime.text import MIMEText |
| 20 | +from email.utils import formatdate, specialsre, escapesre |
18 | 21 |
|
19 | | -from roundup.anypy import email_ |
| 22 | +from roundup.anypy import email_ # noqa: F401 defines functions |
20 | 23 | from roundup.anypy.strings import b2s, s2u |
| 24 | +from roundup import __version__ |
| 25 | +from roundup.date import get_timezone, Date |
21 | 26 |
|
22 | 27 | try: |
23 | | - import gpg, gpg.core |
| 28 | + import gpg, gpg.core # noqa: E401 |
24 | 29 | except ImportError: |
25 | 30 | gpg = None |
26 | 31 |
|
@@ -171,7 +176,7 @@ def bounce_message(self, bounced_message, to, error, |
171 | 176 | to = None |
172 | 177 | # see whether we should send to the dispatcher or not |
173 | 178 | dispatcher_email = getattr(self.config, "DISPATCHER_EMAIL", |
174 | | - getattr(self.config, "ADMIN_EMAIL")) |
| 179 | + self.config.ADMIN_EMAIL) |
175 | 180 | error_messages_to = getattr(self.config, "ERROR_MESSAGES_TO", "user") |
176 | 181 | if error_messages_to == "dispatcher": |
177 | 182 | to = [dispatcher_email] |
@@ -280,8 +285,8 @@ def smtp_send(self, to, message, sender=None): |
280 | 285 | unixfrm = 'From %s %s' % (sender, Date('.').pretty(fmt)) |
281 | 286 | debug_fh = open(self.debug, 'a') |
282 | 287 | 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)) |
285 | 290 | debug_fh.close() |
286 | 291 | else: |
287 | 292 | # now try to send the message |
|
0 commit comments