Copyright © 2009. All rights reserved.
Copyright © 2009. All rights reserved.
Example: ComponentInterfaceExample.py
This example demonstrates how to access the Component interface directly. It creates (essentially) the same data flow that we created for the simple HelloWord component but rather than using the DataFlow class, we’re building and connecting things manually. In most cases you should never need to handle these things manually but nevertheless, if the need arises, you can take complete control of things as shown in this example.
Produces the output:
Creating HelloWorld() component
This component has these default input ports: ['in']
This component has these default output ports: ['out']
Adding new output port "test1" to HelloWorld component...
This component now has these output ports: ['test1', 'out']
Description for port "in" --> Default input port
Description for port "test1" --> this is where the port description would go
Description for port "out" --> Default output port
HelloWorld does not contain a port called "test2"
Connection status for HelloWorld port "out": False
Connecting ports now...
Connection status now for HelloWorld port "out": True
Sending some test data...
Hello Tom
Hello Dick
Hello Harry