Pyrhon binding

John (J5) Palmieri johnp at redhat.com
Thu Mar 2 14:36:10 PST 2006


On Thu, 2006-03-02 at 14:46 +0100, Marcin wrote:
> Hi,
> It is posible to add method to existing interface?
> For example, I have 3 classes:
> 
> import...
> 
> class ObjectService(dbus.service.Object):
> 	def __init__(self):
> 		dbus.service.Object.__init__(self, self.__createService(),  
> '/com/ObjectService')
> 

Here is why you can't inherit correctly.  It should look more like:

class ObjectService(dbus.service.Object)
  def __init__(self, bus_name=None, object_path='/com/ObjectService'):
    if not bus_name:
      bus_name = self.__createService()
    dbus.service.Object.__init__(self, bus_name, object_path)

Then you can properly inherit.
-- 
John (J5) Palmieri <johnp at redhat.com>



More information about the dbus mailing list