[Python-modules-commits] [python-digitalocean] 03/19: Implement __repr__ for droplets
Andrew Starr-Bochicchio
asb at moszumanska.debian.org
Tue Jun 20 00:31:27 UTC 2017
This is an automated email from the git hooks/post-receive script.
asb pushed a commit to annotated tag 1.10.1
in repository python-digitalocean.
commit 72a79ec99ef34a656b091562e15c6d551d1e6657
Author: Szabolcs Dombi <cprogrammer1994 at gmail.com>
Date: Mon Oct 3 15:22:01 2016 +0300
Implement __repr__ for droplets
---
digitalocean/Droplet.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/digitalocean/Droplet.py b/digitalocean/Droplet.py
index 82c1cdb..2ce4a72 100644
--- a/digitalocean/Droplet.py
+++ b/digitalocean/Droplet.py
@@ -627,4 +627,7 @@ class Droplet(BaseAPI):
return kernels
def __str__(self):
- return "%s %s" % (self.id, self.name)
+ return "<Droplet %s %s>" % (self.id, self.name)
+
+ def __repr__(self):
+ return str(self)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-digitalocean.git
More information about the Python-modules-commits
mailing list