changeset 2742:1f5b02623355

core (xmpp): implemented human friendly __unicode__ for client
author Goffi <goffi@goffi.org>
date Thu, 03 Jan 2019 20:51:08 +0100
parents 1797671827b9
children da59ff099b32
files sat/core/xmpp.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sat/core/xmpp.py	Thu Jan 03 20:49:21 2019 +0100
+++ b/sat/core/xmpp.py	Thu Jan 03 20:51:08 2019 +0100
@@ -69,6 +69,12 @@
         self.actions = {}  # used to keep track of actions for retrieval (key = action_id)
         self.encryption = encryption.EncryptionHandler(self)
 
+    def __unicode__(self):
+        return u"Client instance for profile {profile}".format(profile=self.profile)
+
+    def __str__(self):
+        return self.__unicode__.encode('utf-8')
+
     ## initialisation ##
 
     @defer.inlineCallbacks