| 1234567891011121314151617 |
- import os as _os
- runtime_dir = _os.path.realpath(_os.path.join(__file__,'..','..','runtime'))
- config_file = _os.path.join(runtime_dir, "config.json")
- def load_config():
- import json
- if _os.path.isfile(config_file):
- with open(config_file) as fd:
- return json.load(fd)
- else:
- return {}
- def save_config():
- import json
- with open(config_file, "w") as fd:
- return json.dump(fd)
|