Support prefixes for InputGroups

This commit is contained in:
Carson Katri 2022-11-19 15:00:26 -05:00
commit 66ade0a739
4 changed files with 83 additions and 34 deletions

View file

@ -1,4 +1,13 @@
class InputGroup:
class _InputGroupMeta(type):
def __getitem__(cls, args):
if isinstance(args, str):
class PrefixedInputGroup(InputGroup):
prefix = args
PrefixedInputGroup.__annotations__ = cls.__annotations__
return PrefixedInputGroup
return cls
class InputGroup(metaclass=_InputGroupMeta):
"""
A group of inputs that will be expanded in the node tree.