Mercurial > piecrust2
comparison piecrust/app.py @ 466:456db44dcc53
bake: Pass the config variants and values from the CLI to the baker.
TODO: add support for that for the processor pipeline.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 11 Jul 2015 23:51:02 -0700 |
parents | 6801ad5aa1d4 |
children | 5ee62af2a4e3 |
comparison
equal
deleted
inserted
replaced
465:b6e797463798 | 466:456db44dcc53 |
---|---|
605 if os.path.isdir(default_dir): | 605 if os.path.isdir(default_dir): |
606 dirs.append(default_dir) | 606 dirs.append(default_dir) |
607 | 607 |
608 return dirs | 608 return dirs |
609 | 609 |
610 | |
611 def apply_variant_and_values(app, config_variant=None, config_values=None): | |
612 if config_variant is not None: | |
613 logger.debug("Applying configuration variant '%s'." % config_variant) | |
614 app.config.applyVariant('variants/' + config_variant) | |
615 | |
616 if config_values is not None: | |
617 for name, value in config_values: | |
618 logger.debug("Setting configuration '%s' to: %s" % (name, value)) | |
619 app.config.set(name, value) | |
620 |