Files
Dispatch/Dispatch_V0.1.1/gui/__init__.py
2026-04-29 08:18:54 +04:00

43 lines
1.4 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
# gui/__init__.py
from __future__ import annotations
from .styles import APP_STYLES
from .components.button import Button
from .components.label import Label
def __getattr__(name: str):
"""Лениво отдать `MainWindow`, не создавая цикл `gui -> window -> hub -> gui`."""
if name == "MainWindow":
from .window import MainWindow
return MainWindow
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
__all__ = [
'MainWindow',
'APP_STYLES',
'Button',
'Label',
]
# ---------------------------------------------------------------------------
# Module workflow notes
# ---------------------------------------------------------------------------
#
# 1) Назначение модуля:
# Пакетный __init__.py для gui/. Реэкспортирует ключевые классы
# для удобного импорта: MainWindow, APP_STYLES, Button, Label.
#
# 2) Зависимости модуля:
# Реимпорт из: styles (APP_STYLES), components.button (Button),
# components.label (Label). MainWindow импортируется лениво через
# __getattr__, чтобы не создавать цикл с hub во время plugin-import.
#
# 3) Экспорт (__all__):
# MainWindow, Button, Label.
# Также доступен APP_STYLES (не в __all__, но импортируется).