| Issue 6: | Ordering methods | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Type: Enhancement
Priority: Low
Hi,
If you think this functions will be useful, please add to the library too.
1) move_left, move_right: move the node to the left/right of its
previous/next sibling if there is one, else do nothing
def move_left(self):
target = self.get_previous_sibling()
if target != None:
self._tree_manager.move_node(self, target, "left")
def move_right(self):
target = self.get_next_sibling()
if target != None:
self._tree_manager.move_node(self, target, "right")
2) sort, change children order of the node
def sort(self, attr, order='ascending', compare_callback=None):
# check the type of attr
# decide comparison function to be used based on attr type
# perform in-place sorting
# I haven't got the implementation yet :-)
Thanks.
Jan 10, 2008
Project Member
#1
jonathan.buchanan
Labels:
-Type-Defect Type-Enhancement
Sep 2, 2010
Can't think of a common use case for these functions
Status:
WontFix
|