[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-dbus
Subject:    Re: Object attributes on the bus
From:       "John (J5) Palmieri" <johnp () redhat ! com>
Date:       2006-06-12 14:24:15
Message-ID: 1150122255.2916.127.camel () remedyz ! boston ! redhat ! com
[Download RAW message or body]

On Mon, 2006-06-12 at 11:17 +0200, Luigi Paioro wrote:
> Hello!
> 
> I'd like to know whether is it possible to put an object on the bus 
> enabling the access to its attributes. For example (Python):
> 
> class HelloObject(dbus.service.Object):
> 
>    def __init__(self, bus_name, object_path='/example/HelloObject'):
>      self.name = 'Hello Object'
>      self.version = 1.5
> 
>    @dbus.service.method('example.HelloObjectIface')
>    def hello(self):
>      print "Hello from: ", self.name
> 
> 
> OK, while of such object I can use the method hello() ('cause I have an 
> interface), I cannot access to the attributes self.name and self.version 
> directly, but I must provide two methods which retrieve them (getName() 
> and getVersion() for example). I'm right? Or does it exist a way to 
> interface the attributes of an object?
> 
> Thank you.
> 
> Luigi

We haven't added a way to get properties though it is in the dbus spec.
For right now you need to create your own methods.  We will be thinking
about how to best implement this in the future.  Should be easy.

-- 
John (J5) Palmieri <johnp@redhat.com>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic