本文整理汇总了Python中orgmode.liborgmode.base.MultiPurposeList.__delitem__方法的典型用法代码示例。如果您正苦于以下问题:Python MultiPurposeList.__delitem__方法的具体用法?Python MultiPurposeList.__delitem__怎么用?Python MultiPurposeList.__delitem__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类orgmode.liborgmode.base.MultiPurposeList
的用法示例。
在下文中一共展示了MultiPurposeList.__delitem__方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __delitem__
# 需要导入模块: from orgmode.liborgmode.base import MultiPurposeList [as 别名]
# 或者: from orgmode.liborgmode.base.MultiPurposeList import __delitem__ [as 别名]
def __delitem__(self, i):
item = self[i]
if item.previous_sibling:
item.previous_sibling._next_sibling = item.next_sibling
if item.next_sibling:
item.next_sibling._previous_sibling = item.previous_sibling
self._add_to_deleted_headings(item)
MultiPurposeList.__delitem__(self, i)
示例2: __delitem__
# 需要导入模块: from orgmode.liborgmode.base import MultiPurposeList [as 别名]
# 或者: from orgmode.liborgmode.base.MultiPurposeList import __delitem__ [as 别名]
def __delitem__(self, i, taint=True):
item = self[i]
if item.previous_sibling:
item.previous_sibling._next_sibling = item.next_sibling
if item.next_sibling:
item.next_sibling._previous_sibling = item.previous_sibling
# if taint:
# self._add_to_deleted_domobjs(item)
MultiPurposeList.__delitem__(self, i)
示例3: __delitem__
# 需要导入模块: from orgmode.liborgmode.base import MultiPurposeList [as 别名]
# 或者: from orgmode.liborgmode.base.MultiPurposeList import __delitem__ [as 别名]
def __delitem__(self, i, taint=True):
if isinstance(i, slice):
items = self[i]
if items:
first = items[0]
last = items[-1]
if first.previous_sibling:
first.previous_sibling._next_sibling = last.next_sibling
if last.next_sibling:
last.next_sibling._previous_sibling = first.previous_sibling
# if taint:
# self._add_to_deleted_domobjs(items)
else:
item = self[i]
if item.previous_sibling:
item.previous_sibling._next_sibling = item.next_sibling
if item.next_sibling:
item.next_sibling._previous_sibling = item.previous_sibling
# if taint:
# self._add_to_deleted_domobjs(item)
MultiPurposeList.__delitem__(self, i)
示例4: __delitem__
# 需要导入模块: from orgmode.liborgmode.base import MultiPurposeList [as 别名]
# 或者: from orgmode.liborgmode.base.MultiPurposeList import __delitem__ [as 别名]
def __delitem__(self, i, taint=True):
# TODO this method needs more work
if isinstance(i, slice):
items = self[i]
if items:
first = items[0]
last = items[-1]
if first.previous_sibling:
first.previous_sibling._next_sibling = last.next_sibling
if last.next_sibling:
last.next_sibling._previous_sibling = first.previous_sibling
if taint:
self._add_to_deleted_headings(items)
MultiPurposeList.__delitem__(self, i)
else:
item = self[i]
if item.previous_sibling:
item.previous_sibling._next_sibling = item.next_sibling
if item.next_sibling:
item.next_sibling._previous_sibling = item.previous_sibling
if taint:
self._add_to_deleted_headings(item)
MultiPurposeList.__delitem__(self, i)