Reformatted and cleaned up everything
This commit is contained in:
@@ -16,9 +16,7 @@ if db_config["user"] is not None and db_config["password"] is not None:
|
||||
db_config["name"],
|
||||
)
|
||||
else:
|
||||
con_string = "mongodb://{0}:{1}/{2}".format(
|
||||
db_config["host"], db_config["port"], db_config["name"]
|
||||
)
|
||||
con_string = "mongodb://{0}:{1}/{2}".format(db_config["host"], db_config["port"], db_config["name"])
|
||||
|
||||
db_client = AsyncClient(con_string)
|
||||
db: AsyncDatabase = db_client.get_database(name=db_config["name"])
|
||||
|
@@ -1,11 +1,10 @@
|
||||
import logging
|
||||
from logging import Logger
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict
|
||||
|
||||
from libbot.utils import config_get
|
||||
|
||||
import logging
|
||||
from logging import Logger
|
||||
|
||||
|
||||
def get_logging_config() -> Dict[str, Any]:
|
||||
return {
|
||||
@@ -22,9 +21,7 @@ def get_logging_config() -> Dict[str, Any]:
|
||||
"console": {"class": "logging.StreamHandler", "formatter": "systemd"},
|
||||
},
|
||||
"formatters": {
|
||||
"simple": {
|
||||
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
||||
},
|
||||
"simple": {"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"},
|
||||
"systemd": {"format": "%(name)s - %(levelname)s - %(message)s"},
|
||||
},
|
||||
"root": {
|
||||
@@ -33,5 +30,6 @@ def get_logging_config() -> Dict[str, Any]:
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def get_logger(name: str) -> Logger:
|
||||
return logging.getLogger(name)
|
||||
return logging.getLogger(name)
|
||||
|
@@ -18,9 +18,7 @@ def migrate_database() -> None:
|
||||
user_locale = None if "locale" not in keys else keys["locale"]
|
||||
user_card = None if "card" not in keys else keys["card"]
|
||||
|
||||
cursor.execute(
|
||||
"INSERT INTO users VALUES (?, ?)", (int(user), user_card, user_locale)
|
||||
)
|
||||
cursor.execute("INSERT INTO users VALUES (?, ?)", (int(user), user_card, user_locale))
|
||||
|
||||
cursor.connection.commit()
|
||||
rename(Path("data/database.json"), Path("data/database.migrated.json"))
|
||||
|
Reference in New Issue
Block a user