git @ Cat's Eye Technologies kinoje / fb773d6
Move config to first argument position. Chris Pressey 4 years ago
3 changed file(s) with 6 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
88
99
1010 class Compiler(object):
11 def __init__(self, dirname, outfilename, config, exe):
11 def __init__(self, config, dirname, outfilename, exe):
1212 self.dirname = dirname
1313 self.exe = exe
1414 self.outfilename = outfilename
104104
105105 exe = LoggingExecutor('compiler.log')
106106
107 compiler = Compiler.get_class_for(options.output)(options.framesdir, options.output, config, exe)
107 compiler = Compiler.get_class_for(options.output)(config, options.framesdir, options.output, exe)
108108 compiler.compile_all()
109109
110110 if options.view:
1111 class Expander(object):
1212 """Takes a directory and a template (Jinja2) and expands the template a number of times,
1313 creating a number of filled-out text files in the directory."""
14 def __init__(self, dirname, config, exe):
14 def __init__(self, config, dirname, exe):
1515 self.dirname = dirname
1616 self.template = Template(config['template'])
1717 self.config = config
6060
6161 exe = LoggingExecutor('movie.log')
6262
63 expander = Expander(options.instantsdir, config, exe)
63 expander = Expander(config, options.instantsdir, exe)
6464 expander.expand_all()
6565
6666 exe.close()
4747 instants_dir = mkdtemp()
4848 frames_dir = mkdtemp()
4949
50 expander = Expander(instants_dir, config, exe)
50 expander = Expander(config, instants_dir, exe)
5151 expander.expand_all()
5252
5353 renderer = Renderer(config, instants_dir, frames_dir, exe)
5454 renderer.render_all()
5555
56 compiler = Compiler.get_class_for(output_filename)(frames_dir, output_filename, config, exe)
56 compiler = Compiler.get_class_for(output_filename)(config, frames_dir, output_filename, exe)
5757 compiler.compile_all()
5858
5959 exe.close()