diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-10-18 16:11:21 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-10-18 16:17:35 +0200 |
commit | 907d41b765fa3edc6103e7f230f35648e41ecc13 (patch) | |
tree | 53eece4a7dddad926bdd8ad170df915fb7a8d824 | |
parent | 0a735fa69bf5e3d75092cdfad6a12636c2a63ab2 (diff) |
Target: implement repr rather than str
Also, print the class name in the string.
-rw-r--r-- | lbup/targets.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lbup/targets.py b/lbup/targets.py index 5923b02..ababd10 100644 --- a/lbup/targets.py +++ b/lbup/targets.py @@ -56,8 +56,8 @@ class Target(ABC): else: self._logger = logger - def __str__(self): - return "Target{%s/%s}" % (self.dirs, self.excludes) + def __repr__(self): + return "%s{%s/%s}" % (self.__class__.__name__, self.dirs, self.excludes) def _log_command(self, name, retcode, stdout, stderr): self._logger.debug('%s finished with return code %d' % (name, retcode)) |