diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-06-23 15:50:50 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-06-23 16:50:27 +0000 |
commit | f8fbffa2e04182e2f7bc0f64720f7ba925eab333 (patch) | |
tree | eea230c054acc976fc30d01f48dca3057682096c /distbuild | |
parent | fcfe0d9a081e49677644a770c13b2cbe78fe40dd (diff) | |
download | morph-f8fbffa2e04182e2f7bc0f64720f7ba925eab333.tar.gz |
distbuild: Add __str__() and __repr__() to ArtifactReference
This is just to make the log files more readable, as what would
previously have been logged as '<ArtifactReference at 0x1235478>' is
now logged as the actual name of the artifact.
Change-Id: I6189aa1390268cec379dd459fc3f4fecc71363b1
Diffstat (limited to 'distbuild')
-rw-r--r-- | distbuild/artifact_reference.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/distbuild/artifact_reference.py b/distbuild/artifact_reference.py index bdcfbf23..633ed749 100644 --- a/distbuild/artifact_reference.py +++ b/distbuild/artifact_reference.py @@ -30,6 +30,12 @@ class ArtifactReference(object): # pragma: no cover self._basename = basename self._dict = encoded + def __str__(self): + return self._basename + + def __repr__(self): + return '<ArtifactReference: %s>' % self._basename + def __getattr__(self, name): if not name.startswith('_'): return self._dict[name] |