Re: [Google Wave APIs] Python Robot API: GadgetStateChanged and Filters

2010-04-16 Thread pamela (Google Employee)
Ah - the GadgetStateChanged event works with filter, but the filter is
attended to filter on the URL of the gadget, so that you can only listen to
changes for a particular gadget.

We'll improve the documentation to make that clearer.

It's possible that a document changed filter will work for what you want,
since the gadget state is technically a part of the document. I have not
tested that, however.

- pamela

On Wed, Apr 14, 2010 at 5:51 AM, Martin Kreichgauer 
kreichga...@googlemail.com wrote:

 Hello,

 I tried using the filters of the Python v2 Robot API with the
 GadgetStateChanged event. The code looks like this:

 def on_gadget_state_changed(event, wavelet):
 # ...
 my_robot = robot.Robot(my_robot, profile_url='url')
 my_robot.register_handler(events.GadgetStateChanged,
 on_gadget_state_changed,
 filter=StringThatDoesNotAppearAnywhereInTheGadgetState)
 appengine_robot_runner.run(my_robot, debug=True)

 I would expect that the handler never gets called because the filter
 string can certainly not be found in the wave or any gadget state.
 However, the event handler is called every single time the gadget
 state changes. What am I doing wrong?

 Thanks,
 Martin Kreichgauer

 --
 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-...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-wave-api+unsubscr...@googlegroups.comgoogle-wave-api%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-wave-api?hl=en.



-- 
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-...@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] Python Robot API: GadgetStateChanged and Filters

2010-04-14 Thread Martin Kreichgauer
Hello,

I tried using the filters of the Python v2 Robot API with the
GadgetStateChanged event. The code looks like this:

def on_gadget_state_changed(event, wavelet):
# ...
my_robot = robot.Robot(my_robot, profile_url='url')
my_robot.register_handler(events.GadgetStateChanged,
on_gadget_state_changed,
filter=StringThatDoesNotAppearAnywhereInTheGadgetState)
appengine_robot_runner.run(my_robot, debug=True)

I would expect that the handler never gets called because the filter
string can certainly not be found in the wave or any gadget state.
However, the event handler is called every single time the gadget
state changes. What am I doing wrong?

Thanks,
Martin Kreichgauer

-- 
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-...@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.