Skip to content

Commit

Permalink
Message schemas: one-line descriptions should be the summary
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <[email protected]>
  • Loading branch information
abompard committed Aug 7, 2024
1 parent 19ff52e commit 70e86dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion messaging/copr_messaging/private/hierarchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 4 additions & 2 deletions messaging/copr_messaging/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 70e86dc

Please sign in to comment.