diff options
author | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-04-16 18:59:25 +0100 |
---|---|---|
committer | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-04-16 19:06:08 +0100 |
commit | d2d2007a322c8187f20ac8c1a0ee6fcb3bd9bc24 (patch) | |
tree | 49b61ef154fa5f862661b9e8b559537defbac592 /morphlib/artifact.py | |
parent | 817ceb17ab2e10aad32a2eeddcd95b2c973ef355 (diff) | |
download | morph-d2d2007a322c8187f20ac8c1a0ee6fcb3bd9bc24.tar.gz |
Change __str__() method of Artifact, add basename() method.
The __str__() method returns "x|y|z|a" where x is the repo, y is the
original ref, z is the morphology filename and a is the name of the
artifact. This is a consistent extension of the str() implementation
of Source, which returns just "x|y|z".
Diffstat (limited to 'morphlib/artifact.py')
-rw-r--r-- | morphlib/artifact.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/morphlib/artifact.py b/morphlib/artifact.py index e335b4cb..f5c2e8a5 100644 --- a/morphlib/artifact.py +++ b/morphlib/artifact.py @@ -48,8 +48,10 @@ class Artifact(object): '''Do we depend on ``artifact``?''' return artifact in self.dependencies - def __str__(self): # pragma: no cover + def basename(self): # pragma: no cover return '%s.%s.%s' % (self.cache_key, self.source.morphology['kind'], self.name) + def __str__(self): # pragma: no cover + return '%s|%s' % (self.source, self.name) |