MCPcopy Create free account
hub / github.com/ActiveState/code / delete

Method delete

recipes/Python/577635_Directory_Pruner_3/recipe-577635.py:706–720  ·  view source on GitHub ↗

Delete this node (optionally, return parent).

(self, get_parent=False, from_tree=True)

Source from the content-addressed store, hash-verified

704 self.__tree.detach(self.__node)
705
706 def delete(self, get_parent=False, from_tree=True): # Internal Last Flag
707 "Delete this node (optionally, return parent)."
708 if self.__tree.exists(self.__node):
709 parent = self.parent if get_parent else None
710 # PATCH: Remove extra data about node.
711 if TrimDir.SIZE:
712 for child in self.children:
713 child.delete(from_tree=False)
714 del self.__tree.nodes[self.__node]
715 if from_tree:
716 self.__tree.delete(self.__node)
717 #=====================================
718 return parent
719 if get_parent:
720 raise ValueError('Cannot return parent!')
721
722 ########################################################################
723

Callers 15

__updateMethod · 0.45
__stopMethod · 0.45
kill_xyFunction · 0.45
updateFunction · 0.45
drawFunction · 0.45
destroyMethod · 0.45
drawFunction · 0.45
updateFunction · 0.45
create_widgetsMethod · 0.45
cricket_getinfoMethod · 0.45
releaseFunction · 0.45
deleteFunction · 0.45

Calls 1

existsMethod · 0.45

Tested by

no test coverage detected