plesty.server.view.dialogs

The console’s pop-up views: declare a device, run a field test, follow a job.

Each dialog collects an intent and turns it into a model object (DeviceSpec, FieldTestRun); the window hands that to the presenter. JobDialog is the one that renders as it goes: it tails a job log through the presenter until the job ends.

Classes

DeclareDialog

Add (or edit) a device declaration.

FieldTestDialog

Configure a field-test run for one device.

JobDialog

Follow one job: its log as it grows, its state, a cancel button.

DeviceConfigDialog

Edit → Device config…: the declaration and the .env file of one device, tabbed.

FleetFileDialog

Edit → Fleet file…: the fleet as YAML, validated before it is written.

CatalogueDialog

Catalogue → Search & install…: the hub's device modules, put on this bench.

Functions

confirm(→ bool)

A yes/no question; True when confirmed.

alert(→ None)

Show an error.

about(→ None)

The About box, with the PLESTY mark.

Module Contents

class plesty.server.view.dialogs.DeclareDialog(parent: PySide6.QtWidgets.QWidget | None = None, spec: plesty.server.model.DeviceSpec | None = None, options: plesty.server.presenter.SourceOptions | None = None, packages: tuple[str, Ellipsis] = (), options_for: collections.abc.Callable[[str], plesty.server.presenter.SourceOptions] | None = None, info_for: collections.abc.Callable[[str], Any] | None = None)

Bases: PySide6.QtWidgets.QDialog

Add (or edit) a device declaration.

The source is one of two, never both: a release (PyPI, pinned to a version or the newest) or a repository (git URL at a ref). The version and ref fields are editable drop-downs filled from what the bench knows (SourceOptions); anything else can be typed.

Build the form.

Parameters:
  • parent (PySide6.QtWidgets.QWidget | None) – Qt parent.

  • spec (plesty.server.model.DeviceSpec | None) – The declaration to edit; None declares a new device.

  • options (plesty.server.presenter.SourceOptions | None) – Drop-down contents for the (initial) package.

  • packages (tuple[str, Ellipsis]) – Installed modules a new device may be declared from — the only choices; the catalogue installs new ones.

  • options_for (collections.abc.Callable[[str], plesty.server.presenter.SourceOptions] | None) – Returns the drop-down contents for a package, called when the user picks another one.

  • info_for (collections.abc.Callable[[str], Any] | None) – Returns the package-level record (repository, latest release) shown read-only under the package.

_options_for = None
_info_for = None
name
_proposed
package
release_radio
repo_radio
_source_group
version
git
ref
args
env
autostart
project
hint
error
_spec: plesty.server.model.DeviceSpec | None = None
property repository_mode: bool

Whether the repository source is selected (else the release).

Return type:

bool

property package_name: str

The package the declaration names.

Return type:

str

show_project(info: Any) None

Show the package’s project page and latest release (a PackageInfo).

Parameters:

info (Any)

Return type:

None

_package_changed(package: str) None

Refill the version/ref/url drop-downs (and the project line) for another package.

Parameters:

package (str)

Return type:

None

_source_changed(*_args: object) None
Parameters:

_args (object)

Return type:

None

to_spec() plesty.server.model.DeviceSpec

The declaration the form describes.

Raises:

FleetError – When a field is malformed.

Return type:

plesty.server.model.DeviceSpec

property spec: plesty.server.model.DeviceSpec | None

The accepted declaration, or None when cancelled.

Return type:

plesty.server.model.DeviceSpec | None

_accept() None
Return type:

None

class plesty.server.view.dialogs.FieldTestDialog(name: str, parent: PySide6.QtWidgets.QWidget | None = None)

Bases: PySide6.QtWidgets.QDialog

Configure a field-test run for one device.

The gates are the standard plesty-lib field-test gates as check boxes (all checked = the script’s default: run everything); a script’s own --help may narrow the list once the window has fetched it.

Build the form for device name.

Parameters:
  • name (str)

  • parent (PySide6.QtWidgets.QWidget | None)

tier
address
gate_boxes: dict[str, PySide6.QtWidgets.QCheckBox]
gates_box
_gates_layout
repetitions
keep_going
keep_server
extra
options_label
error
_run: plesty.server.model.FieldTestRun | None = None
_set_gates(gates: list[str]) None

Rebuild the gate check boxes (all checked).

Parameters:

gates (list[str])

Return type:

None

show_options(info: dict[str, list[str]]) None

Show what the device’s script accepts (fetched by the window off the GUI thread).

Parameters:

info (dict[str, list[str]])

Return type:

None

property selected_gates: tuple[str, Ellipsis] | None

The checked gates in order, or None when all are checked (= run everything).

Return type:

tuple[str, Ellipsis] | None

