Googlebot's built-in answer

I recently worked on my first robot for google wave, a vital part of his work is inserting inline replies into a message. I can’t understand for life how to do this!

The API docs have an InsertInlineBlip function that sounds promising, but a call that seems to do nothing!

EDIT :: This seems to be a known bug. However, the question still remains, what is the correct way to insert an embedded image? I am assuming something like this:

inline = blip.GetDocument().InsertInlineBlip(positionInText)
inline.GetDocument().SetText("some text")
+5
source share
3 answers

If you look at the source code for OpBasedDocument.InsertInlineBlip(), you will see the following:

 412 -  def InsertInlineBlip(self, position): 
 413      """Inserts an inline blip into this blip at a specific position. 
 414   
 415      Args: 
 416        position: Position to insert the blip at. 
 417   
 418      Returns: 
 419        The JSON data of the blip that was created. 
 420      """ 
 421      blip_data = self.__context.builder.DocumentInlineBlipInsert( 
 422          self._blip.waveId, 
 423          self._blip.waveletId, 
 424          self._blip.blipId, 
 425          position) 
 426      # TODO(davidbyttow): Add local blip element. 
 427      return self.__context.AddBlip(blip_data) 

, TODO , . , , .

, , . , InsertInlineBlip() AddBlip(), ... dun, dun, dun... .

 543 -  def AddBlip(self, blip_data): 
 544      """Adds a transient blip based on the data supplied. 
 545   
 546      Args: 
 547        blip_data: JSON data describing this blip. 
 548   
 549      Returns: 
 550        An OpBasedBlip that may have operations applied to it. 
 551      """ 
 552      blip = OpBasedBlip(blip_data, self) 
 553      self.blips[blip.GetId()] = blip 
 554      return blip 

EDIT: , Insert InsertInlineBlip(self, position) Insert InsertElement(self, position, element). InsertInlineBlip() . , InsertInlineBlip() Blip.CreateChild(), , . , API .

+4
+2

All Articles