blob: 46bb47446fe6fb136723968c2525aa4b5db0ba09 [file] [log] [blame]
Adriana Kobylak4c60e5e2016-01-10 15:22:45 -06001#!/usr/bin/python -u
2
3# Simple parser to create a python dictionary from a yaml file.
4# It saves the applications from doing the parsing and
5# adding dependencies to additional modules like yaml
6
7import yaml
8
9SETTINGS_FILE = 'settings.yaml'
10OUTPUT_FILE = 'settings_file.py'
11FILE_HEADER = '#!/usr/bin/python -u'
12
13with open(SETTINGS_FILE) as s:
14 data = yaml.safe_load(s)
15
16with open(OUTPUT_FILE, 'w') as f:
17 f.write(FILE_HEADER)
18 f.write('\n')
19 f.write('SETTINGS=')
20 f.write(str(data))