Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions forgewatch/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Shared D-Bus constants for the forgewatch daemon.

These values are used by both the daemon (``dbus_service``) and the
indicator client so that the bus name, object path, and interface name
stay in sync across processes.
"""

BUS_NAME = "org.forgewatch.Daemon"
OBJECT_PATH = "/org/forgewatch/Daemon"
INTERFACE_NAME = "org.forgewatch.Daemon"
7 changes: 2 additions & 5 deletions forgewatch/dbus_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from dbus_next.aio.message_bus import MessageBus
from dbus_next.service import ServiceInterface, method, signal

from .constants import BUS_NAME, INTERFACE_NAME, OBJECT_PATH

if TYPE_CHECKING:
from collections.abc import Awaitable, Callable

Expand All @@ -24,11 +26,6 @@

logger = logging.getLogger(__name__)

# D-Bus naming constants
BUS_NAME = "org.forgewatch.Daemon"
OBJECT_PATH = "/org/forgewatch/Daemon"
INTERFACE_NAME = "org.forgewatch.Daemon"


# ---------------------------------------------------------------------------
# Serialisation helpers
Expand Down
9 changes: 2 additions & 7 deletions forgewatch/indicator/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
from dbus_next.constants import MessageType
from dbus_next.errors import DBusError

from forgewatch.constants import BUS_NAME, INTERFACE_NAME, OBJECT_PATH

from .models import DaemonStatus, PRInfo

if TYPE_CHECKING:
Expand All @@ -27,13 +29,6 @@

logger = logging.getLogger(__name__)

# D-Bus coordinates — duplicated from dbus_service.py intentionally
# because the indicator is a separate process and should not import
# daemon internals.
BUS_NAME = "org.forgewatch.Daemon"
OBJECT_PATH = "/org/forgewatch/Daemon"
INTERFACE_NAME = "org.forgewatch.Daemon"

_RECONNECT_INTERVAL_S = 10


Expand Down