From 7451826f08e1dfcdb8c0436ca5801fc0ff63857c Mon Sep 17 00:00:00 2001 From: Thorsten S Date: Wed, 1 May 2019 11:14:41 +0200 Subject: [PATCH] nicer representation for actions --- distbot/common/action.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/distbot/common/action.py b/distbot/common/action.py index 7ea70fd..c754c0a 100644 --- a/distbot/common/action.py +++ b/distbot/common/action.py @@ -34,6 +34,14 @@ class Action: self.command = kwargs.get('command') + def __repr__(self): + properties = [ + "%s='%s'" % (key, str(self.__getattribute__(key))) for key in + ["msg", "priv_msg", "presence", "sender", "recipient", "event", "stop_event", "time", "mutex", "command"] if + self.__getattribute__(key) is not None + ] + return "" % " ".join(properties) + @property def serializable(self): return self.__dict__ -- 2.39.2