29 lines
699 B
Python
29 lines
699 B
Python
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()
|
|
db = SqliteDict(f"{config['data_dir']}/db.sqlite", autocommit=True)
|
|
|
|
marseygen_queue = SqliteDict(
|
|
f"{config['data_dir']}/db.sqlite", tablename="marseygen_queue", autocommit=True
|
|
)
|
|
|
|
bussyboy_queue = SqliteDict(
|
|
f"{config['data_dir']}/db.sqlite", tablename="bussyboy_queue", autocommit=True
|
|
)
|
|
|
|
bussyboy_log = SqliteDict(
|
|
f"{config['data_dir']}/db.sqlite", tablename="bussyboy_log", autocommit=True
|
|
)
|