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

Method __sort

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

Sort an expanded node's children by the given key.

(self, key)

Source from the content-addressed store, hash-verified

837 self.__sort(lambda child: child.path)
838
839 def __sort(self, key):
840 "Sort an expanded node's children by the given key."
841 if self.expanded:
842 nodes = list(self.children)
843 order = sorted(nodes, key=key)
844 if order == nodes:
845 order = reversed(order)
846 for child in order:
847 self.__tree.move(child.__node, self.__node, tkinter.END)
848
849################################################################################
850# Directory Pruner 3/view.py

Callers 4

sort_nameMethod · 0.95
sort_total_sizeMethod · 0.95
sort_file_sizeMethod · 0.95
sort_pathMethod · 0.95

Calls 4

listClass · 0.85
sortedFunction · 0.50
reversedFunction · 0.50
moveMethod · 0.45

Tested by

no test coverage detected