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:
2025-04-19 09:33:54 +02:00
parent a4ccb9081f
commit bde3920fc1
4 changed files with 19 additions and 7 deletions

View File

@@ -9,7 +9,7 @@ __version__ = "1.4.0"
import logging
import sys
from argparse import ArgumentParser, Namespace
from argparse import ArgumentParser, Namespace, SUPPRESS
from configparser import ConfigParser
from enum import Enum
from os import R_OK, W_OK, access, environ, getpid, remove
@@ -262,6 +262,16 @@ parser = ArgumentParser(
prog=programname,
description="Program description",
)
# Use session bus of D-Bus for local testing and development proposes (hidden)
parser.add_argument(
"--use-session-bus",
dest="use_session_bus",
action="store_true",
default=False,
help=SUPPRESS,
)
parser.add_argument("--version", action="version", version=f"%(prog)s {program_version}")
parser.add_argument(
"-f",