to_run() plesty.server.model.FieldTestRun

The request the form describes.

Raises:

FleetError – When a field is malformed (e.g. no gate checked).

Return type:

plesty.server.model.FieldTestRun

property run: plesty.server.model.FieldTestRun | None

The accepted request, or None when cancelled.

Return type:

plesty.server.model.FieldTestRun | None

_accept() None
Return type:

None

class plesty.server.view.dialogs.JobDialog(bench: plesty.server.presenter.Bench, job: plesty.server.model.Job, parent: PySide6.QtWidgets.QWidget | None = None, poll_ms: int = 400, on_finished: collections.abc.Callable[[plesty.server.model.Job], None] | None = None)

Bases: PySide6.QtWidgets.QDialog

Follow one job: its log as it grows, its state, a cancel button.

Start tailing job through bench.

Parameters:
bench
job
_offset = 0
_on_finished = None
_finished = False
state
log
cancel_button
close_button
_timer
poll() None

Read new log text and the job state; stop polling when it ended.

Return type:

None

_cancel() None
Return type:

None

plesty.server.view.dialogs.confirm(parent: PySide6.QtWidgets.QWidget | None, title: str, text: str) bool

A yes/no question; True when confirmed.

Parameters:
  • parent (PySide6.QtWidgets.QWidget | None)

  • title (str)

  • text (str)

Return type:

bool

plesty.server.view.dialogs.alert(parent: PySide6.QtWidgets.QWidget | None, title: str, text: str) None

Show an error.

Parameters:
  • parent (PySide6.QtWidgets.QWidget | None)

  • title (str)

  • text (str)

Return type:

None

plesty.server.view.dialogs.about(parent: PySide6.QtWidgets.QWidget | None, version: str) None

The About box, with the PLESTY mark.

Parameters:
  • parent (PySide6.QtWidgets.QWidget | None)

  • version (str)

Return type:

None

class plesty.server.view.dialogs.DeviceConfigDialog(bench: plesty.server.presenter.Bench, name: str, parent: PySide6.QtWidgets.QWidget | None = None)

Bases: PySide6.QtWidgets.QDialog

Edit → Device config…: the declaration and the .env file of one device, tabbed.

Build the dialog for device name on bench.

Parameters:
bench
name
declare
env
env_highlighter
tabs
error
_save() None
Return type:

None

class plesty.server.view.dialogs.FleetFileDialog(bench: plesty.server.presenter.Bench, parent: PySide6.QtWidgets.QWidget | None = None)

Bases: PySide6.QtWidgets.QDialog

Edit → Fleet file…: the fleet as YAML, validated before it is written.

Show the current fleet text of bench.

Parameters:
bench
editor
error
_save() None
Return type:

None

class plesty.server.view.dialogs.CatalogueDialog(bench: plesty.server.presenter.Bench, parent: PySide6.QtWidgets.QWidget | None = None, worker: Any = None)

Bases: PySide6.QtWidgets.QDialog

Catalogue → Search & install…: the hub’s device modules, put on this bench.

A market place, and nothing more: installing from it stocks the bench with a module. No device is declared and no fleet file is touched — Edit ▸ Add device… does that, choosing from what the bench holds.

The source is the one the bench can carry out: a release from PyPI, which needs only uv, or the repository at a ref, which needs git. Which of the two a module offers is what PyPI is asked on selection.

Build the dialog; the catalogue is fetched on load().

Parameters:
  • bench (plesty.server.presenter.Bench) – The presenter.

  • parent (PySide6.QtWidgets.QWidget | None) – Qt parent.

  • worker (Any) – Runs the PyPI lookup off the GUI thread; without one it is done in place (tests).

bench
_entries: list[Any] = []
_shown: list[Any] = []
_releases: dict[str, str | None]
_worker = None
_item_type
query
vendor
table
release_radio
repo_radio
_source_group
version
ref
source_note
install_button
status
error
selected_entry: Any = None
started_job: plesty.server.model.Job | None = None
load(entries: list[Any]) None

Show entries (fetched by the caller, off the GUI thread).

Parameters:

entries (list[Any])

Return type:

None

apply_filter() None

Repaint the table for the current query and vendor.

Return type:

None

_on_bench(package: str) str

What this bench already holds of package: versions and refs, or .

Parameters:

package (str)

Return type:

str

_selection_changed() None
Return type:

None

_ask_pypi(package: str) None

Look up the newest release of package, off the GUI thread when it can.

Parameters:

package (str)

Return type:

None

_show_source(package: str, release: str | None) None

Select the source the bench can carry out, and say why it is that one.

Parameters:
  • package (str)

  • release (str | None)

Return type:

None

_source_changed() None
Return type:

None

_install() None
Return type:

None