如果你看一下sourcecode爲OpBasedDocument.InsertInlineBlip()
你會看到以下內容:
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()
returns the value的AddBlip()
,這是...頓,頓,頓...一個曇花一現。
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
編輯: 這是有趣的是,插入法InsertInlineBlip(self, position)
的方法簽名是從插入方法InsertElement(self, position, element)
顯著不同。 InsertInlineBlip()
不需要插入一個元素參數。看來InsertInlineBlip()
目前的邏輯更像Blip.CreateChild()
,它返回一個新的孩子blip與工作。由此我們可以懷疑這個API會隨着功能的增加而改變。
呵呵,從新手到重新標記初學者,有什麼科學的區別? ;) – Martin 2009-10-13 17:20:47
我想,「新手」可能有負面的內涵。 – ceejayoz 2009-10-13 17:29:29
跟隨初學者標籤的數字是3051,新手60.這就是全部 – SilentGhost 2009-10-13 17:29:45