summaryrefslogtreecommitdiff
path: root/morphlib/morphologyfactory.py
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2012-09-28 14:07:07 +0000
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2012-09-28 14:07:07 +0000
commitf913feca5121f2cc8e63cbe0eba95928e94c8fcf (patch)
tree8debcf8b27808ec7818dce820d3370aab5f6fe60 /morphlib/morphologyfactory.py
parent1087f571c7cd7c18d2984df3cc90c87410c55bb2 (diff)
downloadmorph-f913feca5121f2cc8e63cbe0eba95928e94c8fcf.tar.gz
Increase verbosity regarding the remote artifact cache.
This simply increases the verbosity of the operations which are done against the remote artifact cache. It should result in some progress messages if you build with --verbose set and you're mostly getting stuff from your remote artifact cache (Trove).
Diffstat (limited to 'morphlib/morphologyfactory.py')
-rw-r--r--morphlib/morphologyfactory.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/morphlib/morphologyfactory.py b/morphlib/morphologyfactory.py
index 64022394..a219ed9b 100644
--- a/morphlib/morphologyfactory.py
+++ b/morphlib/morphologyfactory.py
@@ -39,9 +39,14 @@ class MorphologyFactory(object):
'''An way of creating morphologies which will provide a default'''
- def __init__(self, local_repo_cache, remote_repo_cache=None):
+ def __init__(self, local_repo_cache, remote_repo_cache=None, app=None):
self._lrc = local_repo_cache
self._rrc = remote_repo_cache
+ self._app = app
+
+ def status(self, *args, **kwargs): # pragma: no cover
+ if self._app is not None:
+ self._app.status(*args, **kwargs)
def get_morphology(self, reponame, sha1, filename):
@@ -54,6 +59,10 @@ class MorphologyFactory(object):
elif self._rrc is not None:
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)
text = self._rrc.cat_file(reponame, sha1, filename)
else:
raise NotcachedError(reponame)