Skip to content

Commit 88a747c

Browse files
fix(ui): restore qfluentwidgets import-time banner suppression
The lazy __getattr__ refactor (3d0d522) dropped the redirect_stdout wrapper around the qfluentwidgets import, so its promo banner printed to the console again. Warm-import the library with stdout redirected before application loads.
1 parent bb382ad commit 88a747c

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/subsearch/ui/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,16 @@
55

66
def __getattr__(name: str) -> Any:
77
if name == "open_settings_window":
8+
_import_qfluentwidgets_silently()
89
from subsearch.ui.application import open_settings_window
910

1011
return open_settings_window
1112
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
13+
14+
15+
def _import_qfluentwidgets_silently() -> None:
16+
import contextlib
17+
import io
18+
19+
with contextlib.redirect_stdout(io.StringIO()):
20+
import qfluentwidgets # noqa: F401 (suppresses the library's import-time promo banner)

0 commit comments

Comments
 (0)