Get a table to render the Progress display. Args: tasks (Iterable[Task]): An iterable of Task instances, one per row of the table. Returns: Table: A table instance.
(self, tasks: Iterable[Task])
| 1560 | yield table |
| 1561 | |
| 1562 | def make_tasks_table(self, tasks: Iterable[Task]) -> Table: |
| 1563 | class="st">"""Get a table to render the Progress display. |
| 1564 | |
| 1565 | Args: |
| 1566 | tasks (Iterable[Task]): An iterable of Task instances, one per row of the table. |
| 1567 | |
| 1568 | Returns: |
| 1569 | Table: A table instance. |
| 1570 | class="st">""" |
| 1571 | table_columns = ( |
| 1572 | ( |
| 1573 | Column(no_wrap=True) |
| 1574 | if isinstance(_column, str) |
| 1575 | else _column.get_table_column().copy() |
| 1576 | ) |
| 1577 | for _column in self.columns |
| 1578 | ) |
| 1579 | table = Table.grid(*table_columns, padding=(0, 1), expand=self.expand) |
| 1580 | |
| 1581 | for task in tasks: |
| 1582 | if task.visible: |
| 1583 | table.add_row( |
| 1584 | *( |
| 1585 | ( |
| 1586 | column.format(task=task) |
| 1587 | if isinstance(column, str) |
| 1588 | else column(task) |
| 1589 | ) |
| 1590 | for column in self.columns |
| 1591 | ) |
| 1592 | ) |
| 1593 | return table |
| 1594 | |
| 1595 | def __rich__(self) -> RenderableType: |
| 1596 | class="st">""class="st">"Makes the Progress class itself renderable."class="st">"" |
no test coverage detected