INNER CODE UNIT · Python
execute
weolar/miniblink49 · third_party/WebKit/Tools/RebaselineLogServer/main.py:66
def execute(self, command_data):
if "to" not in command_data or "subject" not in command_data or "body" not in command_data:
return "Malformed command JSON"
to = command_data["to"]
subject = command_data["subject"]
body = command_data["body"]
htmlbody = command_data["htmlbody"] if "htmlbody" in command_data else body
mail.send_mail(sender=SENDER_ADDRESS,
to=to,
reply_to="@".join(["apavlov", "chromium.org"]),
cc=REBASELINES_LIST_ADDRESS,
subject="Auto-rebaseline bot: " + subject,
body=body,
html=htmlbody)
return "Sent mail to %s (%s)" % (to, subject)
COMMANDS = {