fix: callback must be called after parent call

This commit is contained in:
Matthias
2024-11-17 11:28:50 +01:00
parent f3b0e404f0
commit 3eb7f296aa
+6 -5
View File
@@ -34,11 +34,7 @@ class CustomProgress(Progress):
refresh: bool = False, refresh: bool = False,
**fields: Any, **fields: Any,
) -> None: ) -> None:
if self._ft_callback: t = super().update(
self._ft_callback(
self.tasks[task_id],
)
return super().update(
task_id, task_id,
total=total, total=total,
completed=completed, completed=completed,
@@ -48,6 +44,11 @@ class CustomProgress(Progress):
refresh=refresh, refresh=refresh,
**fields, **fields,
) )
if self._ft_callback:
self._ft_callback(
self.tasks[task_id],
)
return t
def get_renderable(self) -> ConsoleRenderable | RichCast | str: def get_renderable(self) -> ConsoleRenderable | RichCast | str:
objs = [obj for obj in self._cust_objs] objs = [obj for obj in self._cust_objs]