From 2335c31ac98e4a1b2dd407e1abcfc6956be3f034 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 15 Mar 2021 18:30:58 +0000 Subject: [PATCH] Truncation --- notifications_client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/notifications_client.py b/notifications_client.py index cc1eec80a..dc7d4ab3c 100644 --- a/notifications_client.py +++ b/notifications_client.py @@ -455,16 +455,16 @@ def _showLocalBox(notifyJson: {}, boxName: str, name = speakerJson['name'] else: name = '' + name = (name[:16]) if len(name) > 16 else name while len(name) < 16: name += ' ' - name = (name[:16]) if len(name) >= 15 else name content = speakerJson['content'] - while len(content) < 40: - content += ' ' if speakerJson.get('detectedLinks'): if len(speakerJson['detectedLinks']) > 0: content = '🔗' + content - content = (content[:40]) if len(content) >= 39 else content + content = (content[:40]) if len(content) > 40 else content + while len(content) < 40: + content += ' ' print(indent + str(posStr) + ' | ' + str(name) + ' | ' + str(published) + ' | ' + str(content) + ' |') ctr += 1