...
 
Commits (2)
......@@ -15,5 +15,4 @@ class EnvConfig(SecretsAndEnv):
def create_env_config():
x = create_class_from_dict(EnvConfig, os.environ, True)
return x
return create_class_from_dict(EnvConfig, os.environ, True)
......@@ -17,8 +17,11 @@ class DatabaseSingleton:
DatabaseSingleton.__instance.initialize(database)
@staticmethod
def initialize_mysql(host: str, username: str, password: str,
database: str, port: int = 3306):
def initialize_mysql(host: str,
username: str,
password: str,
database: str,
port: int = 3306):
database = MySQLDatabase(host=host,
user=username,
password=password,
......
......@@ -4,7 +4,7 @@ from typing import Callable, List, Tuple, Type
from peewee import OperationalError, ProgrammingError
from _thread import interrupt_main
from _thread import interrupt_main # type: ignore
from gmb.environment import Environment
from .database import DatabaseSingleton
......
......@@ -3,16 +3,15 @@ import logging
import telegram
from telegram.ext import CommandHandler, Updater
from gmb.database.database import DatabaseSingleton
from gmb.database.schema import Schema
from gmb.environment import Environment
from gmb.infofetchbot.infofetchbot import InfoFetch
from gmb.lists import user_blacklist
from gmb.pollingbot.pollingbot import PollingBot
from gmb.util import read_json_file, write_json_file
from gmb.database.database import DatabaseSingleton
from gmb.database.schema import Schema
from gmb.register_pollingbot_extensions import register_pollingbot_extensions
from gmb.register_schema import register_schema
from gmb.util import read_json_file, write_json_file
def init_env():
......@@ -64,7 +63,9 @@ def cmd_start() -> None:
# Init Bot
token = config.token
if token == "" or token == None:
print("Token is not set. Have a look at the README and configure the bot right.")
print(
"Token is not set. Have a look at the README and configure the bot right."
)
exit()
print("Initializing Bot")
bot = telegram.Bot(token=token)
......
......@@ -4,12 +4,12 @@ import argparse
import sys
from shutil import copyfile
from gmb import defaults
from gmb.database.database import DatabaseSingleton
from gmb.database.schema import Schema
from gmb.migration.migrate_v224_to_v300 import migrate224to300
from gmb.register_schema import register_schema
from gmb.util import read_json_file
from gmb import defaults
def __read_db_config_file():
......