From 8601814642b1cbfe87e539e7746778bc9801bb55 Mon Sep 17 00:00:00 2001 From: Profitroll <47523801+profitrollgame@users.noreply.github.com> Date: Mon, 14 Nov 2022 18:52:16 +0100 Subject: [PATCH] Improved behavior with large text in utils --- modules/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/utils.py b/modules/utils.py index 0cd664e..17afbca 100644 --- a/modules/utils.py +++ b/modules/utils.py @@ -56,7 +56,11 @@ def configSet(key: str, value, *args: str, file: str = "config"): for arg in args: string += f'["{arg}"]' if type(value) in [str]: - string += f'["{key}"] = "{value}"' + value.replace("'", "\'").replace('"', '\"') + if len(value) < 30: + string += f'["{key}"] = "{value}"' + else: + string += f'["{key}"] = """\n{value}\n"""' else: string += f'["{key}"] = {value}' exec(string)