Google Wave Extensions Python API – Annotation Documentation

Quick post documenting the much-sought-after structure of the Python API’s Annotation name/value pairing. If you want to annotate a blip’s content, you’ll need to utilise the values below:

  • conv/title
  • lang = en
  • style/fontWeight = bold
  • style/fontStyle = italic
  • style/textDecoration = underline
  • style/textDecoration = line-through
  • style/fontSize = 2em
  • style/color =r gb(229, 51, 51)
  • style/backgroundColor = rgb(51, 127, 229)
  • link/manual = http://example.com/

A Python example of using the above:


msg = "This is a message for you"
doc = wavelet.GetDocument()
doc.SetText(msg)
doc.SetAnnotation(Range(msg[-4:], len(msg) - 1), "style/fontStyle", "italic")

The above should italicise the word “you” in the variable “msg”.

According to Google employee ‘Pamela’, this isn’t set in stone “as we aren’t confident in their stability”. Thanks to Dave of the same Google Group thread for documenting and posting the styling annotation name and value pairs.

Hope that helps someone ;)

One Comment

  1. Posted October 20, 2009 at 19:49 | Permalink

    I have setup a small website http://www.wave-extensions.com that collects many wave extensions. its still in the making so pardon the “in progress” status

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*