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.
This commit is contained in:
@@ -17,6 +17,18 @@ class BusType(Enum):
|
|||||||
SYSTEM = "system"
|
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(
|
def simple_call(
|
||||||
method: str,
|
method: str,
|
||||||
*args,
|
*args,
|
||||||
|
|||||||
Reference in New Issue
Block a user