Adjust styling, fix span color

This commit is contained in:
Ben 2019-07-19 20:06:28 +02:00
parent 1115892fb3
commit 6f43bc221f
Signed by: ben
GPG key ID: 0F54A7ED232D3319

6
wmn.py
View file

@ -126,11 +126,11 @@ def process_jenkins_request():
html_changes = "\n".join((f" <li>{msg}</li>" for msg in change_messages)) html_changes = "\n".join((f" <li>{msg}</li>" for msg in change_messages))
text_changes = "\n".join((f"- {msg}" for msg in change_messages)) text_changes = "\n".join((f"- {msg}" for msg in change_messages))
try: try:
room.send_html(f"<strong>{build_name} completed on project {project_name} with result " room.send_html(f"<strong>Build {build_name} completed on project {project_name} with result "
f"<span color=\"{result_color}\">{result_type}</span>, " f"<span style=\"color:{result_color}\">{result_type}</span>, "
f"{len(change_messages)} commits</strong><br>\n" f"{len(change_messages)} commits</strong><br>\n"
f"<ul>\n{html_changes}\n</ul>\n", f"<ul>\n{html_changes}\n</ul>\n",
body=f"{build_name} completed on project {project_name} with result {result_type}\n" body=f"Build {build_name} completed on project {project_name} with result {result_type}\n"
f"{text_changes}\n", f"{text_changes}\n",
msgtype="m.notice") msgtype="m.notice")
except MatrixRequestError as e: except MatrixRequestError as e: