Spoutctl¶
The main spout controller
SpoutCtl
¶
Class for managing spouts end-to-end from the command line.
__init__(discovered_spout)
¶
Initialize SpoutCtl with a DiscoveredSpout object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
discovered_spout |
DiscoveredSpout
|
DiscoveredSpout object used to create and manage spouts. |
required |
create_parser(parser)
¶
Add arguments to the command-line parser for managing the spout.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parser |
argparse.ArgumentParser
|
Command-line parser. |
required |
create_spout(output_type, state_type, id, **kwargs)
¶
Create a spout of a specific type.
Parameters:
Returns:
Name | Type | Description |
---|---|---|
Spout |
Spout
|
The created spout. |
deploy_spout(args)
¶
Deploy a spout of a specific type.
Parameters:
execute_spout(spout, method_name, *args, **kwargs)
¶
Execute a method of a spout.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
spout |
Spout
|
The spout to execute. |
required |
method_name |
str
|
The name of the method to execute. |
required |
*args |
Positional arguments to pass to the method. |
()
|
|
**kwargs |
Keyword arguments to pass to the method. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
Any |
The result of the method. |
run(args)
¶
Run the command-line interface.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
args |
argparse.Namespace
|
Parsed command-line arguments. |
required |