add repr method to encryption key
authorKali Kaneko <kali@leap.se>
Sat, 11 May 2013 14:33:50 +0000 (23:33 +0900)
committerKali Kaneko <kali@leap.se>
Sat, 11 May 2013 14:33:50 +0000 (23:33 +0900)
src/leap/common/keymanager/keys.py

index 2e6bfe9..d98bd02 100644 (file)
@@ -155,6 +155,16 @@ class EncryptionKey(object):
             'tags': ['keymanager-key'],
         })
 
+    def __repr__(self):
+        """
+        Representation of this class
+        """
+        return u"<%s 0x%s (%s - %s)>" % (
+            self.__class__.__name__,
+            self.key_id,
+            self.address,
+            "priv" if self.private else "publ")
+
 
 #
 # Encryption schemes