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
instead

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
/com/plazes/maemoplazer
org.foinse_project.geoclue.position.current_position
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]
...or...
(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
above.

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

$ dbus-send --print-reply
--dest=org.foinse_project.geoclue.position.hostip
/org/foinse_project/geoclue/position/hostip
org.foinse_project.geoclue.position.current_position
method return sender=:1.159 -> dest=:1.320
double 60.2167
double 24.6667

My current code is:

   @dbus.service.method("org.foinse_project.geoclue.position",
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

(https://garage.maemo.org/plugins/scmsvn/viewcvs.php/trunk/src/maemoplazer_service.py?root=maemoplazer&view=markup)

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" />
   </method>

(http://svn.foinse-project.org/geoclue/trunk/geoclue/position_glue.xml)

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

--
Henri Bergius
Motorcycle Adventures and Free Software
http://bergie.iki.fi/

Skype: henribergius
Jabber: [EMAIL PROTECTED]
_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers

Reply via email to