def generate(): engine = Engine() setup_config(engine) setup_content(engine) setup_templates_and_assets(engine) setup_media(engine) engine.renderer = Render(engine.site, engine.config) for name in engine.config.plugins: plugin = __import__( "drupan.plugins.{0}".format(name), fromlist=["Plugin"] ).Plugin(engine.site, engine.config) engine.plugins.append(plugin) for plugin in engine.plugins: plugin.run() engine.renderer.run() engine.config.options.writer = { "directory": "/Users/timo/tmp/test_build_sakebowl" } engine.writer = __import__( "drupan.inout.filesystem", fromlist=["Writer"] ).Writer(engine.site, engine.config) engine.writer.run()
def run(name, config): """Imports an existing site. :param name: name of the site. :param config: path to drupan config. """ engine = Engine() engine.config.from_file(config) engine.prepare_engine() engine.reader.run() import_site(engine, name) import_entities(engine) import_templates(engine) import_assets(engine) import_media(engine)
def deploy(pk: int): """deploy loads the configuration for a given primary key and runs drupans engine with the configuration stored in sakebowl. """ cfg_obj = Configuration.objects.get(pk=pk) config = cfg_obj.as_config() templates = Template.as_dict() entities = Entity.as_list(config) engine = Engine() engine.site.templates = templates engine.site.entities = entities engine.config = config engine.prepare_engine() engine.run()