Three kinds of "setting" were tangled into two files and one of them had no screen at all. The radio's settings live on the radio and are edited on Device config. Machine setup -- where the database is, which companion to talk to -- stays in config.toml, a text editor's job. Everything in between was app behaviour: six keys sitting in config.toml with nothing to open them, and a dozen more that were only module constants a reader could never reach. Those are preferences now, and they have a page. core/preferences.py is a PrefSpec registry in the shape of the device-config one -- group, type, bounds, help, and a default -- and the page is built from the same parts as the device editor, deliberately: one grouped lane-aligned list, current -> new staged in warn, Apply/Back appearing only once something is staged, the shared discard confirm on the way out. Two editors that stage values should not be two screens to learn. What it adds is a Defaults section holding one row that stages every changed preference back to its built-in value; it is drawn only while a reset would do something, and it stages rather than writes, so it is as reviewable and as Esc-discardable as any other change and the file is still only ever written by the one action at the bottom. Its rows scroll sideways where the device editor's don't: the explanation is the widest thing on the row and the only part that runs past the edge, so <-> slide it under a pinned setting and value. The file is preferences.yaml and holds only the values you disagree with the code about -- grouped and commented, each entry above its help and its default. That is what lets a later change to a default reach an install that never asked to be exempt; delete a line and the code takes over again. A hand edit gone wrong costs that line, never the session. Every preference is wired to something that reads it. ctx.preferences is the explicit path; preferences.current() is for the render layer, which has no context to reach through, the same reason get_platform() exists. The About pages come along into a This app section, the third scope after this node and other nodes, with Preferences leading it -- the one row there that changes MeshTerm rather than describing it. A section of one would have broken the menu's own no-bucket-of-one rule, and the app's scope is the honest home for both halves anyway. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
57 lines
1.8 KiB
TOML
57 lines
1.8 KiB
TOML
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[project]
|
|
name = "meshterm"
|
|
version = "0.1.0"
|
|
description = "A modern command-line toolkit for tuning and exploring a MeshCore mesh."
|
|
readme = "README.md"
|
|
requires-python = ">=3.10"
|
|
authors = [{ name = "Jean-Pierre Martineau" }]
|
|
license = { text = "Apache-2.0" }
|
|
keywords = ["meshcore", "lora", "mesh", "radio", "cli"]
|
|
|
|
dependencies = [
|
|
"meshcore>=2.3", # companion-device protocol (serial/BLE/TCP)
|
|
"pycryptodome>=3.20", # AES/HMAC for decrypting overheard channel packets
|
|
"pyserial>=3.5", # serial-port enumeration for device discovery
|
|
"bleak>=0.22", # Bluetooth LE scanning + companion connection
|
|
"typer>=0.12", # scripted CLI; subcommands mirror the menu
|
|
"rich>=13.7", # modern console rendering (progress, tables, panels)
|
|
"markdown-it-py>=3.0", # CommonMark parser behind the written About pages
|
|
"prompt_toolkit>=3.0", # full-screen interactive TUI (terminal, input, resize)
|
|
"PyYAML>=6.0", # the preferences file (meshterm.core.preferences)
|
|
"segno>=1.6", # pure-Python QR codes (channel share links)
|
|
"tomli>=2.0; python_version < '3.11'", # TOML config reader on 3.10
|
|
"tomli-w>=1.0", # TOML writer for device-config backups
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"pytest>=8.0",
|
|
"pytest-asyncio>=0.23",
|
|
"ruff>=0.4",
|
|
]
|
|
|
|
[project.scripts]
|
|
meshterm = "meshterm.cli:main"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["meshterm"]
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|
|
target-version = "py310"
|
|
|
|
[tool.ruff.lint]
|
|
select = ["E", "F", "I", "UP", "B", "D"]
|
|
ignore = ["D203", "D213"] # pick one blank-line-before-class / multi-line-summary style
|
|
|
|
[tool.ruff.lint.pydocstyle]
|
|
convention = "google"
|
|
|
|
[tool.pytest.ini_options]
|
|
asyncio_mode = "auto"
|
|
testpaths = ["tests"]
|