Skip to content

Commit

Permalink
Stringify Task and TaskEvent prettily
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrueden committed Oct 17, 2023
1 parent 147b2d2 commit 59be60e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/appose/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ def __init__(self, task: "Task", response_type: ResponseType) -> None:
self.task: "Task" = task
self.response_type: ResponseType = response_type

def __str__(self):
return f"[{self.response_type}] {self.task}"


# noinspection PyProtectedMember
class Task:
Expand Down Expand Up @@ -354,3 +357,9 @@ def _handle(self, response: Args) -> None:
if self.status.is_finished():
with self.cv:
self.cv.notify_all()

def __str__(self):
return (
f"{self.uuid=}, {self.status=}, {self.message=}, "
f"{self.current=}, {self.maximum=}, {self.error=}"
)

0 comments on commit 59be60e

Please sign in to comment.