nodes: make submodules sorting be equal to Directory

This commit is contained in:
Marcin Lulek 2019-02-12 10:24:48 +01:00
parent 3ab8040abf
commit ab90363218

View file

@ -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)