[banshee] [build] support invoking functions as build phase steps



commit 080dc23ef1892f3718eff9492fc986c36fcab5cc
Author: Aaron Bockover <abockover novell com>
Date:   Mon Dec 28 15:44:51 2009 -0500

    [build] support invoking functions as build phase steps

 build/bundle/build.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/build/bundle/build.py b/build/bundle/build.py
index fa365a0..3875439 100755
--- a/build/bundle/build.py
+++ b/build/bundle/build.py
@@ -59,6 +59,10 @@ def build_package (profile, (package, vars)):
 	for phase in profile['run_phases']:
 		log (0, '%sing %s' % (phase.capitalize (), package['name']))
 		for step in package[phase]:
+			if hasattr (step, '__call__'):
+				log (1, '<py call: %s>' % step.__name__)
+				step (package)
+				continue
 			step = expand_macros (step, package)
 			log (1, step)
 			if step.startswith ('cd '):
@@ -136,7 +140,7 @@ def expand_macros (node, vars, runtime = True):
 	elif isinstance (node, (list, tuple)):
 		for i, v in enumerate (node):
 			node[i] = expand_macros (v, vars, runtime)
-	else:
+	elif isinstance (node, str):
 		orig_node = node
 		iters = 0
 		while True:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]