Config now loads default values from a file alongside the source.

This commit is contained in:
Michael Lazar
2015-12-14 23:37:23 -08:00
parent b487f70e48
commit 49e2d1aa4f
8 changed files with 196 additions and 83 deletions

View File

@@ -56,8 +56,8 @@ def main():
data['copyright'] = rtv.__copyright__
# Escape dashes is all of the sections
data = {k: v.replace('-', r'\-') for k, v in data.items()}
print('Reading from %s/rtv/templates/rtv.1.template' % ROOT)
with open(os.path.join(ROOT, 'rtv/templates/rtv.1.template')) as fp:
print('Reading from %s/rtv/scripts/rtv.1.template' % ROOT)
with open(os.path.join(ROOT, 'rtv/scripts/rtv.1.template')) as fp:
template = fp.read()
print('Populating template')
out = template.format(**data)