In Python WaveAPI, you may check if an annotation exists with
doc.HasAnnotation(name), but there is no way to read those
annotations. (*)

Here is the way to add this feature: doc.GetAnnotations():

In waveapi/ops.py, add the following code after def HasAnnotation
(self, name):

  def GetAnnotations(self, name=None):
    """Get named annotations of this document.

    Args:
      name: optional key name of the annotation.

    Returns:
      Array of annotations [{'name':annotation_name,
'value:annotation_value, 'range':(annotation_range_start,
annotation_range_end)}]
    """
    annotations = []
    for a in self._blip.annotations:
      if not name or a.name == name:
        annotations.append({'name':a.name, 'value':a.value, 'range':
(a.range.start, a.range.end)})
    return annotations

That's it !

(*) except with Editor Debug / annotations tab, but ranges values are
+3 (eg range (0,36) is showed as (3,39) in Editor Debug)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Wave API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to