From 53dd903886473ebfa109cbc4167acfd8b7a1d5d9 Mon Sep 17 00:00:00 2001
From: tfa
Date: Tue, 21 Mar 2023 16:27:03 +0100
Subject: [PATCH] Meilleur affichage des messages long
---
tcl.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tcl.py b/tcl.py
index d9190eb..c9c48b3 100644
--- a/tcl.py
+++ b/tcl.py
@@ -8,6 +8,7 @@ import asyncio
import json
import base64
import difflib
+import re
class Terminus:
@@ -148,8 +149,12 @@ class Tcl(Plugin):
msg.append(value["message"])
debut = datetime.fromisoformat(value["debut"])
fin = datetime.fromisoformat(value["fin"])
+ newMsg = value["message"].replace('\t', '
')
+ newMsg = re.sub(r"(?\g<0>", newMsg)
+ newMsg = newMsg.replace('
', '
')
+ self.log.info(newMsg)
respText = "" + value["type"] + "
" + value["titre"] + "
" \
- + value["message"] + "
" + debut.strftime("%d/%m/%Y à %H:%M") + " au " \
+ + newMsg + "
" + debut.strftime("%d/%m/%Y à %H:%M") + " au " \
+ fin.strftime("%d/%m/%Y à %H:%M") + ""
await evt.respond(respText, allow_html=True)
if(alerte==False):