mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-08 20:14:14 +02:00
[wgem] config | allowing to use system nativefier
This commit is contained in:
22
bauh/gems/web/config.py
Normal file
22
bauh/gems/web/config.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import yaml
|
||||
|
||||
from bauh.api.constants import CONFIG_PATH
|
||||
from bauh.gems.web import CONFIG_FILE
|
||||
|
||||
|
||||
def read_config() -> dict:
|
||||
if not os.path.exists(CONFIG_FILE):
|
||||
config = {'environment': {'system': False}}
|
||||
|
||||
Path(CONFIG_PATH).mkdir(parents=True, exist_ok=True)
|
||||
|
||||
with open(CONFIG_FILE, 'w+') as f:
|
||||
f.write(yaml.dump(config))
|
||||
else:
|
||||
with open(CONFIG_FILE) as f:
|
||||
config = yaml.safe_load(f.read())
|
||||
|
||||
return config
|
||||
Reference in New Issue
Block a user