From f747eb94118f9ab6298f825319d95735d2adc44d Mon Sep 17 00:00:00 2001 From: Benedikt Ziemons Date: Fri, 19 Jul 2019 20:18:18 +0200 Subject: [PATCH] Jenkins output style changes --- wmn.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/wmn.py b/wmn.py index e3c792f..a2f8265 100644 --- a/wmn.py +++ b/wmn.py @@ -126,12 +126,13 @@ def process_jenkins_request(): html_changes = "\n".join((f"
  • {msg}
  • " for msg in change_messages)) text_changes = "\n".join((f"- {msg}" for msg in change_messages)) try: - room.send_html(f"Build {build_name} completed on project {project_name} with result " - f"{result_type}, " - f"{len(change_messages)} commits
    \n" - f"\n", - body=f"Build {build_name} completed on project {project_name} with result {result_type}\n" - f"{text_changes}\n", + room.send_html(f"

    Build {build_name} on project {project_name} complete: " + f"{result_type}, " + f"{len(change_messages)} commits

    \n" + "" + (f"\n" if len(change_messages) > 0 else ""), + body=f"**Build {build_name} on project {project_name} complete: {result_type}**, " + f"{len(change_messages)} commits\n" + "" + (f"{text_changes}\n" if len(change_messages) > 0 else ""), msgtype="m.notice") except MatrixRequestError as e: return matrix_error(e)