diff cagou/plugins/plugin_wid_chat.py @ 156:826e7b17a19b

chat: added __unicode__ and __str__
author Goffi <goffi@goffi.org>
date Fri, 27 Apr 2018 17:36:02 +0200
parents 654b00fa3fdc
children 0ddd2b20cc6b
line wrap: on
line diff
--- a/cagou/plugins/plugin_wid_chat.py	Fri Apr 27 16:46:58 2018 +0200
+++ b/cagou/plugins/plugin_wid_chat.py	Fri Apr 27 17:36:02 2018 +0200
@@ -225,6 +225,15 @@
         self._hi_comp_dropdown = DropDown()
         self._hi_comp_allowed = True
 
+    def __unicode__(self):
+        return u"Chat({})".format(self.target)
+
+    def __str__(self):
+        return self.__unicode__().encode('utf-8')
+
+    def __repr__(self):
+        return self.__str__()
+
     @classmethod
     def factory(cls, plugin_info, target, profiles):
         profiles = list(profiles)