mod: removed reverse option
This commit is contained in:
+2
-6
@@ -9,19 +9,15 @@ class StringToggle:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls) -> dict:
|
||||
return {
|
||||
'required': {
|
||||
'separator': ('STRING', {'default': ', '}),
|
||||
'reverse': ('BOOLEAN', {'default': False})
|
||||
},
|
||||
'required': { 'separator': ('STRING', {'default': ', '}) },
|
||||
'optional': optional
|
||||
}
|
||||
RETURN_TYPES = ('STRING',)
|
||||
FUNCTION = 'join'
|
||||
CATEGORY = 'utils'
|
||||
def join(self, separator: str, reverse: bool, previous: str = '', **kwargs) -> tuple[str]:
|
||||
def join(self, separator: str, previous: str = '', **kwargs) -> tuple[str]:
|
||||
arguments = {}
|
||||
for (argtype, unique), value in [(k.split('_'),v) for k,v in kwargs.items() if '_' in k]:
|
||||
arguments.setdefault(argtype, {})[unique] = value
|
||||
strings = ([previous] if previous else []) + [text for unique, text in arguments['text'].items() if arguments['append'][unique]]
|
||||
if reverse: strings = strings[::-1]
|
||||
return (separator.join(strings),)
|
||||
|
||||
Reference in New Issue
Block a user