hi, i am new on google wave, and i m playing with the python api, the
api reference is quite poor documented atm, and the biggest problem is
that i cannot find where the interpreter gives me errors when i run my
robot on google ap engine. anyway this is my problem:

Problem:
i delete a string in a blip, and replace it with an image, using
DOCUMENT_CHANGED event.
if the user stop writing after the text tag that is replaced by the
image, the image is put after the cursor, and so he will continue
writing before the image, and thats not what i need.

i need to delete the tagtext, insert an image and keep the cursor
after the image.

i have read some problems similir to mine, someone say to use
annotation but i cant find the wat and how to use that, if u please
can give me some code, just where to start.


here is my code:

Regexp=re.compile(':(.+?):',re.MULTILINE|re.DOTALL)

def OnSubmit(properties, context):
    doc = context.GetBlipById(properties['blipId']).GetDocument()
    text = doc.GetText()
    smiles = Regexp.finditer(text)
    for s in smiles:
        smil=s.group(1)
        im=document.Image("http://www.m4d.it/forum/images/
smilies/"+smil+".gif")
        doc.DeleteRange(document.Range(s.start(),s.end()))

--

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.


Reply via email to