summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Ipsum <richard.ipsum@codethink.co.uk>2014-06-25 16:13:13 +0100
committerRichard Ipsum <richard.ipsum@codethink.co.uk>2014-06-25 17:05:33 +0100
commit554391c3df84e9df6565317b1d6725e536569297 (patch)
tree28fa777d03c2de50e03f050bc9737cc2950578cd
parent7309431873fd9f9e5f6a39025d75e3305c3c8a19 (diff)
downloadmorph-554391c3df84e9df6565317b1d6725e536569297.tar.gz
Add chatty status messages to aid the user
-rw-r--r--morphlib/morphologyfactory.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/morphlib/morphologyfactory.py b/morphlib/morphologyfactory.py
index 8a0b047a..891a2de7 100644
--- a/morphlib/morphologyfactory.py
+++ b/morphlib/morphologyfactory.py
@@ -63,7 +63,7 @@ class NoStratumBuildDependsError(StratumError):
class MorphologyFactory(object):
- '''An way of creating morphologies which will provide a default'''
+ '''A way of creating morphologies which will provide a default'''
def __init__(self, local_repo_cache, remote_repo_cache=None, app=None):
self._lrc = local_repo_cache
@@ -78,22 +78,29 @@ class MorphologyFactory(object):
text = None
if self._lrc.has_repo(reponame):
+ self.status(msg="Looking for %s in local repo cache" % filename,
+ chatty=True)
repo = self._lrc.get_repo(reponame)
file_list = repo.ls_tree(sha1)
if filename in file_list:
text = repo.cat(sha1, filename)
elif self._rrc is not None:
+ self.status(msg="Looking for %s in remote repo cache" % filename,
+ chatty=True)
file_list = self._rrc.ls_tree(reponame, sha1)
if filename in file_list:
- self.status(msg="Retrieving %(reponame)s %(sha1)s %(filename)s"
- " from the remote artifact cache.",
- reponame=reponame, sha1=sha1, filename=filename,
- chatty=True)
+ self.status(msg='Retrieving %s %s %s'
+ 'from the remote artifact cache.'
+ % (reponame, sha1, filename), chatty=True)
text = self._rrc.cat_file(reponame, sha1, filename)
else:
raise NotcachedError(reponame)
if text is None:
+ self.status(
+ msg="File %s doesn't exist: "
+ "attempting to infer chunk morph from repo's build system"
+ % filename, chatty=True)
bs = morphlib.buildsystem.detect_build_system(file_list)
if bs is None:
raise AutodetectError(reponame, sha1, filename)