From e83c34744246cea91778df60d33a0c7dbac89127 Mon Sep 17 00:00:00 2001 From: Daniel Weschke Date: Mon, 19 Jul 2021 14:10:29 +0200 Subject: [PATCH] improve status output for command --- controldeck.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/controldeck.py b/controldeck.py index aedb87c..6246449 100644 --- a/controldeck.py +++ b/controldeck.py @@ -19,12 +19,15 @@ APP_NAME = "ControlDeck" STATUS_DIV = Div() STATUS_DIV.classes = " border-2 border-gray-800 bg-gray-900 text-gray-600 h-40 m-2 pt-1 pl-2 mr-16 rounded-lg flex" +def tohtml(text): + return text.replace("\n", "
") + def mouseenter_status(self, msg): STATUS_DIV.inner_html = "
" STATUS_DIV.inner_html += "
command
" - STATUS_DIV.inner_html += f"
{str(self.command)}
" + STATUS_DIV.inner_html += f"
{tohtml(self.command.strip())}
" STATUS_DIV.inner_html += "
state
" - STATUS_DIV.inner_html += f"
{str(self.state)}
" + STATUS_DIV.inner_html += f"
{tohtml(self.state.strip())}
" STATUS_DIV.inner_html += "
" def process(args, output=True):