bus_name_has_owner in python

Tony Houghton h at realh.co.uk
Sat Mar 17 07:43:31 PDT 2007


I'm writing a python program which can be launched multiple times, but
only ever runs one instance of itself (a bit like, say, gnome-terminal
does). So I want it to check whether its dbus service exists and if so
use it to get the original instance to open another window then exit; if
the service doesn't exist it starts it itself as well as opening a
window, and stays running in the background.

I was using bus_name_has_owner() but it's now deprecated in dbus-python
0.80.x because it's in the bindings module. What should I use instead?
Perhaps get a list of names from the session bus and check whether the
one I want is among them?

-- 
TH * http://www.realh.co.uk


More information about the dbus mailing list