mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-10 00:09:04 +00:00
Add StatsManager for single display
This commit is contained in:
20
src/seedpass/core/stats_manager.py
Normal file
20
src/seedpass/core/stats_manager.py
Normal file
@@ -0,0 +1,20 @@
|
||||
"""Manage display of stats screens."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
class StatsManager:
|
||||
"""Track whether stats have been displayed."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
self._displayed = False
|
||||
|
||||
def display_stats_once(self, manager) -> None:
|
||||
"""Display stats using ``manager`` once per reset."""
|
||||
if not self._displayed:
|
||||
manager.display_stats()
|
||||
self._displayed = True
|
||||
|
||||
def reset(self) -> None:
|
||||
"""Reset the displayed flag."""
|
||||
self._displayed = False
|
Reference in New Issue
Block a user