feat: Add session bus option for local testing and development
Introduced a `--use-session-bus` flag to optionally use the D-Bus session bus instead of the system bus. This allows better flexibility for local testing and development scenarios without requiring system-level changes. Updated related classes and functions to respect the new flag.
This commit is contained in:
@@ -6,7 +6,7 @@ from logging import getLogger
|
||||
from threading import Thread
|
||||
|
||||
from gi.repository import GLib
|
||||
from pydbus import SystemBus
|
||||
from pydbus import SessionBus, SystemBus
|
||||
|
||||
from . import REVPI_DBUS_NAME
|
||||
from .process_image import InterfacePiControl
|
||||
@@ -20,11 +20,12 @@ class BusProvider(Thread):
|
||||
self,
|
||||
picontrol_device="/dev/piControl0",
|
||||
config_rsc="/etc/revpi/config.rsc",
|
||||
use_system_bus=True,
|
||||
):
|
||||
log.debug("enter BusProvider.__init__")
|
||||
super().__init__()
|
||||
|
||||
self._bus = SystemBus()
|
||||
self._bus = SystemBus() if use_system_bus else SessionBus()
|
||||
self._loop = GLib.MainLoop()
|
||||
|
||||
self.picontrol_device = picontrol_device
|
||||
|
||||
Reference in New Issue
Block a user