From 375e5deaf22ec424d730caadd674bad84824da33 Mon Sep 17 00:00:00 2001 From: ctih1 Date: Fri, 25 Jul 2025 23:32:56 +0300 Subject: [PATCH] made code work on < python3.12 --- example.env | 28 ---------------------------- modules/key_compiler.py | 7 +++++-- modules/settings.py | 2 +- requirements.txt | 3 ++- 4 files changed, 8 insertions(+), 32 deletions(-) delete mode 100644 example.env diff --git a/example.env b/example.env deleted file mode 100644 index fe40023..0000000 --- a/example.env +++ /dev/null @@ -1,28 +0,0 @@ -DISCORDBOTTOKEN= -BOTPREFIX="g." -PINGLINE="The Beretta fires fast and won't make you feel any better!" -BLACKLISTEDUSERS= -OWNERID= -USERTRAINENABLED="true" -SHOWMEMENABLED="true" -LOCALE=fi -NAME=goober -AUTOUPDATE="True" -SONG="Basket Case - Green Day" -CHECKSDISABLED="Frue" -REACT="True" -POSITIVEGIFS="https://media.discordapp.net/attachments/821047460151427135/1181371808566493184/jjpQGeno.gif, https://tenor.com/view/chill-guy-my-new-character-gif-2777893510283028272,https://tenor.com/view/goodnight-goodnight-friends-weezer-weezer-goodnight-gif-7322052181075806988" -SPLASHTEXT=" - - SS\ - SS | - SSSSSS\ SSSSSS\ SSSSSS\ SSSSSSS\ SSSSSS\ SSSSSS\ -SS __SS\ SS __SS\ SS __SS\ SS __SS\ SS __SS\ SS __SS\ -SS / SS |SS / SS |SS / SS |SS | SS |SSSSSSSS |SS | \__| -SS | SS |SS | SS |SS | SS |SS | SS |SS ____|SS | -\SSSSSSS |\SSSSSS |\SSSSSS |SSSSSSS |\SSSSSSS\ SS | - \____SS | \______/ \______/ \_______/ \_______|\__| -SS\ SS | -\SSSSSS | - \______/ -" \ No newline at end of file diff --git a/modules/key_compiler.py b/modules/key_compiler.py index 5340bce..7385dbd 100644 --- a/modules/key_compiler.py +++ b/modules/key_compiler.py @@ -75,7 +75,10 @@ class Script: self.script: str = "" def add_line(self, content, indent: int = 0, newline: bool = True) -> None: - self.script += f"{'\t' * indent}{content}{'\n' if newline else ''}" + tabs = "\t" * indent + newline_content = "\n" if newline else "" + + self.script += f"{tabs}{content}{newline_content}" def process_name(key: str) -> str: @@ -170,7 +173,7 @@ class GenerateScript: args = find_args(self.primary_data[key]) self.script.add_line( - f"def {process_name(key)}({convert_args(','.join([*args, "lang:str|None=None" if self.uses_typing else "lang"]), args, "none")}):" + f"def {process_name(key)}({convert_args(','.join([*args, 'lang:str|None=None' if self.uses_typing else 'lang']), args, 'none')}):" ) if self.generate_comments: self.script.add_line('"""', 1) diff --git a/modules/settings.py b/modules/settings.py index 8084b21..fa7b0b5 100644 --- a/modules/settings.py +++ b/modules/settings.py @@ -1,6 +1,6 @@ import json import os -from typing import Dict, List, Literal, Mapping, Any, NotRequired, TypedDict +from typing import Dict, List, Literal, Mapping, Any, TypedDict from modules.keys import Language import logging import copy diff --git a/requirements.txt b/requirements.txt index c53d758..7943fda 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,5 @@ psutil better_profanity python-dotenv dotenv -pillow \ No newline at end of file +pillow +watchdog \ No newline at end of file