summaryrefslogtreecommitdiff
path: root/morphlib/app.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-02-19 17:45:42 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-02-21 11:46:08 +0000
commited79cb01302fbfda0484c7371e5a364d0d872e74 (patch)
treeaa8305318f36ee291d982b1c48449cbe354ee17e /morphlib/app.py
parent29b8977ac03ac9ce0c178ce6febd0a5f27288001 (diff)
downloadmorph-ed79cb01302fbfda0484c7371e5a364d0d872e74.tar.gz
Make BuildCommand report current and total build steps
This adds a [Build 1/12765] to the output of the building of each artifact. This makes it easier to see how much work there might still be remaining.
Diffstat (limited to 'morphlib/app.py')
-rwxr-xr-xmorphlib/app.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/morphlib/app.py b/morphlib/app.py
index 47288a6a..eaba5dd9 100755
--- a/morphlib/app.py
+++ b/morphlib/app.py
@@ -173,6 +173,9 @@ class Morph(cliapp.Application):
raise morphlib.Error(
'System time is far in the past, please set your system clock')
+ def setup(self):
+ self.status_prefix = ''
+
def process_args(self, args):
self.check_time()
@@ -342,11 +345,14 @@ class Morph(cliapp.Application):
* ``error`` should be true when it is an error message
All other keywords are ignored unless embedded in ``msg``.
+
+ The ``self.status_prefix`` string is prepended to the output.
+ It is set to the empty string by default.
'''
assert 'msg' in kwargs
- text = kwargs['msg'] % kwargs
+ text = self.status_prefix + (kwargs['msg'] % kwargs)
error = kwargs.get('error', False)
chatty = kwargs.get('chatty', False)