aboutsummaryrefslogtreecommitdiff
path: root/cros_utils/email_sender.py
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-11 05:08:14 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-11 05:08:14 +0000
commitf930fab1cfea5054194fd5164d10799e9d267b4a (patch)
treeb0522edde1d3c5356c95eb1ee2eae3e87befa1f3 /cros_utils/email_sender.py
parent4e4201457e5f51a132101c611c79ccff9f713c8b (diff)
parent882a18888febb9cb0b9d6c6069498cbc4aa30f88 (diff)
downloadtoolchain-utils-f930fab1cfea5054194fd5164d10799e9d267b4a.tar.gz
Snap for 8570526 from 882a18888febb9cb0b9d6c6069498cbc4aa30f88 to mainline-scheduling-releaseaml_sch_331113000aml_sch_331111000android13-mainline-scheduling-release
Change-Id: If9e9642e3f62966fc0331ca59494bc2f75501eed
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)