From 1c3d973edf6bd166b531742c408c1461ee1b9c44 Mon Sep 17 00:00:00 2001 From: Alex Orid Date: Fri, 30 Apr 2021 15:03:22 -0400 Subject: [PATCH] Chyron Auto Fix Improved the command in respects to the chyron command min length. --- commands/implemented/Command_text_v2.py | 27 ++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/commands/implemented/Command_text_v2.py b/commands/implemented/Command_text_v2.py index d79451e..a34ee38 100644 --- a/commands/implemented/Command_text_v2.py +++ b/commands/implemented/Command_text_v2.py @@ -31,7 +31,7 @@ class Command_Text_v2(AbstractCommand, metaclass=ABCMeta): def do_command(self, source = AbstractCommand.CommandSource.default, user = "User", command = "", rest = "", bonusData = None): returnString = "trying to update text..." praxis_logger_obj.log("\n Command>: " + command + " " + rest) - + returnString = user + " has attempted to update the text but an error may have occurred!" for name in config.adminUsers_List: print(name) tempName = user.lower() @@ -68,12 +68,33 @@ class Command_Text_v2(AbstractCommand, metaclass=ABCMeta): tempText.itemName = tempParsedMessage[2] tempText.itemContent = newText tempTextModule.makeItem(tempText) + returnString = user + " has updated the text!" else: returnString = user + " has attempted to update the text but an error may have occurred!" #tempTextModule.update_tempTextFiles() + if "chyron" in tempParsedMessage[1]: + tempTextModule:tempText_Module.tempText_Module = tempText_Module.tempText_Module() + tempText:tempText_Module.tempTextItem = tempText_Module.tempTextItem() + if i > 1: + newText = "" + counter = 0 + for word in tempParsedMessage: + if counter > 1: + newText = newText + word + " " + counter = counter + 1 + newText = newText[:-1] # Gets rid of last space + #print(tempParsedMessage[2], newText) + tempText.itemName = tempParsedMessage[1] + if len(newText) < 120: + for x in range(120-len(newText)): + newText = newText + " " + tempText.itemContent = newText + tempTextModule.makeItem(tempText) + returnString = user + " has updated the chyron text!" + else: + returnString = user + " has attempted to update the text but an error may have occurred!" + #tempTextModule.update_tempTextFiles() - returnMessage = user + " has updated the text!" - returnString = returnMessage