nodes: make submodules sorting be equal to Directory
This commit is contained in:
parent
3ab8040abf
commit
ab90363218
1 changed files with 4 additions and 0 deletions
|
|
@ -200,8 +200,12 @@ class Node(object):
|
|||
"""
|
||||
Comparator using name of the node, needed for quick list sorting.
|
||||
"""
|
||||
|
||||
kind_cmp = cmp(self.kind, other.kind)
|
||||
if kind_cmp:
|
||||
if isinstance(self, SubModuleNode):
|
||||
# we make submodules equal to dirnode for "sorting" purposes
|
||||
return NodeKind.DIR
|
||||
return kind_cmp
|
||||
return cmp(self.name, other.name)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue