mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-08 07:18:47 +00:00
Keep stats screen visible
This commit is contained in:
10
src/main.py
10
src/main.py
@@ -295,10 +295,7 @@ def _display_live_stats(
|
|||||||
|
|
||||||
if not sys.stdin or not sys.stdin.isatty():
|
if not sys.stdin or not sys.stdin.isatty():
|
||||||
clear_screen()
|
clear_screen()
|
||||||
if stats_mgr is not None:
|
display_fn()
|
||||||
stats_mgr.display_stats_once(password_manager)
|
|
||||||
else:
|
|
||||||
display_fn()
|
|
||||||
note = get_notification_text(password_manager)
|
note = get_notification_text(password_manager)
|
||||||
if note:
|
if note:
|
||||||
print(note)
|
print(note)
|
||||||
@@ -315,10 +312,7 @@ def _display_live_stats(
|
|||||||
except Exception: # pragma: no cover - sync best effort
|
except Exception: # pragma: no cover - sync best effort
|
||||||
logging.debug("Background sync failed during stats display")
|
logging.debug("Background sync failed during stats display")
|
||||||
clear_screen()
|
clear_screen()
|
||||||
if stats_mgr is not None:
|
display_fn()
|
||||||
stats_mgr.display_stats_once(password_manager)
|
|
||||||
else:
|
|
||||||
display_fn()
|
|
||||||
note = get_notification_text(password_manager)
|
note = get_notification_text(password_manager)
|
||||||
if note:
|
if note:
|
||||||
print(note)
|
print(note)
|
||||||
|
@@ -73,7 +73,7 @@ def test_stats_display_only_once(monkeypatch, capsys):
|
|||||||
monkeypatch.setattr(main, "timed_input", fake_input)
|
monkeypatch.setattr(main, "timed_input", fake_input)
|
||||||
main._display_live_stats(pm, interval=0.01)
|
main._display_live_stats(pm, interval=0.01)
|
||||||
out = capsys.readouterr().out
|
out = capsys.readouterr().out
|
||||||
assert out.count("stats") == 1
|
assert out.count("stats") >= 1
|
||||||
|
|
||||||
|
|
||||||
def test_stats_display_resets_after_exit(monkeypatch, capsys):
|
def test_stats_display_resets_after_exit(monkeypatch, capsys):
|
||||||
|
Reference in New Issue
Block a user