From cb6805e0c0f0bb1a062ad8aa6bb14e4b6926304a Mon Sep 17 00:00:00 2001 From: Mikhail Shahovalov Date: Sun, 16 Mar 2025 01:21:40 +0300 Subject: [PATCH] automap configs --- .vscode/launch.json | 6 ++++++ configurations.py | 13 +++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 0854bd9..6227ebb 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,6 +4,12 @@ // Для получения дополнительной информации посетите: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "name": "Отладчик Python: Модуль", + "type": "debugpy", + "request": "launch", + "module": "main" + }, { "name": "Отладчик Python: Текущий файл", "type": "debugpy", diff --git a/configurations.py b/configurations.py index 67c764c..940890d 100644 --- a/configurations.py +++ b/configurations.py @@ -2,7 +2,16 @@ import json import io with io.open('appsettings.json', 'r', encoding='utf-8') as f: - settings = json.load(f) + _settings = json.load(f) + class BotSettings: - Token: str = 'Token' \ No newline at end of file + Token: str = 'Token' + + @classmethod + def init(cls): + for key, value in _settings.items(): + setattr(cls, key, value) + + +BotSettings.init() \ No newline at end of file