From d2d2007a322c8187f20ac8c1a0ee6fcb3bd9bc24 Mon Sep 17 00:00:00 2001 From: Jannis Pohlmann Date: Mon, 16 Apr 2012 18:59:25 +0100 Subject: 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". --- morphlib/artifact.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'morphlib/artifact.py') 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) -- cgit v1.2.1