blob: 46bb47446fe6fb136723968c2525aa4b5db0ba09 [file] [log] [blame]
#!/usr/bin/python -u
# Simple parser to create a python dictionary from a yaml file.
# It saves the applications from doing the parsing and
# adding dependencies to additional modules like yaml
import yaml
SETTINGS_FILE = 'settings.yaml'
OUTPUT_FILE = 'settings_file.py'
FILE_HEADER = '#!/usr/bin/python -u'
with open(SETTINGS_FILE) as s:
data = yaml.safe_load(s)
with open(OUTPUT_FILE, 'w') as f:
f.write(FILE_HEADER)
f.write('\n')
f.write('SETTINGS=')
f.write(str(data))