hi!
I've written a script that connects to d-bus session bus on a remote computer like so:
os.environ["DBUS_SESSION_BUS_ADDRESS"] = "tcp:host=192.168.0.1,port=1234"
bus = dbus.SessionBus()
That works fine except now I need to be able to connect to multiple session buses on different computers. I've tried the following:
os.environ["DBUS_SESSION_BUS_ADDRESS"] = "tcp:host=192.168.0.1,port=1234"
bus1 = dbus.SessionBus()
os.environ["DBUS_SESSION_BUS_ADDRESS"] = "tcp:host=192.168.0.2,port=1234"
bus2 = dbus.SessionBus()
But it doesn't work. The second call to SessionBus returns the same object as the first call. ie. in this case both objects refer to the session bus on 192.168.0.1. It seems only the first call to SessionBus actually does anything and all subsequent calls just return the object that was created on the first call. Does anyone know a way around this?