Source code for node_create_text
# This file is part of Sympathy for Data.
# Copyright (c) 2023, Combine Control Systems AB
#
# SYMPATHY FOR DATA COMMERCIAL LICENSE
# You should have received a link to the License with Sympathy for Data.
from sympathy.api import node as synode
from sympathy.api.nodeconfig import Port, Ports, Tag, Tags
[docs]
class CreateText(synode.Node):
"""Create text by writing in the text editor."""
name = 'Create Text'
icon = 'import_text.svg'
nodeid = 'org.sysess.sympathy.create.createtext'
author = 'Jin Guo'
tags = Tags(Tag.Input.Generate)
parameters = synode.parameters()
parameters.set_string('text',
label='Text',
description='Write in the editor to create output '
'text',
editor=synode.editors.textedit_editor())
outputs = Ports(
[Port.Custom('text', 'Output Text', name='output')])
def execute(self, ctx):
output = ctx.output['output']
output.set(ctx.parameters['text'].value)