19 lines
519 B
Python
19 lines
519 B
Python
import os
|
|
import yaml
|
|
|
|
CONFIG_FILE = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "settings.yaml")
|
|
|
|
def load_config():
|
|
if not os.path.exists(CONFIG_FILE):
|
|
return {}
|
|
with open(CONFIG_FILE, 'r', encoding='utf-8') as f:
|
|
return yaml.safe_load(f)
|
|
|
|
def save_config(config_data):
|
|
with open(CONFIG_FILE, 'w', encoding='utf-8') as f:
|
|
yaml.dump(config_data, f, allow_unicode=True)
|
|
|
|
def get_kis_config():
|
|
config = load_config()
|
|
return config.get('kis', {})
|