This commit is contained in:
2026-05-09 22:50:51 +02:00
parent 520d3924af
commit ab5a0c7697
79 changed files with 285640 additions and 346 deletions

View File

@@ -47,6 +47,22 @@ def _user_dir():
return os.path.dirname(os.path.abspath(__file__))
def _empfang_pywebview_icon_path() -> str | None:
"""logo.ico fuer pywebview.start(icon=...): zuerst neben EXE, sonst Projektroot."""
candidates = []
if getattr(sys, "frozen", False):
candidates.append(os.path.join(os.path.dirname(sys.executable), "logo.ico"))
meipass = getattr(sys, "_MEIPASS", "")
if meipass:
candidates.append(os.path.join(meipass, "logo.ico"))
here = os.path.dirname(os.path.abspath(__file__))
candidates.append(os.path.join(here, "logo.ico"))
for c in candidates:
if c and os.path.isfile(c):
return c
return None
def _normalize_to_empfang_url(base: str) -> str:
"""Aus Basis-URL (Host oder .../empfang) wird .../empfang/ mit Slash am Ende."""
b = (base or "").strip().rstrip("/")
@@ -506,16 +522,21 @@ def main():
except Exception:
pass
_icon = _empfang_pywebview_icon_path()
_start_kw = {}
if _icon:
_start_kw["icon"] = _icon
try:
if use_iframe_shell:
webview.start()
webview.start(**_start_kw)
elif menu:
try:
webview.start(menu=menu)
webview.start(menu=menu, **_start_kw)
except TypeError:
webview.start()
webview.start(**_start_kw)
else:
webview.start()
webview.start(**_start_kw)
except Exception as e:
print(f"[AZA Empfang] Fehler: {e}")