[PYDBUS]Export method question

Claudio Takahasi cktakahasi at gmail.com
Mon Oct 31 05:09:51 PST 2005


Hi Robert,

Is there a way to get the message header attributes?

I notice that there are methods to set the destination, set serial,
... But I don't
know  how get the received message header attributes.

If I get the message header attributes and create a reply message
after it solve my problem :)

Regards,
Claudio.

On 10/28/05, Robert McQueen <robert.mcqueen at collabora.co.uk> wrote:
> Claudio Takahasi wrote:
> > Hi folks,
>
> Hola,
>
> > When I send a method call "PwdRequest" the application is started
> > automatically, however I CAN'T reply immediately because the reply
> > content is not available.  The reply data(password) will become
> > available only when the user presses the button(OK). How can I design
> > it?
>
> This is a valid problem. Unfortunately there is no solution to this in
> the python bindings at the moment. All method implementations must
> complete synchronously, which makes it hard to do anything like a UI or
> a network operation.
>
> Your current options are (in increasing order of disruption):
>  * Make a horrible hack that keeps iterating the mainloop inside your
> method until the dialog has been responded to by the user. This can get
> ugly because whilst you're in the mainloop inside your PwdRequest
> method, you could get another call to enter the PwdRequest method
> again... insanity may ensue. Its also a good way to get stack overflows,
> huge backtraces, and other horribleness.
>  * Make the PwdRequest application emit a signal when the user has
> entered the password.
>  * Swap the roles of your server and client so the client, when
> activated, prompts for the password, and then invokes a method on the
> server to provide the password when it has been input.
>  * Use the glib bindings which implement asynchronous methods in
> services. :-/
>
> It's quite high on my todo list to fix it so you can have asynchronous
> method implementations, because I'm trying to prototype code that talks
> on the network...
>
> > Thanks in advance,
> > Claudio
>
> Regards,
> Rob
>


--
---------------------------------------------------------
Claudio Takahasi
Instituto Nokia de Tecnologia - INdT


More information about the dbus mailing list