Python: Problem with adding method to interfce

Marcin marcino_l at o2.pl
Fri Mar 3 04:54:25 PST 2006


Hi everyone.

	I have problem with adding method to dbus interface in __init__. Take a  
look:

class A(dbus.service.Object):
	def method(self):
		pass
	# var 1
	method = dbus.server.method('some.interface')(method) # <- this variant  
works
	
	def __init__(self):
		# var 2
		self.method = dbus.server.method('some.interface')(self.method)
		# ^^^ this variant doesn't work...?
		dbus.service.Object.__init__(self, dbus.service.BusName('some.service',  
bus=dbus.								SessionBus()), '/some/object')
ob = A()

Does anyone know why var 2 doesn't work?

A obtain that error:
   File "/usr/lib/python2.4/site-packages/dbus/decorators.py", line 31, in  
decorator
     func._dbus_is_method = True
AttributeError: 'instancemethod' object has no attribute '_dbus_is_method'

Thanks for any help.

Marcin		

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


More information about the dbus mailing list