wesktop v0.7.0 /src.wesktop.desktop
On this page

Native desktop window via pywebview, backed by a Granian ASGI server in a daemon thread, with automatic server lifecycle and window close handling.

#src.wesktop.desktop

#src.wesktop.desktop

Native desktop window via pywebview, backed by a Granian ASGI server in a daemon thread, with automatic server lifecycle and window close handling.

#ensure_gui_backend

python
def ensure_gui_backend() -> bool

Make pywebview's GUI backend importable in isolated venvs.

If gi (PyGObject) is not importable, searches common system site-packages locations and adds the first one found to sys.path. Returns True if a backend is available, False otherwise.

#_has_gui_backend

python
def _has_gui_backend() -> bool

Probe whether pywebview can load a GUI backend (GTK or Qt).

Returns True if at least one backend is loadable, False otherwise. On non-Linux platforms, always returns True (pywebview uses native APIs).

#_entry_exists

python
def _entry_exists(name: str) -> bool

Check whether a desktop entry already exists for name on the current platform.

#_auto_register_entry

python
def _auto_register_entry(title: str, icon: str | None) -> None

Create a desktop entry for this app if one doesn't exist.

Self-heals: if an existing entry points to a missing launcher script (e.g. the package was reinstalled to a different venv), remove the broken entry so it can be recreated with the current launcher path.

#run

python
def run(target: str | Callable, *, title: str='wesktop', width: int=1280, height: int=800, icon: str | None=None, host: str | None=None, port: int | None=None, pid_path: Path | None=None, name: str='WESKTOP', pre_serve: Callable[[], None] | None=None, reload: bool=False, js_api: object | None=None, single_instance: bool=True) -> None

Start server + open native desktop window. Blocks until window closes.