def register(notify_callback=None, close_callback=None, replace=False):
    from xpra.x11.dbus_common import init_session_bus
    bus = init_session_bus()
    flags = dbus.bus.NAME_FLAG_DO_NOT_QUEUE
    if replace:
        flags |= dbus.bus.NAME_FLAG_REPLACE_EXISTING
    request = bus.request_name(BUS_NAME, flags)
    if request==dbus.bus.REQUEST_NAME_REPLY_EXISTS:
        raise Exception("the name '%s' is already claimed on the session bus" % BUS_NAME)
    log("notifications: bus name '%s', request=%s" % (BUS_NAME, request))
    return DBUSNotificationsForwarder(bus, notify_callback, close_callback)
Ejemplo n.º 2
0
def register(notify_callback=None, close_callback=None, replace=False):
    from xpra.x11.dbus_common import init_session_bus
    bus = init_session_bus()
    flags = dbus.bus.NAME_FLAG_DO_NOT_QUEUE
    if replace:
        flags |= dbus.bus.NAME_FLAG_REPLACE_EXISTING
    request = bus.request_name(BUS_NAME, flags)
    if request == dbus.bus.REQUEST_NAME_REPLY_EXISTS:
        raise Exception("the name '%s' is already claimed on the session bus" %
                        BUS_NAME)
    log("notifications: bus name '%s', request=%s" % (BUS_NAME, request))
    return DBUSNotificationsForwarder(bus, notify_callback, close_callback)
Ejemplo n.º 3
0
    def __init__(self):
        from xpra.x11.dbus_common import init_session_bus

        self.bus = init_session_bus()
Ejemplo n.º 4
0
 def __init__(self):
     from xpra.x11.dbus_common import init_session_bus
     self.bus = init_session_bus()