That's strange, revision 24
http://code.google.com/p/googlewaverobots/source/diff?path=/trunk/robottestwave/robottestwave.py&format=side&r=24&old_path=/trunk/robottestwave/robottestwave.py&old=23,
should theoretically have worked unless the code was executed in a
discrete manner (IE: the state isn't continuous).

Also, a maybe useful tool in the future

http://gist.github.com/229682

Basically a decorator factory that can let you add in handlers on the
fly. (Note I haven't tested this yet so it may be prudent to tread the
waters carefully) It felt like a more intuitive approach than the
instance.RegisterHandler(*args) approach

On Nov 7, 9:51 am, Niall <twom...@gmail.com> wrote:
> I realised my code was fine so that it was probably a problem with
> globals, and found out that you can't use them here, or at least that
> they can't be modified.
> So I used the datastore, and it works now, which is nice.
>
> Working solution can be found on the links I provided above.
>
> On Nov 7, 2:15 pm, Niall <twom...@gmail.com> wrote:
>
>
>
> > Thanks for your reply, Lee. I've been working on and off over the last
> > couple of days and I think I'm stuck.
>
> > The code I'm using can be found here 
> > --http://code.google.com/p/googlewaverobots/source/browse/trunk/robotte...
> > and the gadget is found 
> > herehttp://code.google.com/p/googlewaverobots/source/browse/trunk/robotte...
>
> > (I decided to try to replicate the translation robot, as it seemed
> > like it'd teach me a good amount about python and the APIs)
>
> > Anyway, the problem I'm having is that I can't get the robot, when a
> > new blip is submitted, to read the state of the gadget, but when I
> > modify the languages in the dropdown options it gets them fine. I
> > think the problem is in how I search for the gadget, as when I modify
> > the state of the gadget it works well, but if I don't it doesn't find
> > the gadget.
>
> > I searched the groups and can't find a way of doing this that works
> > for me. I tried making global variables so that when the gadget is
> > modified the language pairs would likewise be modified. I made two
> > variables fr and to (language from which and to which we're
> > translating) and in the onBlipSubmitted I did a global fr and global
> > to and tried modifying them in the gadget key, elem gadget loop but to
> > no avail -- I got no errors, but it wouldn't modify the values for me.
> > You can also see what I've tried on the previous revisions of the
> > code. If I set a default value for the global variables I can't change
> > it, and if I don't set anything it says that the global name is not
> > defined.
>
> > Any help is very much appreciated.
>
> > Cheers.
>
> > On Nov 5, 12:52 am, Lee <leeyuan...@gmail.com> wrote:
>
> > > Looking at the API, the following python object will allow you to
> > > create a local UI on the client browser
>
> > > waveapi.document.Gadget(resource)
>
> > > And
>
> > > blip.GetDocument().AppendElement(Element*)
>
> > > Subclassed instances of Element are also allowed, so you can initiate
> > > a document.Gadget object
>
> > > The wave environment already provides an interface for the host
> > > application (more info 
> > > athttp://code.google.com/apis/wave/extensions/gadgets/guide.html),
> > > the following might help
>
> > > The gadget will contain a list that automatically invokes wave.getState
> > > ().submitDelta(dict); everytime the change event occurs on the list
> > > (you can do this via jQuery) and the result is sent back to the
> > > application, which does what it needs off of the information.
>
> > > On 4 Nov, 17:14, Niall <twom...@gmail.com> wrote:
>
> > > > Thanks for your reply, Lee.
> > > > I don't think the code for aunt-rosie is available (aunt-
> > > > ro...@appspot.com to use it, and the developer's website is 
> > > > herehttp://andrewhitchcock.org/?post=322)
>
> > > > I think I know what I have to do, though. I was looking at the row of
> > > > four source code, so I think I have to make a bit of a module like
> > > > what it's got herehttp://rowoffour.appspot.com/gadget.xml
> > > > I'll go play around with this for a while and report back with
> > > > successes and failures.
>
> > > > On Nov 4, 10:39 pm, Lee <leeyuan...@gmail.com> wrote:
>
> > > > > The beauty of API design, and this is especially true of Google
> > > > > projects, is that the binding exposes the same sets of methods and
> > > > > objects for every language that it supports, so in theory it should be
> > > > > relatively easy to port specific portions of the app across different
> > > > > languages (all you need is a the most rudimentary amount of knowledge
> > > > > about the syntax of Java).
>
> > > > > If you can provide the link to download for the aunt-rosie robot, I
> > > > > can help you locate and port the code to python. (Although it may be
> > > > > in the API document, make sure that you check there first).
>
> > > > > On 4 Nov, 08:42, Niall <twom...@gmail.com> wrote:
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to