pyface.sorter module¶
Base class for all sorters.
- class pyface.sorter.Sorter[source]¶
Bases:
HasTraits
Abstract base class for all sorters.
- sort(widget, parent, nodes)[source]¶
Sorts a list of nodes IN PLACE.
‘widget’ is the widget that we are sorting nodes for. ‘parent’ is the parent node. ‘nodes’ is the list of nodes to sort.
Returns the list that was sorted IN PLACE (for convenience).
- category(widget, parent, node)[source]¶
Returns the category (an integer) for an node.
‘parent’ is the parent node. ‘nodes’ is the node to return the category for.
Categories are used to sort nodes into bins. The bins are arranged in ascending numeric order. The nodes within a bin are arranged as dictated by the sorter’s ‘compare’ method.
By default all nodes are given the same category (0).