[maemo-developers] Issues with bora's dbus-python

From: Henri Bergius henri.bergius at iki.fi
Date: Fri Mar 2 16:41:37 EET 2007
Hi, all!

I've been trying to make Maemo Plazer to function as a GeoClue
position backend. GeoClue is a DBUS-based system that applications can
use to get location information for the device. This can eventually be
used for bunch of interesting things like pulling local wikipedia
pages and populating them as Maemo Mapper POIs or whatever.

However, it seems that the version of dbus-python that is available
for bora is not fully compatible with Python 2.5 on the N800. This
means that I can't return multiple values from a DBUS service written
in Python as GeoClue would require.

>From discussion on #dbus:

bergie: Exception exceptions.AttributeError: "'exceptions.TypeError'
object has no attribute '__module__'" in
'dbus_bindings._GIL_safe_cmessage_function_handler' ignored
smcv: that's the python 2.5 incompatibility
smcv: INdT either need to patch their version of pyrex with the python
2.5 compat patch from Fedora and rebuild d-p, or build d-p 0.80.2

Here is some more detailed information about this...

If I return a single value from my method I get a correct response:

$ dbus-send --print-reply --dest=com.plazes.maemoplazer
method return sender=:1.318 -> dest=:1.319
 double 60.1642

But with any other option, I get something else:

 [double 60.2
double 24.5]
(dbus-monitor too dumb to decipher arg type 'r')

If I provide the method signature in the DBUS service decorator, I get
the dbus_bindings._GIL_safe_cmessage_function_handler error shown

HostIP service (which is written in C) returns the right stuff:

$ dbus-send --print-reply
method return sender=:1.159 -> dest=:1.320
 double 60.2167
double 24.6667

My current code is:

in_signature='', out_signature='dd')
    def current_position(self):
        # FIXME: We have to somehow get dbus-python to return multiple
values here
        return self.maemoplazer.lat, self.maemoplazer.lon


And the interface I'm trying to provide is:

    <method name="current_position">
      <arg type="d" name="latitude" direction="out" />
      <arg type="d" name="longitude" direction="out" />


Now, would it be possible to get a fixed dbus-python package for bora?

Henri Bergius
Motorcycle Adventures and Free Software

Skype: henribergius
Jabber: henri.bergius at gmail.com

More information about the maemo-developers mailing list