def run(self, ctx, path):
        with self.make_target_directory(path) as scratch:
            for template in self.jinja_env.list_templates():
                if not template.endswith('.in'):
                    continue
                fn = self.expand_filename(scratch, ctx, template)
                tmpl = self.jinja_env.get_template(template)
                rv = tmpl.render(ctx).strip('\r\n')
                if rv:
                    directory = os.path.dirname(fn)
                    try:
                        os.makedirs(directory)
                    except __HOLE__:
                        pass
                    with open(fn, 'w') as f:
                        f.write(rv.encode('utf-8') + '\n')
dataset/ETHPy150Open lektor/lektor/lektor/quickstart.py/Generator.run