I am trying to write a command but I do not want one long line that looks untidy. I am looking to add the strings together to be executed as on command. I have some code below which is part of an email function:
msg = MIMEText("The nightly build status was a SUCCESS\n\nBuild File: http://www.python.org\n\n Build Results File: http://10.51.54.57/sandboxes/", project, "\n")
This shows the one line, I am hoping for a better way to do this. I have tried the below code but it does not work.
msg = MIMEText("The nightly build status was a SUCCESS\n\nBuild File: ")
msg += MIMEText("http://www.python.org\n\n Build Results File: ")
msg += MIMEText("http://10.51.54.57/sandboxes/", project, "\n")
Thanks for any help.
I have tried the below code but get:
msg = MIMEText("""The nightly build status was a SUCCESS\n\n
Build File: """,
build_file, """
\n\n
Build Results File: """,
build_file, """
\n\n
Sandbox Folder:""",
sandbox, """
\n\n
Antibrick File: """,
antibrick, "\n\n")
Now I get the message:
Traceback (most recent call last):
File "test_email.py", line 45, in <module>
if __name__ == '__main__': myObject = email_success()
File "test_email.py", line 32, in email_success
antibrick, "\n\n")
TypeError: __init__() takes at most 4 arguments (10 given)
Any ideas?
Thanks S.Mark, I tried this but when the email is sent it is not as a hyperlink but sent as:
The nightly build status was a SUCCESS
Build File: ('http://10.67.54.57/sandboxes/', '2010-01-05/new_sandbox', 'basebuild')
Build Results File: ('http://10.67.54.57/sandboxes/', '2010-01-05/new_sandbox', 'basebuild')
Sandbox Folder: ('http://10.67.54.57/sandboxes/', '2010-01-05/new_sandbox')
Antibrick File:
MIMETextcannot be concatenated together like that.