generated from justuser-31/mrl_v1_license
Разделение на файлы, мелкие доработки.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import os
|
||||
|
||||
import yaml
|
||||
|
||||
CONFIG = {}
|
||||
STORAGE_ROOT = ""
|
||||
|
||||
|
||||
def load_config():
|
||||
global CONFIG, STORAGE_ROOT
|
||||
with open("config.yaml", "r") as f:
|
||||
CONFIG = yaml.safe_load(f)
|
||||
STORAGE_ROOT = CONFIG["storage"]["root_dir"]
|
||||
os.makedirs(STORAGE_ROOT, exist_ok=True)
|
||||
return CONFIG
|
||||
|
||||
|
||||
def get_storage_root():
|
||||
return STORAGE_ROOT
|
||||
Reference in New Issue
Block a user