Python syntax error with D-BUS 0.34

Sean Meiners Sean.Meiners at linspireinc.com
Tue Jul 12 03:55:41 EST 2005


Since we're still using python 2.3 as well I found another solution:
Change:
    @method('org.freedesktop.DBus.Introspectable')
To:
    Introspect = method('org.freedesktop.DBus.Introspectable')(Introspect)
Where Introspect is the name of the function being decorated.

This way you can still use the service class if you like (removing the 
decorator altogether breaks it).


On Saturday 09 July 2005 07:10 am, Thomas Leonard wrote:
> Hi all,
>
> While updating ROX-Session to support D-BUS 0.34, I hit a problem with the
> Python bindings:
>
> $ python
> Python 2.3.5 (#2, Jun 19 2005, 13:28:00)
>
> >>> import dbus
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "/usr/local/lib/python2.3/site-packages/dbus/__init__.py", line 1,
> in ? from _dbus import *
>   File "/usr/local/lib/python2.3/site-packages/dbus/_dbus.py", line 48, in
> ? from services import *
>   File "/usr/local/lib/python2.3/site-packages/dbus/services.py", line 179
>     @method('org.freedesktop.DBus.Introspectable')
>     ^
> SyntaxError: invalid syntax
>
>
> I was able to work around this with:
>
> import empty
> sys.modules['dbus.services'] = empty
>
> (where 'empty.py' is an empty file)
>
> It all seems to work OK now. However, it would be nicer if this wasn't
> necessary. Perhaps 'services' could be made an optional import, so people
> who don't need it don't have to import it? Currently, there's a
>
> from services import *
>
> in dbus/__init__.py, which doesn't really seem necessary.
>
>
> --
> Dr Thomas Leonard		http://rox.sourceforge.net
> GPG: 9242 9807 C985 3C07 44A6  8B9A AE07 8280 59A5 3CC1

-- 
Sean Meiners
Sean.Meiners at LinspireInc.com


Perl - $Just @when->$you ${thought} s/yn/tax/ &couldn\'t %get $worse;


More information about the dbus mailing list