I try to call methods from klipper bus with python. But I could not make it. Here is what i try:
>>> import dbus >>> bus = dbus.SessionBus() >>> proxy = bus.get_object("org.kde.klipper","/org/kde/klipper") >>> print proxy <ProxyObject wrapping <dbus._dbus.SessionBus (session) at 0x7fc249da3bf0> :1.67 /org/kde/klipper at 0x7fc249dc16d0> >>> iface = dbus.Interface(proxy,"org.kde.klipper.klipper") >>> print iface <Interface <ProxyObject wrapping <dbus._dbus.SessionBus (session) at 0x7fc249da3bf0> :1.67 /org/kde/klipper at 0x7fc249dc16d0> implementing 'org.kde.klipper.klipper' at 0x7fc249dc1790> >>> print iface.getClipboardContents() ERROR:dbus.proxies:Introspect error on :1.67:/org/kde/klipper: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownObject: No such object path '/org/kde/klipper' Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.6/site-packages/dbus/proxies.py", line 68, in __call__ return self._proxy_method(*args, **keywords) File "/usr/lib/python2.6/site-packages/dbus/proxies.py", line 140, in __call__ **keywords) File "/usr/lib/python2.6/site-packages/dbus/connection.py", line 622, in call_blocking message, timeout) dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownObject: No such object path '/org/kde/klipper'
As you can see it sets both proxy and interface. But I cannot call methods via this interface.
What can I do? What am i doing wrong?
Edit Solved:
Well when i look to "qdbusviewer" I saw the exact path of klipper. So changing
>> proxy = bus.get_object("org.kde.klipper","/org/kde/klipper")
this line with this:
>>> proxy = bus.get_object("org.kde.klipper","/klipper")
Solves the problem.
I hope this post help someone