lager-cli 0.60.0__tar.gz → 0.62.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lager_cli-0.60.0/lager_cli.egg-info → lager_cli-0.62.0}/PKG-INFO +15 -1
- {lager_cli-0.60.0 → lager_cli-0.62.0}/README.md +14 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/__init__.py +1 -1
- {lager_cli-0.60.0 → lager_cli-0.62.0}/box_storage.py +35 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/__init__.py +3 -1
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/diagnose.py +6 -2
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/hello.py +6 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/instruments.py +7 -1
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/nets.py +37 -24
- lager_cli-0.62.0/commands/communication/wifi.py +405 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/development/debug/commands.py +53 -16
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/development/python.py +26 -16
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/measurement/__init__.py +3 -0
- lager_cli-0.62.0/commands/measurement/dmm.py +152 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/measurement/scope.py +1 -1
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/utility/defaults.py +6 -1
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/utility/install.py +47 -6
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/utility/update.py +216 -17
- {lager_cli-0.60.0 → lager_cli-0.62.0}/context/session.py +5 -3
- {lager_cli-0.60.0 → lager_cli-0.62.0}/deployment/scripts/setup_and_deploy_box.sh +80 -4
- {lager_cli-0.60.0 → lager_cli-0.62.0}/gateway_auth.py +45 -2
- {lager_cli-0.60.0 → lager_cli-0.62.0/lager_cli.egg-info}/PKG-INFO +15 -1
- {lager_cli-0.60.0 → lager_cli-0.62.0}/lager_cli.egg-info/SOURCES.txt +2 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/main.py +3 -1
- {lager_cli-0.60.0 → lager_cli-0.62.0}/terminal/ui/display.py +1 -1
- lager_cli-0.60.0/commands/communication/wifi.py +0 -210
- {lager_cli-0.60.0 → lager_cli-0.62.0}/LICENSE +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/MANIFEST.in +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/NOTICE +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/__main__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/address_utils.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/battery/__init__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/battery/battery_tui.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/battery/websocket_client.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/__init__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/_device_identity.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/_gateway.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/_host_ops.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/_mount_prep.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/_net_preflight.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/_pip_validation.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/_shim_verbs.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/_ssh.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/bench.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/box_group.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/boxes.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/config.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/drivers.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/dut.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/labjack_pins.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/lock.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/net_tui.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/ssh.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/box/ssh_setup.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/communication/__init__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/communication/ble.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/communication/blufi.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/communication/i2c.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/communication/router.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/communication/spi.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/communication/uart.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/communication/usb.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/communication/websocket_client.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/custom.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/development/__init__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/development/arm.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/development/debug/__init__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/development/debug/net_cache.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/development/debug/rtt_websocket_client.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/development/debug/service_client.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/development/debug/service_helper.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/development/debug/tunnel.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/development/devenv.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/measurement/adc.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/measurement/dac.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/measurement/energy.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/measurement/gpi.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/measurement/gpo.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/measurement/logic.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/measurement/thermocouple.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/measurement/watt.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/power/__init__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/power/battery.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/power/battery_model_csv.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/power/eload.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/power/solar.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/power/supply.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/security/__init__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/security/hsm.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/utility/__init__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/utility/_host_cli.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/utility/binaries.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/utility/exec_.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/utility/install_wheel.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/utility/login.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/utility/logs.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/utility/uninstall.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/commands/utility/webcam.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/config.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/context/__init__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/context/ci_detection.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/context/constants.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/context/core.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/context/error_handlers.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/core/__init__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/core/custom_drivers.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/core/group_usage.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/core/matchers.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/core/net_group.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/core/net_helpers.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/core/net_storage.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/core/param_types.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/core/ssh_utils.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/core/tui_keys.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/core/tui_ws_bridge.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/core/utils.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/core/version_skew.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/core/ws_diagnose.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/deployment/__init__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/deployment/scripts/__init__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/deployment/scripts/configure_docker_dns.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/deployment/scripts/configure_docker_dns.sh +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/deployment/scripts/convert_to_sparse_checkout.sh +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/deployment/scripts/setup_ssh_key.sh +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/deployment/security/__init__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/deployment/security/etc_lager_perms.sh +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/deployment/security/secure_box_firewall.sh +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/errors.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/exceptions.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/gateway_tunnel.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/impl/__init__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/impl/box_config.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/impl/measurement/__init__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/impl/measurement/scope.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/impl/measurement/scope_stream.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/impl/power/__init__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/impl/power/enable_disable.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/lager_cli.egg-info/dependency_links.txt +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/lager_cli.egg-info/entry_points.txt +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/lager_cli.egg-info/requires.txt +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/lager_cli.egg-info/top_level.txt +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/pyproject.toml +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/run_record.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/safe_unpickle.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/setup.cfg +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/setup.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/simple_hdlc.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/sort_utils.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/status.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/supply/__init__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/supply/supply_tui.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/supply/websocket_client.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/terminal/__init__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/terminal/core/__init__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/terminal/core/executor.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/terminal/main.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/terminal/ui/__init__.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/terminal/ui/completer.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/terminal/ui/logo.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/terminal/ui/repl.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/terminal/ui/themes.py +0 -0
- {lager_cli-0.60.0 → lager_cli-0.62.0}/update_check.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lager-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.62.0
|
|
4
4
|
Summary: Lager CLI - Box and Docker connectivity
|
|
5
5
|
Home-page: https://github.com/lagerdata/lager
|
|
6
6
|
Author: Lager Data
|
|
@@ -164,6 +164,15 @@ lager scope <net> measure freq
|
|
|
164
164
|
lager logic <net> trigger edge --slope rising --level 1.8
|
|
165
165
|
```
|
|
166
166
|
|
|
167
|
+
### Multimeter
|
|
168
|
+
```bash
|
|
169
|
+
# DC volts on the 20 V range, 10 PLC
|
|
170
|
+
lager dmm <net> dcv --range 20 --nplc 10
|
|
171
|
+
|
|
172
|
+
# 4-wire resistance, JSON output
|
|
173
|
+
lager dmm <net> fres --json
|
|
174
|
+
```
|
|
175
|
+
|
|
167
176
|
### Battery & Solar Simulation
|
|
168
177
|
```bash
|
|
169
178
|
# Set battery state of charge
|
|
@@ -293,6 +302,7 @@ lager box-config apply
|
|
|
293
302
|
- Rigol DP800 series
|
|
294
303
|
- Keysight E36200/E36300 series
|
|
295
304
|
- Keithley 2200/2280 series
|
|
305
|
+
- Siglent SPD1168X (over LAN, create its net with `lager nets add-batch`)
|
|
296
306
|
|
|
297
307
|
### Battery Simulators
|
|
298
308
|
- Keithley 2281S
|
|
@@ -302,6 +312,7 @@ lager box-config apply
|
|
|
302
312
|
|
|
303
313
|
### Oscilloscopes
|
|
304
314
|
- Rigol MSO5000 series
|
|
315
|
+
- Rigol DS1000Z series (DS1054Z, DS1074Z, DS1104Z)
|
|
305
316
|
|
|
306
317
|
### I/O Hardware
|
|
307
318
|
- LabJack T7 (ADC/DAC/GPIO)
|
|
@@ -314,6 +325,9 @@ lager box-config apply
|
|
|
314
325
|
### Robotics
|
|
315
326
|
- Rotrics Dexarm
|
|
316
327
|
|
|
328
|
+
### Multimeters
|
|
329
|
+
- Siglent SDM3065X
|
|
330
|
+
|
|
317
331
|
### Temperature
|
|
318
332
|
- Phidget Thermocouples
|
|
319
333
|
|
|
@@ -110,6 +110,15 @@ lager scope <net> measure freq
|
|
|
110
110
|
lager logic <net> trigger edge --slope rising --level 1.8
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
+
### Multimeter
|
|
114
|
+
```bash
|
|
115
|
+
# DC volts on the 20 V range, 10 PLC
|
|
116
|
+
lager dmm <net> dcv --range 20 --nplc 10
|
|
117
|
+
|
|
118
|
+
# 4-wire resistance, JSON output
|
|
119
|
+
lager dmm <net> fres --json
|
|
120
|
+
```
|
|
121
|
+
|
|
113
122
|
### Battery & Solar Simulation
|
|
114
123
|
```bash
|
|
115
124
|
# Set battery state of charge
|
|
@@ -239,6 +248,7 @@ lager box-config apply
|
|
|
239
248
|
- Rigol DP800 series
|
|
240
249
|
- Keysight E36200/E36300 series
|
|
241
250
|
- Keithley 2200/2280 series
|
|
251
|
+
- Siglent SPD1168X (over LAN, create its net with `lager nets add-batch`)
|
|
242
252
|
|
|
243
253
|
### Battery Simulators
|
|
244
254
|
- Keithley 2281S
|
|
@@ -248,6 +258,7 @@ lager box-config apply
|
|
|
248
258
|
|
|
249
259
|
### Oscilloscopes
|
|
250
260
|
- Rigol MSO5000 series
|
|
261
|
+
- Rigol DS1000Z series (DS1054Z, DS1074Z, DS1104Z)
|
|
251
262
|
|
|
252
263
|
### I/O Hardware
|
|
253
264
|
- LabJack T7 (ADC/DAC/GPIO)
|
|
@@ -260,6 +271,9 @@ lager box-config apply
|
|
|
260
271
|
### Robotics
|
|
261
272
|
- Rotrics Dexarm
|
|
262
273
|
|
|
274
|
+
### Multimeters
|
|
275
|
+
- Siglent SDM3065X
|
|
276
|
+
|
|
263
277
|
### Temperature
|
|
264
278
|
- Phidget Thermocouples
|
|
265
279
|
|
|
@@ -1202,6 +1202,39 @@ import contextlib as _contextlib_for_lock
|
|
|
1202
1202
|
import threading as _threading_for_heartbeat
|
|
1203
1203
|
|
|
1204
1204
|
|
|
1205
|
+
def _exit_cleanly_on_terminate():
|
|
1206
|
+
"""Make SIGTERM and SIGHUP run this process's lock release.
|
|
1207
|
+
|
|
1208
|
+
Python's default action for both kills the process without running
|
|
1209
|
+
``finally`` blocks or ``atexit`` handlers, so a lock taken by a command
|
|
1210
|
+
that is stopped with a plain ``kill`` stayed held until its TTL ran out.
|
|
1211
|
+
A test that backgrounds `lager debug ... gdbserver` and later kills it
|
|
1212
|
+
left its CI job's lock held that way. Raising ``SystemExit`` instead
|
|
1213
|
+
unwinds normally, so the release runs. The exit status is the shell's
|
|
1214
|
+
``128 + signal``, the same one the default action reports.
|
|
1215
|
+
|
|
1216
|
+
A handler someone else installed is left alone, and so is a call off the
|
|
1217
|
+
main thread, where Python cannot install one.
|
|
1218
|
+
"""
|
|
1219
|
+
import signal
|
|
1220
|
+
|
|
1221
|
+
if _threading_for_heartbeat.current_thread() is not _threading_for_heartbeat.main_thread():
|
|
1222
|
+
return
|
|
1223
|
+
|
|
1224
|
+
def _raise_exit(signum, _frame):
|
|
1225
|
+
raise SystemExit(128 + signum)
|
|
1226
|
+
|
|
1227
|
+
for name in ('SIGTERM', 'SIGHUP'):
|
|
1228
|
+
signum = getattr(signal, name, None)
|
|
1229
|
+
if signum is None:
|
|
1230
|
+
continue
|
|
1231
|
+
try:
|
|
1232
|
+
if signal.getsignal(signum) is signal.SIG_DFL:
|
|
1233
|
+
signal.signal(signum, _raise_exit)
|
|
1234
|
+
except (OSError, ValueError):
|
|
1235
|
+
pass
|
|
1236
|
+
|
|
1237
|
+
|
|
1205
1238
|
class HeartbeatThread(_threading_for_heartbeat.Thread):
|
|
1206
1239
|
"""Refreshes the box lock periodically while a command is running.
|
|
1207
1240
|
|
|
@@ -1653,6 +1686,7 @@ def auto_lock_around_command(
|
|
|
1653
1686
|
# actually hold the lock — no surprise release of someone
|
|
1654
1687
|
# else's lock at interpreter shutdown.
|
|
1655
1688
|
_atexit.register(_safe_release)
|
|
1689
|
+
_exit_cleanly_on_terminate()
|
|
1656
1690
|
|
|
1657
1691
|
heartbeat = None
|
|
1658
1692
|
# Heartbeat whenever the lock we're running under has a TTL: locks
|
|
@@ -1864,6 +1898,7 @@ def auto_lock_acquire_for_command(
|
|
|
1864
1898
|
|
|
1865
1899
|
if should_release:
|
|
1866
1900
|
_atexit.register(_release)
|
|
1901
|
+
_exit_cleanly_on_terminate()
|
|
1867
1902
|
if resolved_ttl is not None:
|
|
1868
1903
|
heartbeat = HeartbeatThread(
|
|
1869
1904
|
ip,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
CLI commands package.
|
|
6
6
|
|
|
7
7
|
This package contains grouped command modules organized by domain:
|
|
8
|
-
- measurement/: ADC, DAC, GPI, GPO, scope, logic, thermocouple, watt commands
|
|
8
|
+
- measurement/: ADC, DAC, GPI, GPO, scope, logic, dmm, thermocouple, watt commands
|
|
9
9
|
- power/: Power supply, battery, solar, eload commands
|
|
10
10
|
- communication/: UART, BLE, WiFi, USB commands
|
|
11
11
|
- development/: Debug, ARM, Python commands
|
|
@@ -20,6 +20,7 @@ from .measurement import (
|
|
|
20
20
|
gpo,
|
|
21
21
|
scope,
|
|
22
22
|
logic,
|
|
23
|
+
dmm,
|
|
23
24
|
thermocouple,
|
|
24
25
|
watt,
|
|
25
26
|
)
|
|
@@ -53,6 +54,7 @@ __all__ = [
|
|
|
53
54
|
"gpo",
|
|
54
55
|
"scope",
|
|
55
56
|
"logic",
|
|
57
|
+
"dmm",
|
|
56
58
|
"thermocouple",
|
|
57
59
|
"watt",
|
|
58
60
|
# Communication commands
|
|
@@ -40,7 +40,7 @@ NET_ROLE_CHOICES = [
|
|
|
40
40
|
'auto', 'battery', 'power-supply', 'eload', 'scope', 'debug', 'usb',
|
|
41
41
|
'uart', 'webcam', 'adc', 'dac', 'gpio', 'thermocouple', 'i2c', 'spi',
|
|
42
42
|
'watt-meter', 'energy-analyzer', 'router', 'rotation', 'arm', 'actuate',
|
|
43
|
-
'power-supply-2q', 'wifi', 'analog', 'logic', 'waveform', 'hsm',
|
|
43
|
+
'power-supply-2q', 'wifi', 'analog', 'logic', 'waveform', 'hsm', 'dmm',
|
|
44
44
|
]
|
|
45
45
|
|
|
46
46
|
|
|
@@ -456,10 +456,14 @@ def _fmt_usbhub_lines(d: dict):
|
|
|
456
456
|
|
|
457
457
|
def _classify_usb_hub(d: dict):
|
|
458
458
|
"""(colour, headline) for a USB hub net. Most specific first."""
|
|
459
|
-
if d.get('unavailable')
|
|
459
|
+
if d.get('unavailable'):
|
|
460
460
|
return ('yellow',
|
|
461
461
|
'UNCLEAR — this box does not serve /diagnose/usbhub. '
|
|
462
462
|
'Update the box to diagnose hub nets.')
|
|
463
|
+
# A timeout or 5xx says nothing about the box's version: only a 404
|
|
464
|
+
# (`unavailable`) means the endpoint is missing.
|
|
465
|
+
if d.get('transport_error'):
|
|
466
|
+
return ('red', f'Could not reach the USB hub diagnose endpoint: {d["transport_error"]}')
|
|
463
467
|
|
|
464
468
|
if d.get('enumerated') is False:
|
|
465
469
|
return ('red',
|
|
@@ -32,10 +32,16 @@ def _ref_suffix(box_ref, box_version=None):
|
|
|
32
32
|
Returns '' for a box that reports no ref -- one that predates
|
|
33
33
|
/etc/lager/ref -- so an older box reads exactly as it did before rather
|
|
34
34
|
than gaining a scary-looking blank.
|
|
35
|
+
|
|
36
|
+
A box deployed with ``--fork`` records ``<owner>/<repo>:<ref>@<sha>`` and
|
|
37
|
+
is always flagged, even on a release-shaped ref: a fork's ``v0.52.0`` is
|
|
38
|
+
whatever that fork tagged, not the release.
|
|
35
39
|
"""
|
|
36
40
|
if not box_ref:
|
|
37
41
|
return ''
|
|
38
42
|
ref_name = str(box_ref).split('@', 1)[0]
|
|
43
|
+
if ':' in ref_name:
|
|
44
|
+
return ' ' + click.style(f'({box_ref} -- fork build, not a release)', fg='yellow')
|
|
39
45
|
if looks_like_release_tag(ref_name):
|
|
40
46
|
if box_version and ref_name == f'v{str(box_version).lstrip("v")}':
|
|
41
47
|
return ' (release)'
|
|
@@ -99,9 +99,15 @@ def instruments(ctx, box: str | None) -> None:
|
|
|
99
99
|
else:
|
|
100
100
|
channels_str = "—"
|
|
101
101
|
|
|
102
|
+
# Every camera the box has no name for is listed as UVC_Camera, so
|
|
103
|
+
# its product string is what tells them apart.
|
|
104
|
+
name = dev.get("name", "—")
|
|
105
|
+
if name == "UVC_Camera" and dev.get("product"):
|
|
106
|
+
name = f"{name}\n{dev['product']}"
|
|
107
|
+
|
|
102
108
|
table.add_row(
|
|
103
109
|
[
|
|
104
|
-
|
|
110
|
+
name,
|
|
105
111
|
channels_str,
|
|
106
112
|
dev.get("address", "—"),
|
|
107
113
|
]
|
|
@@ -511,6 +511,7 @@ INSTRUMENT_NET_MAP: dict[str, list[str]] = {
|
|
|
511
511
|
"KEYSIGHT_E36233A": ["power-supply"],
|
|
512
512
|
"KEYSIGHT_E36312A": ["power-supply"],
|
|
513
513
|
"KEYSIGHT_E36313A": ["power-supply"],
|
|
514
|
+
"Siglent_SPD1168X": ["power-supply"],
|
|
514
515
|
|
|
515
516
|
# battery
|
|
516
517
|
"Keithley_2281S": ["battery", "power-supply"],
|
|
@@ -525,6 +526,7 @@ INSTRUMENT_NET_MAP: dict[str, list[str]] = {
|
|
|
525
526
|
|
|
526
527
|
# scope
|
|
527
528
|
"Rigol_MSO5204": ["scope", "scope-channel", "logic"],
|
|
529
|
+
"Rigol_DS1000Z": ["scope", "scope-channel"],
|
|
528
530
|
"Picoscope_2000": ["scope", "scope-channel"],
|
|
529
531
|
# Every PicoScope other than the 2204A/2205A, which the scanner matches by
|
|
530
532
|
# Pico's vendor id rather than per model.
|
|
@@ -573,11 +575,15 @@ INSTRUMENT_NET_MAP: dict[str, list[str]] = {
|
|
|
573
575
|
"Acroname_8Port": ["usb"],
|
|
574
576
|
"Acroname_4Port": ["usb"],
|
|
575
577
|
"YKUSH_Hub": ["usb"],
|
|
578
|
+
"YKUSH3_Hub": ["usb", "gpio"],
|
|
576
579
|
"Plugable_USB_Hub": ["usb"],
|
|
577
580
|
|
|
578
581
|
# eload
|
|
579
582
|
"Rigol_DL3021": ["eload"],
|
|
580
583
|
|
|
584
|
+
# dmm
|
|
585
|
+
"Siglent_SDM3065X": ["dmm"],
|
|
586
|
+
|
|
581
587
|
# webcam
|
|
582
588
|
"Logitech_BRIO_HD": ["webcam"],
|
|
583
589
|
"Logitech_BRIO": ["webcam"],
|
|
@@ -591,6 +597,8 @@ INSTRUMENT_NET_MAP: dict[str, list[str]] = {
|
|
|
591
597
|
"Logitech_C270": ["webcam"],
|
|
592
598
|
"Logitech_StreamCam": ["webcam"],
|
|
593
599
|
"ELP_Global_Shutter_AR0234": ["webcam"],
|
|
600
|
+
"IPEVO_V4K_PRO": ["webcam"],
|
|
601
|
+
"UVC_Camera": ["webcam"],
|
|
594
602
|
|
|
595
603
|
# (robot) arm
|
|
596
604
|
"Rotrix_Dexarm": ["arm"],
|
|
@@ -1976,6 +1984,32 @@ def assign_cmd(ctx, device, list_, usb_serial, port_path, baud, remove_, as_net,
|
|
|
1976
1984
|
click.echo(f" lager nets add <name> {net_role} {channel} '{address}'")
|
|
1977
1985
|
|
|
1978
1986
|
|
|
1987
|
+
# Name prefixes for roles whose first hyphenated word is not the prefix. A
|
|
1988
|
+
# `scope` net stands for the whole instrument and would otherwise share the
|
|
1989
|
+
# `scope` prefix with its `scope-channel` nets; the channels keep `scope<N>`.
|
|
1990
|
+
_NET_NAME_PREFIX = {
|
|
1991
|
+
"power-supply": "supply",
|
|
1992
|
+
"scope": "oscilloscope",
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
|
|
1996
|
+
def _net_name_prefix(role: str) -> str:
|
|
1997
|
+
"""The prefix `nets add-all` puts before the index in a role's net names."""
|
|
1998
|
+
return _NET_NAME_PREFIX.get(role, role.split("-")[0])
|
|
1999
|
+
|
|
2000
|
+
|
|
2001
|
+
def _next_free_net_name(prefix: str, taken: set[str]) -> str:
|
|
2002
|
+
"""`prefix` plus the lowest index from 1 up whose name is not in `taken`.
|
|
2003
|
+
|
|
2004
|
+
Indices are free per name, not per role, so two roles that share a prefix
|
|
2005
|
+
can never produce the same name.
|
|
2006
|
+
"""
|
|
2007
|
+
idx = 1
|
|
2008
|
+
while f"{prefix}{idx}" in taken:
|
|
2009
|
+
idx += 1
|
|
2010
|
+
return f"{prefix}{idx}"
|
|
2011
|
+
|
|
2012
|
+
|
|
1979
2013
|
@nets.command("add-all", help="Add all possible nets that can be created on the box")
|
|
1980
2014
|
@click.option("--box", help="Lager Box name or IP")
|
|
1981
2015
|
@click.option("--yes", is_flag=True, help="Skip confirmation prompt")
|
|
@@ -1987,13 +2021,6 @@ def create_all_cmd(ctx: click.Context, box: str | None, yes: bool) -> None:
|
|
|
1987
2021
|
"""
|
|
1988
2022
|
resolved_box = _resolve_box(ctx, box)
|
|
1989
2023
|
|
|
1990
|
-
def _first_word(role: str) -> str:
|
|
1991
|
-
"""Return the first part of a hyphenated role name."""
|
|
1992
|
-
# Special case: power-supply nets use 'supply' prefix instead of 'power'
|
|
1993
|
-
if role == "power-supply":
|
|
1994
|
-
return "supply"
|
|
1995
|
-
return role.split("-")[0]
|
|
1996
|
-
|
|
1997
2024
|
# Get available instruments and existing nets
|
|
1998
2025
|
inst_list = _fetch_instruments(ctx, resolved_box)
|
|
1999
2026
|
saved_nets = _fetch_saved_nets(ctx, resolved_box)
|
|
@@ -2242,24 +2269,10 @@ def create_all_cmd(ctx: click.Context, box: str | None, yes: bool) -> None:
|
|
|
2242
2269
|
filtered_nets.append(net)
|
|
2243
2270
|
|
|
2244
2271
|
# Assign names to filtered nets (only now that we know which will be created)
|
|
2245
|
-
|
|
2246
|
-
used_indices: dict[str, set[int]] = defaultdict(set)
|
|
2247
|
-
|
|
2248
|
-
# Collect used indices from existing nets
|
|
2249
|
-
for saved_net in saved_nets:
|
|
2250
|
-
m = idx_re.match(saved_net.get("name", ""))
|
|
2251
|
-
if m and _first_word(saved_net.get("role", "")) == m.group(1):
|
|
2252
|
-
used_indices[saved_net.get("role", "")].add(int(m.group(2)))
|
|
2253
|
-
|
|
2254
|
-
# Assign names to new nets
|
|
2272
|
+
taken = {saved_net.get("name", "") for saved_net in saved_nets}
|
|
2255
2273
|
for net in filtered_nets:
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
idx = 1
|
|
2259
|
-
while idx in used_indices[role]:
|
|
2260
|
-
idx += 1
|
|
2261
|
-
used_indices[role].add(idx)
|
|
2262
|
-
net["net"] = f"{_first_word(role)}{idx}"
|
|
2274
|
+
net["net"] = _next_free_net_name(_net_name_prefix(net["type"]), taken)
|
|
2275
|
+
taken.add(net["net"])
|
|
2263
2276
|
|
|
2264
2277
|
# Generate warnings
|
|
2265
2278
|
for inst in sorted(duplicate_hubs, key=_natural_sort_key):
|