| 12345678910111213141516171819202122232425 |
- import os
- baseDir = f"{os.path.dirname(__file__)}/.."
- def loadConfig(fileName):
- cfg = { "card_name": "{_CALL_}_{_Date_}_{_Time_}"
- , "verbose": "0"
- }
- with open(fileName, "rt") as f:
- for row in f:
- row = row.strip().split("=", 1)
- if len(row) != 2:
- continue
- k = row[0].strip()
- v = row[1].strip()
- cfg[k] = v
- if cfg["verbose"].lower() in ["1", "true", "yes", "on"]:
- cfg["verbose"] = True
- else:
- cfg["verbose"] = False
- return cfg
|