def verify(output, template, data): print("%s with %s" % (template, data)) result = render(template, data) result_iter = ''.join(Stache().render_iter(template, data)) print("Result: %s\n" % result) assert result == output assert result == result_iter
def main(): version = pkg_resources.require('vvrenderer')[0] input_args = docopt(__doc__, version=version) rndpath = input_args['--rnd'] audiopath = input_args['--audio'] duration = input_args['--duration'] outputpath = input_args['-o'] # test that the dest path is writeable with open(outputpath, 'w'): pass rnd_file_config = load_basicfile_field(rndpath, 'config') render_config = { 'width': int(rnd_file_config['width']), 'height': int(rnd_file_config['height']), 'num_frames': int(rnd_file_config['num_frames']), 'speed': float(rnd_file_config['speed']) } with RndFormatReader(rndpath) as rnd_frames: video = render(command_frames=rnd_frames, config=render_config, audio_srcpath=audiopath, duration=duration) video.write_videofile(outputpath)
def bare(output, template, data): return render(template, data)