diff options
author | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2012-09-20 16:04:36 +0000 |
---|---|---|
committer | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2012-09-21 15:00:05 +0100 |
commit | 4169d564760ed2ea1acc88e89293ea6a46ec6bb8 (patch) | |
tree | 86561efabe59a2e1ca096d3a765ffa513ad0cbd5 /morphlib/localartifactcache.py | |
parent | dbc7cee2d8c0c307e8805bde876b30f2fac2eb46 (diff) | |
download | morph-4169d564760ed2ea1acc88e89293ea6a46ec6bb8.tar.gz |
Add .artifact_filename() to external API of LocalArtifactCache
This adds a way to access the local disk path of the artifact
for an artifact. This is necessary to be able to report it to
the user.
Diffstat (limited to 'morphlib/localartifactcache.py')
-rw-r--r-- | morphlib/localartifactcache.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/morphlib/localartifactcache.py b/morphlib/localartifactcache.py index 51ccb4f6..893359d8 100644 --- a/morphlib/localartifactcache.py +++ b/morphlib/localartifactcache.py @@ -25,7 +25,7 @@ class LocalArtifactCache(object): self.cachedir = cachedir def put(self, artifact): - filename = self._artifact_filename(artifact) + filename = self.artifact_filename(artifact) return morphlib.savefile.SaveFile(filename, mode='w') def put_artifact_metadata(self, artifact, name): @@ -37,7 +37,7 @@ class LocalArtifactCache(object): return morphlib.savefile.SaveFile(filename, mode='w') def has(self, artifact): - filename = self._artifact_filename(artifact) + filename = self.artifact_filename(artifact) return os.path.exists(filename) def has_artifact_metadata(self, artifact, name): @@ -49,7 +49,7 @@ class LocalArtifactCache(object): return os.path.exists(filename) def get(self, artifact): - filename = self._artifact_filename(artifact) + filename = self.artifact_filename(artifact) return open(filename) def get_artifact_metadata(self, artifact, name): @@ -60,7 +60,7 @@ class LocalArtifactCache(object): filename = self._source_metadata_filename(source, cachekey, name) return open(filename) - def _artifact_filename(self, artifact): + def artifact_filename(self, artifact): basename = artifact.basename() return os.path.join(self.cachedir, basename) |