aboutsummaryrefslogtreecommitdiff
path: root/cros_utils/email_sender.py
diff options
context:
space:
mode:
Diffstat (limited to 'cros_utils/email_sender.py')
-rwxr-xr-xcros_utils/email_sender.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/cros_utils/email_sender.py b/cros_utils/email_sender.py
index 6b8893ea..df8afbc4 100755
--- a/cros_utils/email_sender.py
+++ b/cros_utils/email_sender.py
@@ -71,7 +71,7 @@ class EmailSender(object):
"From" email address. Must be nonempty.
well_known_recipients: a list of well-known recipients for the email.
These are translated into addresses by our mailer.
- Current potential values for this are ('sheriff',
+ Current potential values for this are ('detective',
'cwp-team', 'cros-team', 'mage'). Either this or
direct_recipients must be a nonempty list.
direct_recipients: @google.com emails to send addresses to. Either this
@@ -89,8 +89,8 @@ class EmailSender(object):
type(well_known_recipients))
if not isinstance(direct_recipients, (tuple, list)):
- raise ValueError(
- '`direct_recipients` is unexpectedly a %s' % type(direct_recipients))
+ raise ValueError('`direct_recipients` is unexpectedly a %s' %
+ type(direct_recipients))
if not subject or not identifier:
raise ValueError('both `subject` and `identifier` must be nonempty')
@@ -205,8 +205,8 @@ class EmailSender(object):
to_be_deleted = []
try:
- with tempfile.NamedTemporaryFile(
- 'w', encoding='utf-8', delete=False) as f:
+ with tempfile.NamedTemporaryFile('w', encoding='utf-8',
+ delete=False) as f:
f.write(text_to_send)
f.flush()
to_be_deleted.append(f.name)
@@ -239,8 +239,10 @@ class EmailSender(object):
report_suffix = '_report.html'
else:
report_suffix = '_report.txt'
- with tempfile.NamedTemporaryFile(
- 'w', encoding='utf-8', delete=False, suffix=report_suffix) as f:
+ with tempfile.NamedTemporaryFile('w',
+ encoding='utf-8',
+ delete=False,
+ suffix=report_suffix) as f:
f.write(attachment.content)
f.flush()
attachment_files.append(f.name)