plesty.server.view.app

Open the console: Qt application, plesty-lib theme, our stylesheet, the window.

Attributes

UI_FONTS

MONO_FONTS

Functions

pick_font(→ str)

The first of candidates the host has, else fallback — quoted for QSS.

stylesheet(→ str)

The console stylesheet: assets/console.qss with the palette and fonts substituted.

mark_icon(→ PySide6.QtGui.QIcon)

The PLESTY mark (assets/plesty-mark.svg, the static version) as a window icon.

application(→ PySide6.QtWidgets.QApplication)

The running Qt application, created, themed and branded when there is none.

build_window(→ plesty.server.view.window.MainWindow)

A themed main window on bench (the application must exist).

run_gui(→ int)

Open the console on bench and run until the window closes; returns the exit code.

_version(→ str)

Module Contents

plesty.server.view.app.UI_FONTS = ('Inter', 'SF Pro Text', 'Segoe UI', 'Helvetica Neue', 'Arial')
plesty.server.view.app.MONO_FONTS = ('SF Mono', 'Menlo', 'Consolas', 'DejaVu Sans Mono', 'Courier New')
plesty.server.view.app.pick_font(candidates: tuple[str, Ellipsis], fallback: str) str

The first of candidates the host has, else fallback — quoted for QSS.

Asked rather than listed: Qt warns at start-up for every stylesheet family that is missing on the host, and the answer differs per bench.

Parameters:
  • candidates (tuple[str, Ellipsis])

  • fallback (str)

Return type:

str

plesty.server.view.app.stylesheet(theme: plesty.lib.ui.theme.Theme | None = None) str

The console stylesheet: assets/console.qss with the palette and fonts substituted.

Parameters:

theme (plesty.lib.ui.theme.Theme | None)

Return type:

str

plesty.server.view.app.mark_icon() PySide6.QtGui.QIcon

The PLESTY mark (assets/plesty-mark.svg, the static version) as a window icon.

Return type:

PySide6.QtGui.QIcon

plesty.server.view.app.application() PySide6.QtWidgets.QApplication

The running Qt application, created, themed and branded when there is none.

Return type:

PySide6.QtWidgets.QApplication

plesty.server.view.app.build_window(bench: plesty.server.presenter.Bench, title: str | None = None) plesty.server.view.window.MainWindow

A themed main window on bench (the application must exist).

Parameters:
Return type:

plesty.server.view.window.MainWindow

plesty.server.view.app.run_gui(bench: plesty.server.presenter.Bench, title: str | None = None) int

Open the console on bench and run until the window closes; returns the exit code.

Parameters:
Return type:

int

plesty.server.view.app._version() str
Return type:

str