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

2010-04-17 Thread Martin Kreichgauer
I see. Actually filtering for the gadget URL would work fine for my
use case. But I still don't understand why the handler with the filter
in above example gets called at all. If it filters for the gadget url,
shouldn't it only get called if the gadget URL contains
"StringThatDoesNotAppearAnywhereInTheGadgetState"?

Thanks,
Martin

On Apr 16, 1:25 pm, "pamela (Google Employee)" 
wrote:
> 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.com > 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 
> athttp://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] Re: onBlipSubmitted on gadget state update?

2010-04-14 Thread Martin Kreichgauer
Hey,

looks like this is a known issue: 
http://code.google.com/p/google-wave-resources/issues/detail?id=422

- Martin

On Apr 14, 1:47 pm, Willy Lai  wrote:
> Hi there,
>
> Could it be, that the onBlipSubmittedEvent is fired, when a gadget
> state is updated?
>
> Cheers
> Will

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



[Google Wave APIs] Re: Synchronous HTTP requests

2009-12-20 Thread Martin Kreichgauer
Thanks for your response and sorry for the late reply:

While I'm aware that the best thing to do from a design perspective
would be to rewrite the calls so they are handled asynchronously, we
probably will not do that in the short run because the application is
simply too complex (3 years, dozens of developers, several thousand
LOC) and we would probably end up having to rewrite a lot of code in a
lot of different places.

However, what should work for us in the short run is enabling Cross-
Origin Resource Sharing (cf. http://www.w3.org/TR/access-control/) so
our web server answers cross-domain XHR correctly (works in FF3,
Chrome, Safari 4). Pretty neat.

-Martin

On Dec 17, 5:20 pm, David Nesting  wrote:
> On Tue, Dec 15, 2009 at 9:50 AM, Martin Kreichgauer <
>
> kreichga...@googlemail.com> wrote:
> > that this is not particularly good design, but rewriting the client
> > code in a way that the requests are performed asynchronously is
> > currently not an option. :-/ Is there any way to make
>
> I'm not aware of a way to make that method synchronous.  Adapting the code
> to work asynchronously (which usually is pretty easy) seems to me to be the
> clear and correct thing to do here.  If this isn't an option because you're
> not sure how best to approach it, let us know where you're stuck and someone
> can suggest a solution for you.
>
> function example() {
>   var x = someFunction();
>   var result = neededSynchronousFunction();  // this is what you need to
> work
>   doSomethingElse(x, result);
>
> }
>
> function example2() {
>   var x = someFunction();
>   asynchronousFunction(function(result) {
>     doSomethingElse(x, result);
>   });
>
> }
>
> David

--

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] Synchronous HTTP requests

2009-12-16 Thread Martin Kreichgauer
Hello,

we're currently moving an existing application into Wave and making it
collaborative. The client code of the application is a comparably huge
code base that does a lot of XMLHttpRequests. In wave we have to use
gadgets.io.makeRequest in order to make requests to a different
domain. However, a lot of the requests are done synchronously. I know
that this is not particularly good design, but rewriting the client
code in a way that the requests are performed asynchronously is
currently not an option. :-/ Is there any way to make
gadgets.io.makeRequest perform synchronous requests?

Kind regards,
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.