From: Thorsten S Date: Wed, 1 May 2019 09:14:41 +0000 (+0200) Subject: nicer representation for actions X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=7451826f08e1dfcdb8c0436ca5801fc0ff63857c;p=urlbot-v3.git nicer representation for actions --- 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__