From de1774f60ea5cf8d30231019c9bed8c3e56023a0 Mon Sep 17 00:00:00 2001 From: Sven Sager Date: Mon, 21 Apr 2025 10:55:32 +0200 Subject: [PATCH] feat(cli): Add CLI support for RevPi configuration object (revpi-config) This implements a new command "config" in the CLI to handle RevPi configuration. It includes parsing and subparser setup for configuration-related operations. The change improves usability by extending CLI functionality to manage RevPi configuration objects. --- src/revpi_middleware/cli_commands/dbus_helper.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/revpi_middleware/cli_commands/dbus_helper.py b/src/revpi_middleware/cli_commands/dbus_helper.py index e14f072..45d6690 100644 --- a/src/revpi_middleware/cli_commands/dbus_helper.py +++ b/src/revpi_middleware/cli_commands/dbus_helper.py @@ -17,6 +17,18 @@ class BusType(Enum): SYSTEM = "system" +def get_properties( + property_name: str, + interface: str, + object_path=REVPI_DBUS_BASE_PATH, + bus_type=BusType.SYSTEM, +): + bus = SessionBus() if bus_type is BusType.SESSION else SystemBus() + revpi = bus.get(REVPI_DBUS_NAME, object_path) + iface = revpi[interface] + return getattr(iface, property_name) + + def simple_call( method: str, *args,