Skip to content

Commit 764cff7

Browse files
committed
Refactored private public attributes for LiveCollection.
1 parent 3f32f24 commit 764cff7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/_pytask/live.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def pytask_post_parse(config: dict[str, Any]) -> None:
8888
)
8989
config["pm"].register(live_execution, "live_execution")
9090

91-
live_collection = LiveCollection(live_manager)
91+
live_collection = LiveCollection(live_manager=live_manager)
9292
config["pm"].register(live_collection, "live_collection")
9393

9494

@@ -292,18 +292,18 @@ def update_reports(self, new_report: ExecutionReport) -> None:
292292
self._update_table()
293293

294294

295-
@attr.s(eq=False)
295+
@attr.s(eq=False, kw_only=True)
296296
class LiveCollection:
297297
"""A class for managing the live status during the collection."""
298298

299-
_live_manager = attr.ib(type=LiveManager)
299+
live_manager = attr.ib(type=LiveManager)
300300
_n_collected_tasks = attr.ib(default=0, type=int)
301301
_n_errors = attr.ib(default=0, type=int)
302302

303303
@hookimpl(hookwrapper=True)
304304
def pytask_collect(self) -> Generator[None, None, None]:
305-
"""Start the status of the cllection."""
306-
self._live_manager.start()
305+
"""Start the status of the collection."""
306+
self.live_manager.start()
307307
yield
308308

309309
@hookimpl
@@ -315,7 +315,7 @@ def pytask_collect_file_log(self, reports: list[CollectionReport]) -> None:
315315
@hookimpl(hookwrapper=True)
316316
def pytask_collect_log(self) -> Generator[None, None, None]:
317317
"""Stop the live display when all tasks have been collected."""
318-
self._live_manager.stop(transient=True)
318+
self.live_manager.stop(transient=True)
319319
yield
320320

321321
def _update_statistics(self, reports: list[CollectionReport]) -> None:
@@ -331,7 +331,7 @@ def _update_statistics(self, reports: list[CollectionReport]) -> None:
331331
def _update_status(self) -> None:
332332
"""Update the status."""
333333
status = self._generate_status()
334-
self._live_manager.update(status)
334+
self.live_manager.update(status)
335335

336336
def _generate_status(self) -> Status:
337337
"""Generate the status."""

0 commit comments

Comments
 (0)