From 721c5769f87425db4a693f797dc8ade3bae1ce3a Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 30 Jun 2015 07:26:01 +0000 Subject: [PATCH] move dbus bits to their own module, not in x11 git-svn-id: https://xpra.org/svn/Xpra/trunk@9773 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/xpra/dbus/__init__.py | 4 ++++ src/xpra/{x11/dbus_common.py => dbus/common.py} | 0 src/xpra/{x11/dbus_helper.py => dbus/helper.py} | 2 +- .../notifications_forwarder.py} | 4 ++-- src/xpra/platform/pycups_printing.py | 2 +- src/xpra/platform/xposix/gui.py | 2 +- src/xpra/server/server_base.py | 4 ++-- 7 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 src/xpra/dbus/__init__.py rename src/xpra/{x11/dbus_common.py => dbus/common.py} (100%) rename src/xpra/{x11/dbus_helper.py => dbus/helper.py} (97%) rename src/xpra/{x11/dbus_notifications_forwarder.py => dbus/notifications_forwarder.py} (96%) diff --git a/src/xpra/dbus/__init__.py b/src/xpra/dbus/__init__.py new file mode 100644 index 0000000000..a1f784c7ba --- /dev/null +++ b/src/xpra/dbus/__init__.py @@ -0,0 +1,4 @@ +# This file is part of Xpra. +# Copyright (C) 2015 Antoine Martin +# Xpra is released under the terms of the GNU GPL v2, or, at your option, any +# later version. See the file COPYING for details. diff --git a/src/xpra/x11/dbus_common.py b/src/xpra/dbus/common.py similarity index 100% rename from src/xpra/x11/dbus_common.py rename to src/xpra/dbus/common.py diff --git a/src/xpra/x11/dbus_helper.py b/src/xpra/dbus/helper.py similarity index 97% rename from src/xpra/x11/dbus_helper.py rename to src/xpra/dbus/helper.py index 99bcd90201..c7ca140cb9 100644 --- a/src/xpra/x11/dbus_helper.py +++ b/src/xpra/dbus/helper.py @@ -12,7 +12,7 @@ class DBusHelper(object): def __init__(self): - from xpra.x11.dbus_common import init_session_bus + from xpra.dbus.common import init_session_bus self.bus = init_session_bus() def call_function(self, bus_name, path, interface, function, args, ok_cb, err_cb): diff --git a/src/xpra/x11/dbus_notifications_forwarder.py b/src/xpra/dbus/notifications_forwarder.py similarity index 96% rename from src/xpra/x11/dbus_notifications_forwarder.py rename to src/xpra/dbus/notifications_forwarder.py index 62b72b4a17..74d54265e1 100755 --- a/src/xpra/x11/dbus_notifications_forwarder.py +++ b/src/xpra/dbus/notifications_forwarder.py @@ -71,10 +71,10 @@ def release(self): log.error("failed to release dbus notification forwarder: %s", e) def __str__(self): - return "DBUSNotificationsForwarder(%s)" % BUS_NAME + return "DBUS-NotificationsForwarder(%s)" % BUS_NAME def register(notify_callback=None, close_callback=None, replace=False): - from xpra.x11.dbus_common import init_session_bus + from xpra.dbus.common import init_session_bus bus = init_session_bus() flags = dbus.bus.NAME_FLAG_DO_NOT_QUEUE if replace: diff --git a/src/xpra/platform/pycups_printing.py b/src/xpra/platform/pycups_printing.py index f6a0b5de92..7ddd90b62c 100644 --- a/src/xpra/platform/pycups_printing.py +++ b/src/xpra/platform/pycups_printing.py @@ -113,7 +113,7 @@ def init_dbus_listener(): log("init_dbus_listener() dbus_init=%s", dbus_init) if dbus_init is None: try: - from xpra.x11.dbus_common import init_system_bus + from xpra.dbus.common import init_system_bus system_bus = init_system_bus() log("system bus: %s", system_bus) sig_match = system_bus.add_signal_receiver(handle_dbus_signal, path=DBUS_PATH, dbus_interface=DBUS_IFACE) diff --git a/src/xpra/platform/xposix/gui.py b/src/xpra/platform/xposix/gui.py index ec830fd658..bdc753030e 100644 --- a/src/xpra/platform/xposix/gui.py +++ b/src/xpra/platform/xposix/gui.py @@ -385,7 +385,7 @@ def sleeping_callback(self, *args): def setup_dbus_signals(self): try: - from xpra.x11.dbus_common import init_system_bus + from xpra.dbus.common import init_system_bus bus = init_system_bus() self.system_bus = bus log("setup_dbus_signals() system bus=%s", bus) diff --git a/src/xpra/server/server_base.py b/src/xpra/server/server_base.py index 869cecbdb1..ad0641419a 100644 --- a/src/xpra/server/server_base.py +++ b/src/xpra/server/server_base.py @@ -323,7 +323,7 @@ def init_notification_forwarder(self): log("init_notification_forwarder() enabled=%s", self.notifications) if self.notifications and os.name=="posix" and not sys.platform.startswith("darwin"): try: - from xpra.x11.dbus_notifications_forwarder import register + from xpra.dbus.notifications_forwarder import register self.notifications_forwarder = register(self.notify_callback, self.notify_close_callback) if self.notifications_forwarder: log.info("using notification forwarder: %s", self.notifications_forwarder) @@ -457,7 +457,7 @@ def init_dbus_helper(self): if not self.supports_dbus_proxy: return try: - from xpra.x11.dbus_helper import DBusHelper + from xpra.dbus.helper import DBusHelper self.dbus_helper = DBusHelper() except Exception as e: log.warn("cannot load dbus helper: %s", e)