From 70e86dc29ac316b14012ebc76a1a7ba464226aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= <aurelien@bompard.org> Date: Mon, 29 Jul 2024 10:38:34 +0200 Subject: [PATCH] Message schemas: one-line descriptions should be the summary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Bompard <aurelien@bompard.org> --- messaging/copr_messaging/private/hierarchy.py | 3 ++- messaging/copr_messaging/schema.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/messaging/copr_messaging/private/hierarchy.py b/messaging/copr_messaging/private/hierarchy.py index 4d792cc85..c846fa6ec 100644 --- a/messaging/copr_messaging/private/hierarchy.py +++ b/messaging/copr_messaging/private/hierarchy.py @@ -33,7 +33,8 @@ def __init__(self, *args, **kwargs): """ Base class that all Copr messages should inherit from. """ - def __str__(self): + def summary(self): + """A one-line, human-readable representation of this message.""" return "Unspecified Copr message" def _str_prefix(self): diff --git a/messaging/copr_messaging/schema.py b/messaging/copr_messaging/schema.py index 6a61beac5..ab8b18023 100644 --- a/messaging/copr_messaging/schema.py +++ b/messaging/copr_messaging/schema.py @@ -39,7 +39,8 @@ def status(self): """ raise NotImplementedError - def __str__(self): + def summary(self): + """A one-line, human-readable representation of this message.""" return '{0}: chroot "{1}" ended as "{2}".'.format( super(BuildChrootEnded, self)._str_prefix(), self.chroot, @@ -61,7 +62,8 @@ class BuildChrootStarted(_BuildChrootMessage): Representation of a message sent by Copr build system right before some Copr worker starts working on a build in a particular mock chroot. """ - def __str__(self): + def summary(self): + """A one-line, human-readable representation of this message.""" return '{0}: chroot "{1}" started.'.format( super(BuildChrootStarted, self)._str_prefix(), self.chroot,