Mercurial > bitten > bitten-test
view scripts/build.py @ 4:196009657e5e
Simplify the recipe commands interface:
* The implementation of a command is now located using a pseudo-protocol for namespace URIs.
* Commands are simply module-level functions instead of components.
* Remove dependency of the recipe/slave code on the Trac component architecture.
author | cmlenz |
---|---|
date | Mon, 06 Jun 2005 15:54:29 +0000 |
parents | 9ac0ee86ec7c |
children | 738a0ae251f6 |
line wrap: on
line source
#!/usr/bin/env python import sys from bitten import BuildError from bitten.recipe import Recipe def build(): step_id = None if len(sys.argv) > 1: step_id = sys.argv[1] recipe = Recipe() steps_run = [] for step in recipe: if not step_id or step.id == step_id: print '-->', step.description or step.id for function, kw in step: function(recipe.basedir, **kw) print steps_run.append(step.id) if step_id and not step_id in steps_run: raise BuildError, "Recipe has no step named '%s'" % step_id if __name__ == '__main__': try: build() except BuildError, e: print>>sys.stderr, "FAILED: %s" % e sys.exit(-1)