Initial
This commit is contained in:
23
core/config_loader.py
Normal file
23
core/config_loader.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import yaml
|
||||
from pathlib import Path
|
||||
|
||||
CONFIG_PATH = Path(__file__).parent.parent / "config.yaml"
|
||||
|
||||
def load_config():
|
||||
with open(CONFIG_PATH, "r", encoding="utf-8") as f:
|
||||
cfg = yaml.safe_load(f)
|
||||
|
||||
s_id = cfg['google_sheet']['sheet_id']
|
||||
gid_t = cfg['google_sheet']['gid_times']
|
||||
gid_r = cfg['google_sheet']['gid_remarks']
|
||||
|
||||
# Wir nutzen exakt das Format, das bei deinem ersten Test funktionierte
|
||||
cfg['links'] = {
|
||||
'times_csv': f"https://docs.google.com/spreadsheets/d/{s_id}/export?format=csv&gid={gid_t}",
|
||||
'remarks_csv': f"https://docs.google.com/spreadsheets/d/{s_id}/export?format=csv&gid={gid_r}",
|
||||
'times_edit': f"https://docs.google.com/spreadsheets/d/{s_id}/edit#gid={gid_t}",
|
||||
'remarks_edit': f"https://docs.google.com/spreadsheets/d/{s_id}/edit#gid={gid_r}"
|
||||
}
|
||||
return cfg
|
||||
|
||||
config = load_config()
|
||||
Reference in New Issue
Block a user