-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNVRFilePathConsolidator.py
More file actions
44 lines (37 loc) · 1.45 KB
/
NVRFilePathConsolidator.py
File metadata and controls
44 lines (37 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
class NVRFilePathConsolidator:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"delimiter": ("STRING", {"default": "/"}),
"Input1": ("STRING", {"default": "Input1"}),
},
"optional": {
"Input2": ("STRING", {"default": "Input2"}),
"Input3": ("STRING", {"default": "Input3"}),
"Input4": ("STRING", {"default": "Input4"}),
"Input5": ("STRING", {"default": ""}),
"Input6": ("STRING", {"default": ""}),
}
}
RETURN_TYPES = ("STRING",)
FUNCTION = "concatenate_text"
CATEGORY = "utils/text"
def concatenate_text(self, delimiter, Input1, Input2="", Input3="", Input4="", Input5="",
Input6=""):
# Collect all non-empty text inputs
text_parts = [text for text in [Input1, Input2, Input3, Input4, Input5, Input6] if text]
# Join the parts with the delimiter
result = delimiter.join(text_parts)
# Remove any trailing delimiter
if result.endswith(delimiter):
result = result[:-len(delimiter)]
return (result,)
# Add this to your NODE_CLASS_MAPPINGS
NODE_CLASS_MAPPINGS = {
"NVRFilePathConsolidator": NVRFilePathConsolidator
}
# Add this to your NODE_DISPLAY_NAME_MAPPINGS
NODE_DISPLAY_NAME_MAPPINGS = {
"NVRFilePathConsolidator": "NVR File Path Consolidator"
}