[Google Wave APIs] Re: Use of WAVELET_BLIP_CREATED with Python API

2009-10-30 Thread Jeff

Austin,

As far as I can tell, the event is being generated and processed... I
just can't act on the "new blip".  The event properties (blipId) has a
reference to the root blip and another property (newBlipId) which I
can only assume refers to the "blip in progress"  But even with that
id, I haven't been able to figure out how to grab a reference to this
new blip via the model and interact with its document.

When I test this code in the sandbox, the event fires whenever I
create a blip or even nested blips ... and is dumping log data into
App Engine.

If there is anything I can do to help confirm/debunk the existence of
the bug, let me know. Otherwise, I'll wait patiently to see if any
progress happens on the Google end.

Thanks!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Wave API" group.
To post to this group, send email to google-wave-api@googlegroups.com
To unsubscribe from this group, send email to 
google-wave-api+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en
-~--~~~~--~~--~--~---



[Google Wave APIs] Re: Use of WAVELET_BLIP_CREATED with Python API

2009-10-29 Thread Austin Chau (Google employee)
Hi,

Actually I think there is a bug with the WAVELET_BLIP_CREATED event.  It
seems that only root blip creation would trigger the event.  I have filed a
bug for -

http://code.google.com/p/google-wave-resources/issues/detail?id=372

Austin

On Thu, Oct 29, 2009 at 11:51 AM, Jeff  wrote:

>
> I am looking to get a robot to perform the following: When a new blip
> is added to a Wave, the robot pre-fills the blip content with some
> text (before the user might click the "Done" button).
>
> My example code properly sets up a Robot and fires a handler on
> WAVELET_BLIP_CREATED just as I want. Initially, my first thought was
> to retrieve the "newBlipId" property and use context.GetBlipById
> (...).  Problem is, this appears to return None.  If I retrieve the
> other "blipId" property and use GetBlipById, it returns the root blip.
>
> Here's what my code looks like...
>
> from waveapi import events
> from waveapi import model
> from waveapi import robot
>
> import logging
>
> def OnBlipCreated(properties, context):
>  """Invoked when a blip is created"""
>  logging.debug(properties)
>  blip = context.GetBlipById(properties['newBlipId'])
>  blip.GetDocument().SetText("YATTA!")
>
> ... (handler and robot boostrap omitted) ...
>
> Does anyone have any suggestions? Is this a limitation of the current
> API or am I missing something obvious?
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Wave API" group.
To post to this group, send email to google-wave-api@googlegroups.com
To unsubscribe from this group, send email to 
google-wave-api+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en
-~--~~~~--~~--~--~---