Make nodes comparable (yikes).

This commit is contained in:
Flancian 2021-01-05 12:15:55 +01:00
parent ff444daf0a
commit e80cb442e4
1 changed files with 6 additions and 0 deletions

View File

@ -109,6 +109,12 @@ class Node:
self.url = '/node/' + self.uri
self.subnodes = []
def __lt__(self, other):
return self.wikilink.lower() < other.wikilink.lower()
def __gt__(self, other):
return self.wikilink.lower() > other.wikilink.lower()
def size(self):
return len(self.subnodes)