Merge pull request #1362 from bruchar1/make-terminal-sortable

DataTreeWidget exception with multivalue Terminal (flowchart)
This commit is contained in:
Ogi Moore 2020-10-12 21:46:28 -07:00 committed by GitHub
commit 539394e20c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -267,6 +267,11 @@ class Terminal(object):
def saveState(self):
return {'io': self._io, 'multi': self._multi, 'optional': self._optional, 'renamable': self._renamable, 'removable': self._removable, 'multiable': self._multiable}
def __lt__(self, other):
"""When the terminal is multi value, the data passed to the DatTreeWidget for each input or output, is {Terminal: value}.
To make this sortable, we provide the < operator.
"""
return self._name < other._name
class TerminalGraphicsItem(GraphicsObject):