-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathecho.py
More file actions
35 lines (23 loc) · 717 Bytes
/
echo.py
File metadata and controls
35 lines (23 loc) · 717 Bytes
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
"""
Echo Plugin 🐹
This plugin simply echoes back the message provided to it.
Parameters:
- message: A string to echo back. If not provided, defaults to "Hello World!".
Returns:
- message: The message that was echoed back.
Example:
plugin: echo
params:
message: "Hi there!"
Author: Gregor
"""
from taskcrafter.models.plugin import PluginInterface
class Plugin(PluginInterface):
name = "Echo"
description = "Returns end echoes each key in dict or string 🐹"
def run(self, params: dict):
if not isinstance(params, dict):
params = {"message": "Hello world!"}
for key, value in params.items():
print(f"{key}: {value}")
return params