|
|
2009-12-29
, 14:21
|
|
|
Posts: 516 |
Thanked: 643 times |
Joined on Oct 2009
@ Denmark/Poland
|
#2
|


|
|
2009-12-29
, 15:28
|
|
|
Posts: 59 |
Thanked: 42 times |
Joined on Nov 2009
@ Wageningen (NL)
|
#3
|
You may want to take a look at this:
http://slexy.org/view/s25h3to4Rr
Probably bus.get_object may be interesting for you.

<Interface <ProxyObject wrapping <dbus._dbus.SessionBus (session) at 0x226d50> :1.848 /Provider at 0x216ff0> implementing 'com.nokia.Navigation.MapProvider' at 0x22d0f0>
|
|
2010-01-02
, 18:10
|
|
Posts: 14 |
Thanked: 18 times |
Joined on Dec 2009
|
#4
|
Actually, I started with that code
In my code I use bus.get_object, and it succeeds.
Getting a proxy using dbus.Interface also seems to work , it prints:
but the call to the LocationToAddresses method fails..Code:<Interface <ProxyObject wrapping <dbus._dbus.SessionBus (session) at 0x226d50> :1.848 /Provider at 0x216ff0> implementing 'com.nokia.Navigation.MapProvider' at 0x22d0f0>
using 'dbus-monitor --monitor' I found the following call to the nokia maps service:
method call sender=:1.847 -> dest=com.nokia.Navigation.NokiaMapsProvider serial=11 path=/Provider; interface=com.nokia.Navigation.MapProvider; member=LocationToAddresses double 51.9785 double 5.66882 boolean false method return sender=:1.848 -> dest=:1.847 reply_serial=11 object path "/nokiamaps/response/3" signal sender=:1.848 -> dest=(null destination) serial=13 path=/nokiamaps/response/3; interface=com.nokia.Navigation.MapProvider; member=LocationToAddressReply array [ array [ string "9" string "" string "Roghorst" string "" string "Wageningen" string "" string "" string "6708" string "" string "NLD" string "" ] ]What I've tried so far is:
import sys import dbus from dbus.mainloop.qt import DBusQtMainLoop from PyQt4 import QtCore from PyQt4 import QtGui app = QtGui.QApplication(sys.argv) dbus_loop = DBusQtMainLoop() bus = dbus.SessionBus(mainloop=dbus_loop) provider = bus.get_object('com.nokia.Navigation.NokiaMapsProvider', '/Provider') proxy = dbus.Interface(provider, 'com.nokia.Navigation.MapProvider') print proxy print proxy.LocationToAddresses(51.9784,5.669,False)<Interface <ProxyObject wrapping <dbus._dbus.SessionBus (session) at 0x226d50> :1.848 /Provider at 0x216ff0> implementing 'com.nokia.Navigation.MapProvider' at 0x22d0f0> ERROR:dbus.proxies:Introspect error on :1.848:/Provider: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Message did not receive a reply (timeout by message bus) Traceback (most recent call last): File "discover.py", line 23, in <module> print proxy.LocationToAddresses(51.9784,5.669,False) File "/usr/lib/pymodules/python2.5/dbus/proxies.py", line 68, in __call__ return self._proxy_method(*args, **keywords) File "/usr/lib/pymodules/python2.5/dbus/proxies.py", line 140, in __call__ **keywords) File "/usr/lib/pymodules/python2.5/dbus/connection.py", line 622, in call_blocking message, timeout) dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.848 was not provided by any .service files