#!/usr/bin/env python2.7 # # Rick van der Zwet # import textwrap template_file = 'ffserver.conf.tmpl' target_file = 'ffserver.conf' #TODO(rvdz): Expand me to also auto-generate all streams configs def make_ffserver_config(template_file, target_file, directory_root): ''' Create ffserver configuration file ''' with open(template_file,'r') as fh: template = fh.read() template = template.replace('%BASE%',directory_root) with open(target_file,'w') as fh: fh.write(textwrap.dedent(''' # # AUTO GENERATED from %s - DO NOT EDIT! # ''' % template_file)) fh.write(template)