2023-07-17 01:42:20 +00:00
|
|
|
import os
|
|
|
|
|
|
|
|
import yaml
|
|
|
|
from sqlitedict import SqliteDict
|
|
|
|
|
|
|
|
current_dir = os.path.dirname(os.path.realpath(__file__))
|
|
|
|
config_path = os.path.join(current_dir, "config.yaml")
|
|
|
|
|
|
|
|
|
|
|
|
def load_config():
|
|
|
|
with open(config_path, "r") as f:
|
|
|
|
return yaml.safe_load(f)
|
|
|
|
|
|
|
|
|
|
|
|
config = load_config()
|
2023-07-17 01:44:14 +00:00
|
|
|
db = SqliteDict(f"{config['data_dir']}/db.sqlite", autocommit=True)
|